summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/comment.module4
-rw-r--r--modules/comment/comment.module4
-rw-r--r--modules/node.module7
-rw-r--r--modules/node/node.module7
-rw-r--r--modules/upload.module6
-rw-r--r--modules/upload/upload.module6
6 files changed, 18 insertions, 16 deletions
diff --git a/modules/comment.module b/modules/comment.module
index 6d9d0a500..94ba609a9 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -232,8 +232,8 @@ function comment_link($type, $node = 0, $main = 0) {
}
function comment_form_alter($form_id, &$form) {
- if (substr($form_id, -14) == '_node_settings') {
- $form['workflow']['comment_'. $node->type] = array('#type' => 'radios', '#title' => t('Default comment setting'), '#default_value' => variable_get('comment_'. $node->type, COMMENT_NODE_READ_WRITE), '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), '#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'));
+ if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
+ $form['workflow']['comment_'. $form['type']['#value']] = array('#type' => 'radios', '#title' => t('Default comment setting'), '#default_value' => variable_get('comment_'. $form['type']['#value'], COMMENT_NODE_READ_WRITE), '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), '#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'));
}
}
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 6d9d0a500..94ba609a9 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -232,8 +232,8 @@ function comment_link($type, $node = 0, $main = 0) {
}
function comment_form_alter($form_id, &$form) {
- if (substr($form_id, -14) == '_node_settings') {
- $form['workflow']['comment_'. $node->type] = array('#type' => 'radios', '#title' => t('Default comment setting'), '#default_value' => variable_get('comment_'. $node->type, COMMENT_NODE_READ_WRITE), '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), '#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'));
+ if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
+ $form['workflow']['comment_'. $form['type']['#value']] = array('#type' => 'radios', '#title' => t('Default comment setting'), '#default_value' => variable_get('comment_'. $form['type']['#value'], COMMENT_NODE_READ_WRITE), '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), '#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'));
}
}
diff --git a/modules/node.module b/modules/node.module
index dac183dff..d6c66b7c8 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1239,6 +1239,7 @@ function node_types_configure($type = NULL) {
'#description' => t('The minimum number of words a %type must be to be considered valid. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.', array('%type' => node_get_name($type)))
);
$form['workflow'] = array('#type' => 'fieldset', '#title' =>t('Workflow'));
+ $form['type'] = array('#type' => 'value', '#value' => $type);
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
return system_settings_form($type .'_node_settings', $form);
@@ -2055,9 +2056,9 @@ function node_update_index() {
}
function node_form_alter($form_id, &$form) {
- if (substr($form_id, -14) == '_node_settings') {
- $form['workflow']['node_options_'. $node->type] = array(
- '#type' => 'checkboxes', '#title' => t('Default options'), '#default_value' => variable_get('node_options_'. $node->type, array('status', 'promote')),
+ if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
+ $form['workflow']['node_options_'. $form['type']['#value']] = array(
+ '#type' => 'checkboxes', '#title' => t('Default options'), '#default_value' => variable_get('node_options_'. $form['type']['#value'], array('status', 'promote')),
'#options' => array('status' => t('Published'), 'moderate' => t('In moderation queue'), 'promote' => t('Promoted to front page'), 'sticky' => t('Sticky at top of lists'), 'revision' => t('Create new revision')),
'#description' => t('Users with the <em>administer nodes</em> permission will be able to override these options.'),
);
diff --git a/modules/node/node.module b/modules/node/node.module
index dac183dff..d6c66b7c8 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1239,6 +1239,7 @@ function node_types_configure($type = NULL) {
'#description' => t('The minimum number of words a %type must be to be considered valid. This can be useful to rule out submissions that do not meet the site\'s standards, such as short test posts.', array('%type' => node_get_name($type)))
);
$form['workflow'] = array('#type' => 'fieldset', '#title' =>t('Workflow'));
+ $form['type'] = array('#type' => 'value', '#value' => $type);
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
return system_settings_form($type .'_node_settings', $form);
@@ -2055,9 +2056,9 @@ function node_update_index() {
}
function node_form_alter($form_id, &$form) {
- if (substr($form_id, -14) == '_node_settings') {
- $form['workflow']['node_options_'. $node->type] = array(
- '#type' => 'checkboxes', '#title' => t('Default options'), '#default_value' => variable_get('node_options_'. $node->type, array('status', 'promote')),
+ if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
+ $form['workflow']['node_options_'. $form['type']['#value']] = array(
+ '#type' => 'checkboxes', '#title' => t('Default options'), '#default_value' => variable_get('node_options_'. $form['type']['#value'], array('status', 'promote')),
'#options' => array('status' => t('Published'), 'moderate' => t('In moderation queue'), 'promote' => t('Promoted to front page'), 'sticky' => t('Sticky at top of lists'), 'revision' => t('Create new revision')),
'#description' => t('Users with the <em>administer nodes</em> permission will be able to override these options.'),
);
diff --git a/modules/upload.module b/modules/upload.module
index 50a4c0861..195e9d677 100644
--- a/modules/upload.module
+++ b/modules/upload.module
@@ -144,9 +144,9 @@ function upload_file_download($file) {
}
function upload_form_alter($form_id, &$form) {
- if (substr($form_id, -14) == '_node_settings') {
- $form['workflow']['upload_'. $node->type] = array(
- '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $node->type, 1),
+ if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
+ $form['workflow']['upload_'. $form['type']['#value']] = array(
+ '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $form['type']['#value'], 1),
'#options' => array(t('Disabled'), t('Enabled')),
);
}
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 50a4c0861..195e9d677 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -144,9 +144,9 @@ function upload_file_download($file) {
}
function upload_form_alter($form_id, &$form) {
- if (substr($form_id, -14) == '_node_settings') {
- $form['workflow']['upload_'. $node->type] = array(
- '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $node->type, 1),
+ if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
+ $form['workflow']['upload_'. $form['type']['#value']] = array(
+ '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $form['type']['#value'], 1),
'#options' => array(t('Disabled'), t('Enabled')),
);
}