Commit 96926ca0 authored by Dries's avatar Dries

- Patch #146470 by Eaton et al: standardize form API3 hook parameter order.

parent a8ceb761
......@@ -392,7 +392,7 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
}
drupal_alter('form_'. $form_id, $form, $form_state);
drupal_alter('form', $form, $form_id, $form_state);
drupal_alter('form', $form, $form_state, $form_id);
}
......@@ -613,7 +613,7 @@ function form_execute_handlers($type, &$form, &$form_state) {
$batch['sets'][] = array('form_submit' => $function);
}
else {
$function($form_state['values'], $form, $form_state);
$function($form, $form_state, $form_state['values']);
}
$return = TRUE;
}
......@@ -1238,6 +1238,7 @@ function password_confirm_validate($form, &$form_state) {
form_set_value($form, $pass1, $form_state);
return $form;
}
/**
......
......@@ -82,7 +82,7 @@ function theme_locale_languages_overview_form($form) {
/**
* Process language overview form submissions, updating existing languages.
*/
function locale_languages_overview_form_submit($form_values, $form, &$form_state) {
function locale_languages_overview_form_submit($form, &$form_state, $form_values) {
$languages = language_list();
$enabled_count = 0;
foreach ($languages as $langcode => $language) {
......@@ -266,7 +266,7 @@ function _locale_languages_common_controls(&$form, $language = NULL) {
/**
* Validate the language addition form.
*/
function locale_languages_predefined_form_validate($form_values, $form, &$form_state) {
function locale_languages_predefined_form_validate($form, &$form_state, $form_values) {
$langcode = $form_values['langcode'];
if ($duplicate = db_num_rows(db_query("SELECT language FROM {languages} WHERE language = '%s'", $langcode)) != 0) {
......@@ -289,7 +289,7 @@ function locale_languages_predefined_form_validate($form_values, $form, &$form_s
/**
* Process the language addition form submission.
*/
function locale_languages_predefined_form_submit($form_values, $form, &$form_state) {
function locale_languages_predefined_form_submit($form, &$form_state, $form_values) {
$langcode = $form_values['langcode'];
if (isset($form_values['name'])) {
// Custom language form.
......@@ -316,7 +316,7 @@ function locale_languages_predefined_form_submit($form_values, $form, &$form_sta
/**
* Validate the language editing form. Reused for custom language addition too.
*/
function locale_languages_edit_form_validate($form_values, $form, &$form_state) {
function locale_languages_edit_form_validate($form, &$form_state, $form_values) {
if (!empty($form_values['domain']) && !empty($form_values['prefix'])) {
form_set_error('prefix', t('Domain and path prefix values should not be set at the same time.'));
}
......@@ -335,7 +335,7 @@ function locale_languages_edit_form_validate($form_values, $form, &$form_state)
/**
* Process the language editing form submission.
*/
function locale_languages_edit_form_submit($form_values, $form, &$form_state) {
function locale_languages_edit_form_submit($form, &$form_state, $form_values) {
db_query("UPDATE {languages} SET name = '%s', native = '%s', domain = '%s', prefix = '%s', direction = %d WHERE language = '%s'", $form_values['name'], $form_values['native'], $form_values['domain'], $form_values['prefix'], $form_values['direction'], $form_values['langcode']);
$default = language_default();
if ($default->language == $form_values['langcode']) {
......@@ -389,7 +389,7 @@ function locale_languages_delete_form($langcode) {
/**
* Process language deletion submissions.
*/
function locale_languages_delete_form_submit($form_values, $form, &$form_state) {
function locale_languages_delete_form_submit($form, &$form_state, $form_values) {
$languages = language_list();
if (isset($languages[$form_values['langcode']])) {
db_query("DELETE FROM {languages} WHERE language = '%s'", $form_values['langcode']);
......@@ -440,7 +440,7 @@ function locale_languages_configure_form() {
/**
* Submit function for language negotiation settings.
*/
function locale_languages_configure_form_submit($form_values, $form, &$form_state) {
function locale_languages_configure_form_submit($form, &$form_state, $form_values) {
variable_set('language_negotiation', $form_values['language_negotiation']);
drupal_set_message(t('Language negotiation configuration saved.'));
$form_state['redirect'] = 'admin/settings/language';
......@@ -613,7 +613,7 @@ function locale_translate_import_form() {
/**
* Process the locale import form submission.
*/
function locale_translate_import_form_submit($form_values, $form, &$form_state) {
function locale_translate_import_form_submit($form, &$form_state, $form_values) {
// Ensure we have the file uploaded
if ($file = file_check_upload('file')) {
......@@ -716,7 +716,7 @@ function locale_translate_export_pot_form() {
/**
* Process a translation (or template) export form submission.
*/
function locale_translate_export_po_form_submit($form_values, $form, &$form_state) {
function locale_translate_export_po_form_submit($form, &$form_state, $form_values) {
// If template is required, language code is not given.
_locale_export_po(isset($form_values['langcode']) ? $form_values['langcode'] : NULL, $form_values['group']);
}
......@@ -785,7 +785,7 @@ function locale_translate_edit_form($lid) {
* Process string editing form submissions.
* Saves all translations of one string submitted from a form.
*/
function locale_translate_edit_form_submit($form_values, $form, &$form_state) {
function locale_translate_edit_form_submit($form, &$form_state, $form_values) {
$lid = $form_values['lid'];
foreach ($form_values['translations'] as $key => $value) {
$trans = db_fetch_object(db_query("SELECT translation FROM {locales_target} WHERE lid = %d AND language = '%s'", $lid, $key));
......
......@@ -335,7 +335,7 @@ function install_settings_form($profile, $install_locale, $settings_file, $db_ur
/**
* Form API validate for install_settings form.
*/
function install_settings_form_validate($form_values, $form, &$form_state) {
function install_settings_form_validate($form, &$form_state, $form_values) {
global $db_url;
_install_settings_form_validate($form_values['db_prefix'], $form_values['db_type'], $form_values['db_user'], $form_values['db_pass'], $form_values['db_host'], $form_values['db_port'], $form_values['db_path'], $form_values['settings_file'], $form_state, $form);
}
......@@ -926,7 +926,7 @@ function install_configure_form() {
return $form;
}
function install_configure_form_validate($form_values, $form, &$form_state) {
function install_configure_form_validate($form, &$form_state, $form_values) {
if ($error = user_validate_name($form_values['account']['name'])) {
form_error($form['admin_account']['account']['name'], $error);
}
......@@ -938,7 +938,7 @@ function install_configure_form_validate($form_values, $form, &$form_state) {
}
}
function install_configure_form_submit($form_values, $form, &$form_state) {
function install_configure_form_submit($form, &$form_state, $form_values) {
global $user;
variable_set('site_name', $form_values['site_name']);
......
......@@ -357,7 +357,7 @@ function aggregator_form_category($edit = array('title' => '', 'description' =>
/**
* Validate aggregator_form_feed form submissions.
*/
function aggregator_form_category_validate($form_values, $form, &$form_state) {
function aggregator_form_category_validate($form, &$form_state, $form_values) {
if ($form_values['op'] == t('Submit')) {
// Check for duplicate titles
if (isset($form_values['cid'])) {
......@@ -376,7 +376,7 @@ function aggregator_form_category_validate($form_values, $form, &$form_state) {
* Process aggregator_form_category form submissions.
* @todo Add delete confirmation dialog.
*/
function aggregator_form_category_submit($form_values, $form, &$form_state) {
function aggregator_form_category_submit($form, &$form_state, $form_values) {
if ($form_values['op'] == t('Delete')) {
$title = $form_values['title'];
// Unset the title:
......@@ -492,7 +492,7 @@ function aggregator_form_feed($edit = array('refresh' => 900, 'title' => '', 'ur
/**
* Validate aggregator_form_feed form submissions.
*/
function aggregator_form_feed_validate($form_values, $form, &$form_state) {
function aggregator_form_feed_validate($form, &$form_state, $form_values) {
if ($form_values['op'] == t('Submit')) {
// Check for duplicate titles
if (isset($form_values['fid'])) {
......@@ -516,7 +516,7 @@ function aggregator_form_feed_validate($form_values, $form, &$form_state) {
* Process aggregator_form_feed form submissions.
* @todo Add delete confirmation dialog.
*/
function aggregator_form_feed_submit($form_values, $form, &$form_state) {
function aggregator_form_feed_submit($form, &$form_state, $form_values) {
if ($form_values['op'] == t('Delete')) {
$title = $form_values['title'];
// Unset the title:
......@@ -1170,7 +1170,7 @@ function aggregator_page_list_validate($form_id, &$form) {
}
}
function aggregator_page_list_submit($form_values, $form, &$form_state) {
function aggregator_page_list_submit($form, &$form_state, $form_values) {
foreach ($form_values['categories'] as $iid => $selection) {
db_query('DELETE FROM {aggregator_category_item} WHERE iid = %d', $iid);
foreach ($selection as $cid) {
......
......@@ -292,7 +292,7 @@ function _block_compare($a, $b) {
/**
* Process main block administration form submission.
*/
function block_admin_display_submit($form_values, $form, &$form_state) {
function block_admin_display_submit($form, &$form_state, $form_values) {
foreach ($form_values as $block) {
$block['status'] = $block['region'] != BLOCK_REGION_NONE;
$block['region'] = $block['status'] ? $block['region'] : '';
......@@ -498,7 +498,7 @@ function block_admin_configure($module = NULL, $delta = 0) {
return $form;
}
function block_admin_configure_validate($form_values, $form, &$form_state) {
function block_admin_configure_validate($form, &$form_state, $form_values) {
if ($form_values['module'] == 'block') {
if (empty($form_values['info']) || db_num_rows(db_query("SELECT bid FROM {boxes} WHERE bid != %d AND info = '%s'", $form_values['delta'], $form_values['info']))) {
form_set_error('info', t('Please ensure that each block description is unique.'));
......@@ -506,7 +506,7 @@ function block_admin_configure_validate($form_values, $form, &$form_state) {
}
}
function block_admin_configure_submit($form_values, $form, &$form_state) {
function block_admin_configure_submit($form, &$form_state, $form_values) {
if (!form_get_errors()) {
db_query("UPDATE {blocks} SET visibility = %d, pages = '%s', custom = %d, title = '%s' WHERE module = '%s' AND delta = '%s'", $form_values['visibility'], trim($form_values['pages']), $form_values['custom'], $form_values['title'], $form_values['module'], $form_values['delta']);
db_query("DELETE FROM {blocks_roles} WHERE module = '%s' AND delta = '%s'", $form_values['module'], $form_values['delta']);
......@@ -528,7 +528,7 @@ function block_add_block_form() {
return block_admin_configure('block', NULL);
}
function block_add_block_form_validate($form_values, $form, &$form_state) {
function block_add_block_form_validate($form, &$form_state, $form_values) {
if (empty($form_values['info']) || db_num_rows(db_query("SELECT info FROM {boxes} WHERE info = '%s'", $form_values['info']))) {
form_set_error('info', t('Please ensure that each block description is unique.'));
}
......@@ -537,7 +537,7 @@ function block_add_block_form_validate($form_values, $form, &$form_state) {
/**
* Save the new custom block.
*/
function block_add_block_form_submit($form_values, $form, &$form_state) {
function block_add_block_form_submit($form, &$form_state, $form_values) {
$delta = db_next_id('{boxes}_bid');
foreach (list_themes() as $key => $theme) {
......@@ -573,7 +573,7 @@ function block_box_delete($bid = 0) {
/**
* Deletion of custom blocks.
*/
function block_box_delete_submit($form_values, $form, &$form_state) {
function block_box_delete_submit($form, &$form_state, $form_values) {
db_query('DELETE FROM {boxes} WHERE bid = %d', $form_values['bid']);
db_query("DELETE FROM {blocks} WHERE module = 'block' AND delta = %d", $form_values['bid']);
drupal_set_message(t('The block %name has been removed.', array('%name' => $form_values['info'])));
......
......@@ -298,7 +298,7 @@ function book_outline($node) {
/**
* Handles book outline form submissions.
*/
function book_outline_submit($form_values, $form, &$form_state) {
function book_outline_submit($form, &$form_state, $form_values) {
$op = $form_values['op'];
$node = node_load($form_values['nid']);
......@@ -931,7 +931,7 @@ function book_admin_orphan() {
return $form;
}
function book_admin_edit_submit($form_values, $form, &$form_state) {
function book_admin_edit_submit($form, &$form_state, $form_values) {
foreach ($form_values['table'] as $row) {
$node = node_load($row['nid']);
......
......@@ -14,7 +14,7 @@ function color_theme() {
/**
* Implementation of hook_form_alter().
*/
function color_form_alter(&$form, $form_id) {
function color_form_alter(&$form, $form_state, $form_id) {
// Insert the color changer into the theme settings page.
// TODO: Last condition in the following if disables color changer when private files are used this should be solved in a different way. See issue #92059.
if ($form_id == 'system_theme_settings' && color_get_info(arg(4)) && function_exists('gd_info') && variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
......
......@@ -422,7 +422,7 @@ function comment_link($type, $node = NULL, $teaser = FALSE) {
return $links;
}
function comment_form_alter(&$form, $form_id) {
function comment_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
$form['workflow']['comment'] = array(
'#type' => 'radios',
......@@ -1129,7 +1129,7 @@ function comment_confirm_delete($comment) {
'comment_confirm_delete');
}
function comment_confirm_delete_submit($form_values, $form, &$form_state) {
function comment_confirm_delete_submit($form, &$form_state, $form_values) {
drupal_set_message(t('The comment and all its replies have been deleted.'));
$comment = $form['#comment'];
......@@ -1229,7 +1229,7 @@ function comment_admin_overview($type = 'new', $arg) {
/**
* We can't execute any 'Update options' if no comments were selected.
*/
function comment_admin_overview_validate($form_values, $form, &$form_state) {
function comment_admin_overview_validate($form, &$form_state, $form_values) {
$form_values['comments'] = array_diff($form_values['comments'], array(0));
if (count($form_values['comments']) == 0) {
form_set_error('', t('Please select one or more comments to perform the update on.'));
......@@ -1241,7 +1241,7 @@ function comment_admin_overview_validate($form_values, $form, &$form_state) {
* Execute the chosen 'Update option' on the selected comments, such as
* publishing, unpublishing or deleting.
*/
function comment_admin_overview_submit($form_values, $form, &$form_state) {
function comment_admin_overview_submit($form, &$form_state, $form_values) {
$operations = comment_operations();
if ($operations[$form_values['operation']][1]) {
// extract the appropriate database query operation
......@@ -1326,7 +1326,7 @@ function comment_multiple_delete_confirm() {
/**
* Perform the actual comment deletion.
*/
function comment_multiple_delete_confirm_submit($form_values, $form, &$form_state) {
function comment_multiple_delete_confirm_submit($form, &$form_state, $form_values) {
if ($form_values['confirm']) {
foreach ($form_values['comments'] as $cid => $value) {
$comment = _comment_load($cid);
......@@ -1684,7 +1684,7 @@ function comment_form_add_preview($form, $edit, &$form_state) {
return $form;
}
function comment_form_validate($form_values, $form, &$form_state) {
function comment_form_validate($form, &$form_state, $form_values) {
foreach (array('name', 'homepage', 'mail') as $field) {
//set cookie for 365 days
setcookie('comment_info_'. $field, $form_values[$field], time() + 31536000);
......@@ -1692,7 +1692,7 @@ function comment_form_validate($form_values, $form, &$form_state) {
comment_validate($form_values);
}
function _comment_form_submit($form_values) {
function _comment_form_submit(&$form_values) {
if (!isset($form_values['date'])) {
$form_values['date'] = 'now';
}
......@@ -1717,12 +1717,10 @@ function _comment_form_submit($form_values) {
$form_values['subject'] = t('(No subject)');
}
}
return $form_values;
}
function comment_form_submit(&$form_values, $form, &$form_state) {
$form_values = _comment_form_submit($form_values);
function comment_form_submit($form, &$form_state, $form_values) {
_comment_form_submit($form_state['values']);
if ($cid = comment_save($form_values)) {
$form_state['redirect'] = array('node/'. $form_values['nid'], NULL, "comment-$cid");
return;
......@@ -1808,7 +1806,7 @@ function theme_comment_controls($form) {
return theme('box', t('Comment viewing options'), $output);
}
function comment_controls_submit($form_values, $form, &$form_state) {
function comment_controls_submit($form, &$form_state, $form_values) {
global $user;
$mode = $form_values['mode'];
......
......@@ -209,7 +209,7 @@ function contact_admin_edit($cid = NULL) {
/**
* Validate the contact category edit page form submission.
*/
function contact_admin_edit_validate($form_values, $form, &$form_state) {
function contact_admin_edit_validate($form, &$form_state, $form_values) {
if (empty($form_values['category'])) {
form_set_error('category', t('You must enter a category.'));
}
......@@ -229,7 +229,7 @@ function contact_admin_edit_validate($form_values, $form, &$form_state) {
/**
* Process the contact category edit page form submission.
*/
function contact_admin_edit_submit($form_values, $form, &$form_state) {
function contact_admin_edit_submit($form, &$form_state, $form_values) {
if ($form_values['selected']) {
// Unselect all other contact categories.
db_query('UPDATE {contact} SET selected = 0');
......@@ -276,7 +276,7 @@ function contact_admin_delete($cid = NULL) {
/**
* Process category delete form submission.
*/
function contact_admin_delete_submit($form_values, $form, &$form_state) {
function contact_admin_delete_submit($form, &$form_state, $form_values) {
db_query("DELETE FROM {contact} WHERE cid = %d", arg(4));
drupal_set_message(t('Category %category has been deleted.', array('%category' => $form_values['category'])));
watchdog('mail', 'Contact form: category %category deleted.', array('%category' => $form_values['category']), WATCHDOG_NOTICE);
......@@ -359,7 +359,7 @@ function contact_mail_user($recipient) {
/**
* Process the personal contact page form submission.
*/
function contact_mail_user_submit($form_values, $form, &$form_state) {
function contact_mail_user_submit($form, &$form_state, $form_values) {
global $user;
$account = user_load(array('uid' => arg(1), 'status' => 1));
......@@ -496,7 +496,7 @@ function contact_mail_page() {
/**
* Validate the site-wide contact page form submission.
*/
function contact_mail_page_validate($form_values, $form, &$form_state) {
function contact_mail_page_validate($form, &$form_state, $form_values) {
if (!$form_values['cid']) {
form_set_error('category', t('You must select a valid category.'));
}
......@@ -508,7 +508,7 @@ function contact_mail_page_validate($form_values, $form, &$form_state) {
/**
* Process the site-wide contact page form submission.
*/
function contact_mail_page_submit($form_values, $form, &$form_state) {
function contact_mail_page_submit($form, &$form_state, $form_values) {
// E-mail address of the sender: as the form field is a text field,
// all instances of \r and \n have been automatically stripped from it.
......
......@@ -369,7 +369,7 @@ function theme_dblog_filters($form) {
return $output;
}
function dblog_filter_form_validate($form_values, $form, &$form_state) {
function dblog_filter_form_validate($form, &$form_state, $form_values) {
if ($form_values['op'] == t('Filter') && empty($form_values['type']) && empty($form_values['severity'])) {
form_set_error('type', t('You must select something to filter by.'));
}
......
......@@ -296,7 +296,7 @@ function filter_admin_overview() {
return $form;
}
function filter_admin_overview_submit($form_values, $form, &$form_state) {
function filter_admin_overview_submit($form, &$form_state, $form_values) {
// Process form submission to set the default format
if (is_numeric($form_values['default'])) {
drupal_set_message(t('Default format updated.'));
......@@ -352,7 +352,7 @@ function filter_admin_delete() {
/**
* Process filter delete form submission.
*/
function filter_admin_delete_submit($form_values, $form, &$form_state) {
function filter_admin_delete_submit($form, &$form_state, $form_values) {
db_query("DELETE FROM {filter_formats} WHERE format = %d", $form_values['format']);
db_query("DELETE FROM {filters} WHERE format = %d", $form_values['format']);
......@@ -442,7 +442,7 @@ function filter_admin_format_form($format = NULL) {
/**
* Validate filter format form submissions.
*/
function filter_admin_format_form_validate($form_values, $form, &$form_state) {
function filter_admin_format_form_validate($form, &$form_state, $form_values) {
if (!isset($form_values['format'])) {
$name = trim($form_values['name']);
$result = db_fetch_object(db_query("SELECT format FROM {filter_formats} WHERE name='%s'", $name));
......@@ -455,7 +455,7 @@ function filter_admin_format_form_validate($form_values, $form, &$form_state) {
/**
* Process filter format form submissions.
*/
function filter_admin_format_form_submit($form_values, $form, &$form_state) {
function filter_admin_format_form_submit($form, &$form_state, $form_values) {
$format = isset($form_values['format']) ? $form_values['format'] : NULL;
$current = filter_list_format($format);
$name = trim($form_values['name']);
......@@ -551,7 +551,7 @@ function theme_filter_admin_order($form) {
/**
* Process filter order configuration form submission.
*/
function filter_admin_order_submit($form_values, $form, &$form_state) {
function filter_admin_order_submit($form, &$form_state, $form_values) {
foreach ($form_values['weights'] as $id => $weight) {
list($module, $delta) = explode('/', $id);
db_query("UPDATE {filters} SET weight = %d WHERE format = %d AND module = '%s' AND delta = %d", $weight, $form_values['format'], $module, $delta);
......
......@@ -230,7 +230,7 @@ function forum_admin_settings() {
/**
* Implementation of hook_form_alter().
*/
function forum_form_alter(&$form, $form_id) {
function forum_form_alter(&$form, $form_state, $form_id) {
// hide critical options from forum vocabulary
if ($form_id == 'taxonomy_form_vocabulary') {
if (isset($form['vid']) && $form['vid']['#value'] == _forum_get_vid()) {
......@@ -568,7 +568,7 @@ function forum_form_forum($edit = array()) {
/**
* Process forum form and container form submissions.
*/
function forum_form_submit($form_values, $form, &$form_state) {
function forum_form_submit($form, &$form_state, $form_values) {
if ($form['form_id'] == 'forum_form_container') {
$container = TRUE;
$type = t('forum container');
......@@ -613,7 +613,7 @@ function forum_confirm_delete($tid) {
/**
* Implementation of forms api _submit call. Deletes a forum after confirmation.
*/
function forum_confirm_delete_submit($form_values, $form, &$form_state) {
function forum_confirm_delete_submit($form, &$form_state, $form_values) {
taxonomy_del_term($form_values['tid']);
drupal_set_message(t('The forum %term and all sub-forums and associated posts have been deleted.', array('%term' => $form_values['name'])));
watchdog('content', 'forum: deleted %term and all its sub-forums and associated posts.', array('%term' => $form_values['name']));
......
......@@ -214,7 +214,7 @@ function locale_user($type, $edit, &$user, $category = NULL) {
/**
* Implementation of hook_form_alter(). Adds language fields to forms.
*/
function locale_form_alter(&$form, $form_id) {
function locale_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
// Language field for paths
......
......@@ -294,7 +294,7 @@ function menu_edit_item_form($type, $mid = 0) {
return $form;
}
function menu_edit_item_form_validate($form_values, $form, &$form_state) {
function menu_edit_item_form_validate($form, &$form_state, $form_values) {
if (isset($form_values['path'])) {
$path = $form_values['path'];
// Skip external links.
......@@ -314,7 +314,7 @@ function menu_edit_item_form_validate($form_values, $form, &$form_state) {
/**
* Process menu and menu item add/edit form submissions.
*/
function menu_edit_item_form_submit($form_values, $form, &$form_state) {
function menu_edit_item_form_submit($form, &$form_state, $form_values) {
menu_edit_item_save($form_values);
$form_state['redirect'] = 'admin/build/menu';
return;
......@@ -468,7 +468,7 @@ function menu_item_delete_form($mid) {
/**
* Process menu delete form submissions.
*/
function menu_item_delete_form_submit($form_values, $form, &$form_state) {
function menu_item_delete_form_submit($form, &$form_state, $form_values) {
menu_delete_item($form_values['path']);
$t_args = array('%title' => $form_values['title']);
......@@ -501,7 +501,7 @@ function menu_reset_item($mid) {
/**
* Process menu reset item form submissions.
*/
function menu_reset_item_submit($form_values, $form, &$form_state) {
function menu_reset_item_submit($form, &$form_state, $form_values) {
menu_delete_item($form_values['mid']);
drupal_set_message(t('The menu item was reset to its default settings.'));
......@@ -578,7 +578,7 @@ function _menu_nodeapi(&$node, $op) {
* Implementation of hook_form_alter().
* Add menu item fields to the node form.
*/
function _menu_form_alter(&$form, $form_id) {
function _menu_form_alter(&$form, $form_state, $form_id) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$item = array();
if ($form['nid']['#value'] > 0) {
......
......@@ -216,7 +216,7 @@ function node_type_form($type = NULL) {
/**
* Implementation of hook_form_validate().
*/
function node_type_form_validate($form_values, $form, &$form_state) {
function node_type_form_validate($form, &$form_state, $form_values) {
$type = new stdClass();
$type->type = trim($form_values['type']);
$type->name = trim($form_values['name']);
......@@ -252,7 +252,7 @@ function node_type_form_validate($form_values, $form, &$form_state) {
/**
* Implementation of hook_form_submit().
*/
function node_type_form_submit($form_values, $form, &$form_state) {
function node_type_form_submit($form, &$form_state, $form_values) {
$op = isset($form_values['op']) ? $form_values['op'] : '';
$type = new stdClass();
......@@ -398,7 +398,7 @@ function node_type_delete_confirm($type) {
/**
* Process content type delete confirm submissions.
*/
function node_type_delete_confirm_submit($form_values, $form, &$form_state) {
function node_type_delete_confirm_submit($form, &$form_state, $form_values) {
node_type_delete($form_values['type']);
$t_args = array('%name' => $form_values['name']);
......
......@@ -1066,7 +1066,7 @@ function node_configure() {
/**
* Form validate callback.
*/
function node_configure_validate($form_values, $form, &$form_state) {
function node_configure_validate($form, &$form_state, $form_values) {
if ($form_values['op'] == t('Rebuild permissions')) {
drupal_goto('admin/content/node-settings/rebuild');
}
......@@ -1521,7 +1521,7 @@ function theme_node_filters($form) {
/**
* Process result from node administration filter form.
*/
function node_filter_form_submit($form_values, $form, &$form_state) {
function node_filter_form_submit($form, &$form_state, $form_values) {
$filters = node_filters();
switch ($form_values['op']) {
case t('Filter'):
......@@ -1549,7 +1549,7 @@ function node_filter_form_submit($form_values, $form, &$form_state) {
/**
* Submit the node administration update form.
*/
function node_admin_nodes_submit($form_values, $form, &$form_state) {
function node_admin_nodes_submit($form, &$form_state, $form_values) {
$operations = module_invoke_all('node_operations');
$operation = $operations[$form_values['operation']];
// Filter out unchecked nodes
......@@ -1569,7 +1569,7 @@ function node_admin_nodes_submit($form_values, $form, &$form_state) {
}
}
function node_admin_nodes_validate($form_values, $form, &$form_state) {
function node_admin_nodes_validate($form, &$form_state, $form_values) {
$nodes = array_filter($form_values['nodes']);
if (count($nodes) == 0) {
form_set_error('', t('No items selected.'));
......@@ -1690,7 +1690,7 @@ function node_multiple_delete_confirm() {
t('Delete all'), t('Cancel'));
}
function node_multiple_delete_confirm_submit($form_values, $form, &$form_state) {
function node_multiple_delete_confirm_submit($form, &$form_state, $form_values) {
if ($form_values['confirm']) {
foreach ($form_values['nodes'] as $nid => $value) {
node_delete($nid);
......@@ -2007,7 +2007,7 @@ function node_validate($node, $form = array()) {
node_invoke_nodeapi($node, 'validate', $form);
}
function node_form_validate($form_values, $form, &$form_state) {
function node_form_validate($form, &$form_state, $form_values) {
node_validate($form_values, $form);
}
......@@ -2148,7 +2148,7 @@ function node_form($node, $form_state = NULL) {
return $form;
}
function node_form_build_preview($form_values, $form, &$form_state) {
function node_form_build_preview($form, &$form_state, $form_values) {
// We do not want to execute button level handlers, we want the form level
// handlers to go in and change the submitted values.
unset($form_state['submit_handlers']);
......@@ -2315,7 +2315,7 @@ function theme_node_log_message($log) {
return '<div class="log"><div class="title">'. t('Log') .':</div>'. $log .'</div>';
}