From 7de41539df93abeea427c1aa83ee7e13684a4fc6 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 18 Aug 2006 18:58:47 +0000 Subject: - Patch #77919 by chx, eaton, moshe, et al: enable programmaticaly submitted forms via the pull model. --- modules/node/node.module | 92 +++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 44 deletions(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 907b9946c..919854f64 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -948,7 +948,7 @@ function node_configure() { '#options' => array(t('Optional'), t('Required')), '#description' => t('Must users preview posts before submitting?') ); - return system_settings_form('node_configure', $form); + return system_settings_form($form); } /** @@ -1004,7 +1004,7 @@ function node_menu($may_cache) { 'path' => 'admin/content/node', 'title' => t('posts'), 'description' => t('View, edit, and delete your site\'s content.'), - 'callback' => 'node_admin_nodes', + 'callback' => 'node_admin_content', 'access' => user_access('administer nodes') ); @@ -1023,7 +1023,8 @@ function node_menu($may_cache) { 'path' => 'admin/content/node-settings', 'title' => t('post settings'), 'description' => t('Control posting behavior, such as teaser length, requiring previews before posting, and the number of posts on the front page.'), - 'callback' => 'node_configure', + 'callback' => 'drupal_get_form', + 'callback arguments' => array('node_configure'), 'access' => user_access('administer nodes') ); @@ -1043,7 +1044,8 @@ function node_menu($may_cache) { $items[] = array( 'path' => 'admin/content/types/add', 'title' => t('add content type'), - 'callback' => 'node_type_form', + 'callback' => 'drupal_get_form', + 'callback arguments' => array('node_type_form'), 'type' => MENU_LOCAL_TASK, ); @@ -1090,13 +1092,14 @@ function node_menu($may_cache) { 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); $items[] = array('path' => 'node/'. arg(1) .'/edit', 'title' => t('edit'), - 'callback' => 'node_page_edit', - 'callback arguments' => array($node), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('node_page_edit', $node), 'access' => node_access('update', $node), 'weight' => 1, 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'node/'. arg(1) .'/delete', 'title' => t('delete'), - 'callback' => 'node_delete_confirm', + 'callback' => 'drupal_get_form', + 'callback arguments' => array('node_delete_confirm'), 'access' => node_access('delete', $node), 'weight' => 1, 'type' => MENU_CALLBACK); @@ -1125,15 +1128,15 @@ function node_menu($may_cache) { $items[] = array( 'path' => 'admin/content/types/'. $type_url_str, 'title' => t($type->name), - 'callback' => 'node_type_form', - 'callback arguments' => array($type), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('node_type_form', $type), 'type' => MENU_CALLBACK, ); $items[] = array( 'path' => 'admin/content/types/'. $type_url_str .'/delete', 'title' => t('delete'), - 'callback' => 'node_type_delete', - 'callback arguments' => array($type), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('node_type_delete', $type), 'type' => MENU_CALLBACK, ); } @@ -1143,7 +1146,7 @@ function node_menu($may_cache) { // There is no need to rebuild node_access if there is only 1 record in the table (the default configuration). if (db_result(db_query('SELECT COUNT(*) FROM {node_access}')) > 1) { $items[] = array('path' => 'admin/settings/node-access', 'title' => t('node access'), - 'callback' => 'node_access_rebuild_page', + 'callback' => 'node_access_rebuild', 'access' => user_access('administer nodes')); } } @@ -1312,13 +1315,13 @@ function node_filter_form() { $form['filters']['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset')); } - return drupal_get_form('node_filter_form', $form); + return $form; } /** * Theme node administration filter form. */ -function theme_node_filter_form(&$form) { +function theme_node_filter_form($form) { $output .= '
'; $output .= drupal_render($form['filters']); $output .= '
'; @@ -1329,7 +1332,7 @@ function theme_node_filter_form(&$form) { /** * Theme node administraton filter selector. */ -function theme_node_filters(&$form) { +function theme_node_filters($form) { $output .= '