diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-18 00:12:48 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-18 00:12:48 +0000 |
commit | df02fa3ca46e16974192de77580762188ad47f49 (patch) | |
tree | 91b2354aae786d7b187028dbc61fb3893b04ae64 /modules/node | |
parent | e18feedfdb429e35173b85fc7182aadabee0a166 (diff) | |
download | brdo-df02fa3ca46e16974192de77580762188ad47f49.tar.gz brdo-df02fa3ca46e16974192de77580762188ad47f49.tar.bz2 |
#571086 by sun and merlinofchaos: Added a 'wrapper callback' that executes
before a form builder function, to facilitate common form elements. Clean-up
from form_builder changes from CTools patch. Has nice side-benefit of making
all form functions' signatures consistent.
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/content_types.inc | 4 | ||||
-rw-r--r-- | modules/node/node.admin.inc | 4 | ||||
-rw-r--r-- | modules/node/node.module | 3 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 8 |
4 files changed, 8 insertions, 11 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index 8a5adaf93..c0a2951bc 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -57,7 +57,7 @@ function theme_node_admin_overview($name, $type) { /** * Generates the node type editing form. */ -function node_type_form(&$form_state, $type = NULL) { +function node_type_form($form, &$form_state, $type = NULL) { if (!isset($type->type)) { // This is a new type. Node module managed types are custom and unlocked. $type = node_type_set_defaults(array('custom' => 1, 'locked' => 0)); @@ -415,7 +415,7 @@ function node_type_reset($type) { /** * Menu callback; delete a single content type. */ -function node_type_delete_confirm(&$form_state, $type) { +function node_type_delete_confirm($form, &$form_state, $type) { $form['type'] = array('#type' => 'value', '#value' => $type->type); $form['name'] = array('#type' => 'value', '#value' => $type->name); diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 054ee1a23..6d0bea7e6 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -366,7 +366,7 @@ function _node_mass_update_batch_finished($success, $results, $operations) { /** * Menu callback: content administration. */ -function node_admin_content($form_state) { +function node_admin_content($form, $form_state) { if (isset($form_state['values']['operation']) && $form_state['values']['operation'] == 'delete') { return node_multiple_delete_confirm($form_state, array_filter($form_state['values']['nodes'])); } @@ -555,7 +555,7 @@ function theme_node_admin_nodes($form) { return $output; } -function node_multiple_delete_confirm(&$form_state, $nodes) { +function node_multiple_delete_confirm($form, &$form_state, $nodes) { $form['nodes'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE); // array_filter returns only elements with TRUE values foreach ($nodes as $nid => $value) { diff --git a/modules/node/node.module b/modules/node/node.module index f7706603c..3b62d2db6 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -2719,11 +2719,8 @@ function _node_access_rebuild_batch_finished($success, $results, $operations) { * Implement hook_form(). */ function node_content_form($node, $form_state) { - $type = node_type_get_type($node); - $form = array(); - if ($type->has_title) { $form['title'] = array( '#type' => 'textfield', diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 60168012b..a0bbf92b0 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -107,7 +107,7 @@ function node_object_prepare($node) { /** * Generate the node add/edit form array. */ -function node_form(&$form_state, $node) { +function node_form($form, &$form_state, $node) { global $user; if (isset($form_state['node'])) { @@ -453,7 +453,7 @@ function node_form_submit_build_node($form, &$form_state) { /** * Menu callback -- ask for confirmation of node deletion */ -function node_delete_confirm(&$form_state, $node) { +function node_delete_confirm($form, &$form_state, $node) { $form['nid'] = array( '#type' => 'value', '#value' => $node->nid, @@ -536,7 +536,7 @@ function node_revision_overview($node) { /** * Ask for confirmation of the reversion to prevent against CSRF attacks. */ -function node_revision_revert_confirm($form_state, $node_revision) { +function node_revision_revert_confirm($form, $form_state, $node_revision) { $form['#node_revision'] = $node_revision; return confirm_form($form, t('Are you sure you want to revert to the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', '', t('Revert'), t('Cancel')); } @@ -556,7 +556,7 @@ function node_revision_revert_confirm_submit($form, &$form_state) { $form_state['redirect'] = 'node/' . $node_revision->nid . '/revisions'; } -function node_revision_delete_confirm($form_state, $node_revision) { +function node_revision_delete_confirm($form, $form_state, $node_revision) { $form['#node_revision'] = $node_revision; return confirm_form($form, t('Are you sure you want to delete the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', t('This action cannot be undone.'), t('Delete'), t('Cancel')); } |