summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/comment.module9
-rw-r--r--modules/comment/comment.module9
-rw-r--r--modules/node.module24
-rw-r--r--modules/node/node.module24
-rw-r--r--modules/upload.module15
-rw-r--r--modules/upload/upload.module15
6 files changed, 46 insertions, 50 deletions
diff --git a/modules/comment.module b/modules/comment.module
index 36f81ac93..12a23143a 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -231,15 +231,18 @@ function comment_link($type, $node = 0, $main = 0) {
return $links;
}
+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.'));
+ }
+}
+
/**
* Implementation of hook_nodeapi().
*
*/
function comment_nodeapi(&$node, $op, $arg = 0) {
switch ($op) {
- case 'settings':
- $form['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.'));
- return $form;
case 'fields':
return array('comment');
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 36f81ac93..12a23143a 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -231,15 +231,18 @@ function comment_link($type, $node = 0, $main = 0) {
return $links;
}
+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.'));
+ }
+}
+
/**
* Implementation of hook_nodeapi().
*
*/
function comment_nodeapi(&$node, $op, $arg = 0) {
switch ($op) {
- case 'settings':
- $form['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.'));
- return $form;
case 'fields':
return array('comment');
diff --git a/modules/node.module b/modules/node.module
index aad24f85f..dac183dff 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1227,7 +1227,6 @@ function node_multiple_delete_confirm_execute($form_id, $edit) {
*/
function node_types_configure($type = NULL) {
if (isset($type)) {
- // Go to the listing page when we submit this form, system_settings_save() calls drupal_goto().
$node = new stdClass();
$node->type = $type;
$form['submission'] = array('#type' => 'fieldset', '#title' =>t('Submission form') );
@@ -1240,10 +1239,9 @@ 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['workflow'] = array_merge($form['workflow'], node_invoke_nodeapi($node, 'settings'));
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
- return system_settings_form($type . '_node_settings', $form);
+ return system_settings_form($type .'_node_settings', $form);
}
else {
$header = array(t('Type'), t('Operations'));
@@ -2056,19 +2054,13 @@ function node_update_index() {
}
}
-/**
- * Implementation of hook_nodeapi().
- */
-function node_nodeapi(&$node, $op, $arg = 0) {
- switch ($op) {
- case 'settings':
- $form['node_options_'. $node->type] = array(
- '#type' => 'checkboxes', '#title' => t('Default options'), '#default_value' => variable_get('node_options_'. $node->type, 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.')
- );
- return $form;
+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')),
+ '#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 aad24f85f..dac183dff 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1227,7 +1227,6 @@ function node_multiple_delete_confirm_execute($form_id, $edit) {
*/
function node_types_configure($type = NULL) {
if (isset($type)) {
- // Go to the listing page when we submit this form, system_settings_save() calls drupal_goto().
$node = new stdClass();
$node->type = $type;
$form['submission'] = array('#type' => 'fieldset', '#title' =>t('Submission form') );
@@ -1240,10 +1239,9 @@ 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['workflow'] = array_merge($form['workflow'], node_invoke_nodeapi($node, 'settings'));
$form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
- return system_settings_form($type . '_node_settings', $form);
+ return system_settings_form($type .'_node_settings', $form);
}
else {
$header = array(t('Type'), t('Operations'));
@@ -2056,19 +2054,13 @@ function node_update_index() {
}
}
-/**
- * Implementation of hook_nodeapi().
- */
-function node_nodeapi(&$node, $op, $arg = 0) {
- switch ($op) {
- case 'settings':
- $form['node_options_'. $node->type] = array(
- '#type' => 'checkboxes', '#title' => t('Default options'), '#default_value' => variable_get('node_options_'. $node->type, 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.')
- );
- return $form;
+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')),
+ '#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 2ce3fe8c6..50a4c0861 100644
--- a/modules/upload.module
+++ b/modules/upload.module
@@ -143,17 +143,20 @@ 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),
+ '#options' => array(t('Disabled'), t('Enabled')),
+ );
+ }
+}
+
/**
* Implementation of hook_nodeapi().
*/
function upload_nodeapi(&$node, $op, $arg) {
switch ($op) {
- case 'settings':
- $form['upload_'. $node->type] = array(
- '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $node->type, 1),
- '#options' => array(t('Disabled'), t('Enabled'))
- );
- return $form;
case 'validate':
$node->files = upload_load($node);
// Double check existing files:
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index 2ce3fe8c6..50a4c0861 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -143,17 +143,20 @@ 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),
+ '#options' => array(t('Disabled'), t('Enabled')),
+ );
+ }
+}
+
/**
* Implementation of hook_nodeapi().
*/
function upload_nodeapi(&$node, $op, $arg) {
switch ($op) {
- case 'settings':
- $form['upload_'. $node->type] = array(
- '#type' => 'radios', '#title' => t('Attachments'), '#default_value' => variable_get('upload_'. $node->type, 1),
- '#options' => array(t('Disabled'), t('Enabled'))
- );
- return $form;
case 'validate':
$node->files = upload_load($node);
// Double check existing files: