Commit 58752cfa authored by Dries's avatar Dries

- Patch #72284 by me:

   + reorganized ?q=admin/settings
   + deprecated the _settings hook
parent c45ca20d
......@@ -6,14 +6,14 @@ Drupal x.x.x, xxxx-xx-xx (development version)
- added support for a generic "sites/all" directory.
- usability:
* added support for auto-complete forms (AJAX) to user profiles.
* made it possible to instantly assign roles to newly created user accounts.
* improved configurability of the contact forms.
* reorganized the settings pages.
- block system:
* extended the block visibility settings with a role specific settings..
* extended the block visibility settings with a role specific settings.
- poll module:
* optionally allow people to inspect all votes.
* optionally allow people to cancel their vote.
- user module:
* made it possible to instantly assign roles to newly created user accounts.
- distributed authentication:
* added default server option.
- fixed critical SQL issue, see SA-2006-005
......
......@@ -4,7 +4,8 @@ UPGRADING
---------
1. Backup your database and Drupal directory - especially your
configuration file in 'sites/default/settings.php'.
sites-directory which contains your configuration file and
any added modules and themes.
2. Log on as the user with user ID 1.
......
......@@ -75,6 +75,11 @@ function aggregator_menu($may_cache) {
'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10);
$items[] = array('path' => 'admin/settings/aggregator',
'title' => t('RSS aggregator'),
'callback' => 'aggregator_admin_settings',
'type' => MENU_NORMAL_ITEM,
'access' => $edit);
$items[] = array('path' => 'aggregator',
'title' => t('news aggregator'),
......@@ -188,10 +193,7 @@ function aggregator_menu($may_cache) {
return $items;
}
/**
* Implementation of hook_settings().
*/
function aggregator_settings() {
function aggregator_admin_settings() {
$items = array(0 => t('none')) + drupal_map_assoc(array(3, 5, 10, 15, 20, 25), '_aggregator_items');
$period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
......@@ -218,7 +220,8 @@ function aggregator_settings() {
'#options' => array('checkboxes' => t('checkboxes'), 'select' => t('multiple selector')),
'#description' => t('The type of category selection widget which is shown on categorization pages. Checkboxes are easier to use; a multiple selector is good for working with large numbers of categories.')
);
return $form;
return system_settings_form('aggregator_admin_settings', $form);
}
/**
......
......@@ -75,6 +75,11 @@ function aggregator_menu($may_cache) {
'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10);
$items[] = array('path' => 'admin/settings/aggregator',
'title' => t('RSS aggregator'),
'callback' => 'aggregator_admin_settings',
'type' => MENU_NORMAL_ITEM,
'access' => $edit);
$items[] = array('path' => 'aggregator',
'title' => t('news aggregator'),
......@@ -188,10 +193,7 @@ function aggregator_menu($may_cache) {
return $items;
}
/**
* Implementation of hook_settings().
*/
function aggregator_settings() {
function aggregator_admin_settings() {
$items = array(0 => t('none')) + drupal_map_assoc(array(3, 5, 10, 15, 20, 25), '_aggregator_items');
$period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
......@@ -218,7 +220,8 @@ function aggregator_settings() {
'#options' => array('checkboxes' => t('checkboxes'), 'select' => t('multiple selector')),
'#description' => t('The type of category selection widget which is shown on categorization pages. Checkboxes are easier to use; a multiple selector is good for working with large numbers of categories.')
);
return $form;
return system_settings_form('aggregator_admin_settings', $form);
}
/**
......
......@@ -553,9 +553,11 @@ function blogapi_blogger_title(&$contents) {
return $title;
}
function blogapi_settings() {
function blogapi_admin_settings() {
$form['blogapi_engine'] = array(
'#type' => 'select', '#title' => t('XML-RPC Engine'), '#default_value' => variable_get('blogapi_engine', 0),
'#type' => 'select',
'#title' => t('XML-RPC Engine'),
'#default_value' => variable_get('blogapi_engine', 0),
'#options' => array(0 => 'Blogger', 1 => 'MetaWeblog', 2 => 'Movabletype'),
'#description' => t('RSD or Really-Simple-Discovery is a mechanism which allows external blogger tools to discover the APIs they can use to interact with Drupal. Here you can set the preferred method for blogger tools to interact with your site. The common XML-RPC engines are Blogger, MetaWeblog and Movabletype. If you are not sure which is the correct setting, choose Blogger.')
);
......@@ -563,12 +565,15 @@ function blogapi_settings() {
$node_types = node_get_types();
$defaults = isset($node_types['blog']) ? array('blog' => 1) : array();
$form['blogapi_node_types'] = array(
'#type' => 'checkboxes', '#title' => t('Blog types'), '#required' => TRUE,
'#default_value' => variable_get('blogapi_node_types', $defaults), '#options' => $node_types,
'#type' => 'checkboxes',
'#title' => t('Blog types'),
'#required' => TRUE,
'#default_value' => variable_get('blogapi_node_types', $defaults),
'#options' => $node_types,
'#description' => t('Select the content types for which you wish to enable posting via blogapi. Each type will appear as a different "blog" in the client application (if supported).')
);
return $form;
return system_settings_form('blogapi_admin_settings', $form);
}
function blogapi_menu($may_cache) {
......@@ -582,7 +587,19 @@ function blogapi_menu($may_cache) {
}
if ($may_cache) {
$items[] = array('path' => 'blogapi', 'title' => t('RSD'), 'callback' => 'blogapi_blogapi', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
$items[] = array(
'path' => 'blogapi',
'title' => t('RSD'),
'callback' => 'blogapi_blogapi',
'access' => user_access('access content'),
'type' => MENU_CALLBACK);
$items[] = array(
'path' => 'admin/settings/blogapi',
'title' => t('blog APIs'),
'callback' => 'blogapi_admin_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_NORMAL_ITEM
);
}
return $items;
......
......@@ -553,9 +553,11 @@ function blogapi_blogger_title(&$contents) {
return $title;
}
function blogapi_settings() {
function blogapi_admin_settings() {
$form['blogapi_engine'] = array(
'#type' => 'select', '#title' => t('XML-RPC Engine'), '#default_value' => variable_get('blogapi_engine', 0),
'#type' => 'select',
'#title' => t('XML-RPC Engine'),
'#default_value' => variable_get('blogapi_engine', 0),
'#options' => array(0 => 'Blogger', 1 => 'MetaWeblog', 2 => 'Movabletype'),
'#description' => t('RSD or Really-Simple-Discovery is a mechanism which allows external blogger tools to discover the APIs they can use to interact with Drupal. Here you can set the preferred method for blogger tools to interact with your site. The common XML-RPC engines are Blogger, MetaWeblog and Movabletype. If you are not sure which is the correct setting, choose Blogger.')
);
......@@ -563,12 +565,15 @@ function blogapi_settings() {
$node_types = node_get_types();
$defaults = isset($node_types['blog']) ? array('blog' => 1) : array();
$form['blogapi_node_types'] = array(
'#type' => 'checkboxes', '#title' => t('Blog types'), '#required' => TRUE,
'#default_value' => variable_get('blogapi_node_types', $defaults), '#options' => $node_types,
'#type' => 'checkboxes',
'#title' => t('Blog types'),
'#required' => TRUE,
'#default_value' => variable_get('blogapi_node_types', $defaults),
'#options' => $node_types,
'#description' => t('Select the content types for which you wish to enable posting via blogapi. Each type will appear as a different "blog" in the client application (if supported).')
);
return $form;
return system_settings_form('blogapi_admin_settings', $form);
}
function blogapi_menu($may_cache) {
......@@ -582,7 +587,19 @@ function blogapi_menu($may_cache) {
}
if ($may_cache) {
$items[] = array('path' => 'blogapi', 'title' => t('RSD'), 'callback' => 'blogapi_blogapi', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
$items[] = array(
'path' => 'blogapi',
'title' => t('RSD'),
'callback' => 'blogapi_blogapi',
'access' => user_access('access content'),
'type' => MENU_CALLBACK);
$items[] = array(
'path' => 'admin/settings/blogapi',
'title' => t('blog APIs'),
'callback' => 'blogapi_admin_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_NORMAL_ITEM
);
}
return $items;
......
......@@ -77,7 +77,7 @@ function comment_help($section) {
<li>control access for various comment module functions through access permissions <a href="%admin-access">administer &gt;&gt; access control</a>.</li>
<li>administer comments <a href="%admin-comment-configure"> administer &gt;&gt; comments &gt;&gt; configure</a>.</li>
</ul>
', array('%admin-access' => url('admin/access'), '%admin-comment-configure' => url('admin/comment/configure')));
', array('%admin-access' => url('admin/access'), '%admin-settings-comment' => url('admin/settings/comment')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%comment">Comment page</a>.', array('%comment' => 'http://drupal.org/handbook/modules/comment/')) .'</p>';
return $output;
case 'admin/modules#description':
......@@ -87,8 +87,7 @@ function comment_help($section) {
return t("<p>Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information , \"edit\" to modify the text, and \"delete\" to remove their submission.</p>");
case 'admin/comment/approval':
return t("<p>Below is a list of the comments posted to your site that need approval. To approve a comment, click on \"edit\" and then change its \"moderation status\" to Approved. Click on a subject to see the comment, the author's name to edit the author's user information, \"edit\" to modify the text, and \"delete\" to remove their submission.</p>");
case 'admin/comment/configure':
case 'admin/comment/configure/settings':
case 'admin/settings/comment':
return t("<p>Comments can be attached to any node, and their settings are below. The display comes in two types: a \"flat list\" where everything is flush to the left side, and comments come in chronological order, and a \"threaded list\" where replies to other comments are placed immediately below and slightly indented, forming an outline. They also come in two styles: \"expanded\", where you see both the title and the contents, and \"collapsed\" where you only see the title. Preview comment forces a user to look at their comment by clicking on a \"Preview\" button before they can actually add the comment.</p>");
}
}
......@@ -107,8 +106,6 @@ function comment_menu($may_cache) {
// Tabs:
$items[] = array('path' => 'admin/comment/list', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/comment/configure', 'title' => t('configure'),
'callback' => 'comment_configure', 'access' => $access, 'type' => MENU_LOCAL_TASK);
// Subtabs:
$items[] = array('path' => 'admin/comment/list/new', 'title' => t('published comments'),
......@@ -118,8 +115,12 @@ function comment_menu($may_cache) {
'callback arguments' => array('approval'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array(
'path' => 'admin/settings/comments',
'title' => t('comments'),
'callback' => 'comment_admin_settings',
'access' => $access,
'type' => MENU_NORMAL_ITEM);
$items[] = array('path' => 'comment/delete', 'title' => t('delete comment'),
'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
......@@ -361,7 +362,7 @@ function comment_user($type, $edit, &$user, $category = NULL) {
/**
* Menu callback; presents the comment settings page.
*/
function comment_configure() {
function comment_admin_settings() {
$form['viewing_options'] = array(
'#type' => 'fieldset',
'#title' => t('Viewing options'),
......@@ -448,7 +449,7 @@ function comment_configure() {
'#options' => array(t('Display on separate page'), t('Display below post or comments')),
);
return system_settings_form('comment_settings_form', $form);
return system_settings_form('comment_admin_settings', $form);
}
/**
......
......@@ -77,7 +77,7 @@ function comment_help($section) {
<li>control access for various comment module functions through access permissions <a href="%admin-access">administer &gt;&gt; access control</a>.</li>
<li>administer comments <a href="%admin-comment-configure"> administer &gt;&gt; comments &gt;&gt; configure</a>.</li>
</ul>
', array('%admin-access' => url('admin/access'), '%admin-comment-configure' => url('admin/comment/configure')));
', array('%admin-access' => url('admin/access'), '%admin-settings-comment' => url('admin/settings/comment')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%comment">Comment page</a>.', array('%comment' => 'http://drupal.org/handbook/modules/comment/')) .'</p>';
return $output;
case 'admin/modules#description':
......@@ -87,8 +87,7 @@ function comment_help($section) {
return t("<p>Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information , \"edit\" to modify the text, and \"delete\" to remove their submission.</p>");
case 'admin/comment/approval':
return t("<p>Below is a list of the comments posted to your site that need approval. To approve a comment, click on \"edit\" and then change its \"moderation status\" to Approved. Click on a subject to see the comment, the author's name to edit the author's user information, \"edit\" to modify the text, and \"delete\" to remove their submission.</p>");
case 'admin/comment/configure':
case 'admin/comment/configure/settings':
case 'admin/settings/comment':
return t("<p>Comments can be attached to any node, and their settings are below. The display comes in two types: a \"flat list\" where everything is flush to the left side, and comments come in chronological order, and a \"threaded list\" where replies to other comments are placed immediately below and slightly indented, forming an outline. They also come in two styles: \"expanded\", where you see both the title and the contents, and \"collapsed\" where you only see the title. Preview comment forces a user to look at their comment by clicking on a \"Preview\" button before they can actually add the comment.</p>");
}
}
......@@ -107,8 +106,6 @@ function comment_menu($may_cache) {
// Tabs:
$items[] = array('path' => 'admin/comment/list', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/comment/configure', 'title' => t('configure'),
'callback' => 'comment_configure', 'access' => $access, 'type' => MENU_LOCAL_TASK);
// Subtabs:
$items[] = array('path' => 'admin/comment/list/new', 'title' => t('published comments'),
......@@ -118,8 +115,12 @@ function comment_menu($may_cache) {
'callback arguments' => array('approval'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array(
'path' => 'admin/settings/comments',
'title' => t('comments'),
'callback' => 'comment_admin_settings',
'access' => $access,
'type' => MENU_NORMAL_ITEM);
$items[] = array('path' => 'comment/delete', 'title' => t('delete comment'),
'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
......@@ -361,7 +362,7 @@ function comment_user($type, $edit, &$user, $category = NULL) {
/**
* Menu callback; presents the comment settings page.
*/
function comment_configure() {
function comment_admin_settings() {
$form['viewing_options'] = array(
'#type' => 'fieldset',
'#title' => t('Viewing options'),
......@@ -448,7 +449,7 @@ function comment_configure() {
'#options' => array(t('Display on separate page'), t('Display below post or comments')),
);
return system_settings_form('comment_settings_form', $form);
return system_settings_form('comment_admin_settings', $form);
}
/**
......
......@@ -26,7 +26,7 @@ function contact_help($section) {
case 'admin/modules#description':
return t('Enables the use of both personal and site-wide contact forms.');
case 'admin/contact':
$output = t('This page lets you setup <a href="%form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="%settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('%settings' => url('admin/contact/settings'), '%form' => url('contact')));
$output = t('This page lets you setup <a href="%form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="%settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('%settings' => url('admin/settings/contact'), '%form' => url('contact')));
if (!module_exist('menu')) {
$menu_note = t('The menu item can be customized and configured only once the menu module has been <a href="%modules-page">enabled</a>.', array('%modules-page' => url('admin/modules')));
}
......@@ -55,43 +55,36 @@ function contact_menu($may_cache) {
'callback' => 'contact_admin_categories',
'access' => user_access('administer site configuration'),
);
$items[] = array('path' => 'admin/contact/category',
'title' => t('categories'),
'callback' => 'contact_admin_categories',
'access' => user_access('administer site configuration'),
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items[] = array('path' => 'admin/contact/category/list',
$items[] = array('path' => 'admin/contact/list',
'title' => t('list'),
'callback' => 'contact_admin_categories',
'access' => user_access('administer site configuration'),
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items[] = array('path' => 'admin/contact/category/add',
$items[] = array('path' => 'admin/contact/add',
'title' => t('add category'),
'callback' => 'contact_admin_edit',
'access' => user_access('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
$items[] = array('path' => 'admin/contact/category/edit',
$items[] = array('path' => 'admin/contact/edit',
'title' => t('edit contact category'),
'callback' => 'contact_admin_edit',
'access' => user_access('administer site configuration'),
'type' => MENU_CALLBACK,
);
$items[] = array('path' => 'admin/contact/category/delete',
$items[] = array('path' => 'admin/contact/delete',
'title' => t('delete contact'),
'callback' => 'contact_admin_delete',
'access' => user_access('administer site configuration'),
'type' => MENU_CALLBACK,
);
$items[] = array('path' => 'admin/contact/settings',
'title' => t('settings'),
$items[] = array('path' => 'admin/settings/contact',
'title' => t('contact form'),
'callback' => 'contact_admin_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
'type' => MENU_NORMAL_ITEM,
);
$items[] = array('path' => 'contact',
'title' => t('contact'),
......@@ -154,7 +147,7 @@ function contact_admin_categories() {
$result = db_query('SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category');
$rows = array();
while ($category = db_fetch_object($result)) {
$rows[] = array($category->category, $category->recipients, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/contact/category/edit/'. $category->cid), l(t('delete'), 'admin/contact/category/delete/'. $category->cid));
$rows[] = array($category->category, $category->recipients, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/contact/edit/'. $category->cid), l(t('delete'), 'admin/contact/delete/'. $category->cid));
}
$header = array(t('Category'), t('Recipients'), t('Selected'), array('data' => t('Operations'), 'colspan' => 2));
......@@ -165,7 +158,7 @@ function contact_admin_categories() {
* Category edit page.
*/
function contact_admin_edit($cid = NULL) {
if (arg(3) == "edit" && $cid > 0) {
if (arg(2) == "edit" && $cid > 0) {
$edit = db_fetch_array(db_query("SELECT * FROM {contact} WHERE cid = %d", $cid));
}
$form['category'] = array('#type' => 'textfield',
......@@ -241,7 +234,7 @@ function contact_admin_edit_submit($form_id, $form_values) {
$recipients[$key] = trim($recipient);
}
$form_values['recipients'] = implode(',', $recipients);
if (arg(3) == 'add') {
if (arg(2) == 'add') {
db_query("INSERT INTO {contact} (category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%s', %d, %d)", $form_values['category'], $form_values['recipients'], $form_values['reply'], $form_values['weight'], $form_values['selected']);
drupal_set_message(t('Category %category has been added.', array('%category' => theme('placeholder', $form_values['category']))));
watchdog('mail', t('Contact form: category %category added.', array('%category' => theme('placeholder', $form_values['category']))), WATCHDOG_NOTICE, l(t('view'), 'admin/contact'));
......@@ -277,16 +270,13 @@ function contact_admin_delete($cid = NULL) {
* Process category delete form submission.
*/
function contact_admin_delete_submit($form_id, $form_values) {
db_query("DELETE FROM {contact} WHERE cid = %d", arg(4));
db_query("DELETE FROM {contact} WHERE cid = %d", arg(3));
drupal_set_message(t('Category %category has been deleted.', array('%category' => theme('placeholder', $form_values['category']))));
watchdog('mail', t('Contact form: category %category deleted.', array('%category' => theme('placeholder', $form_values['category']))), WATCHDOG_NOTICE);
return 'admin/contact';
}
/**
* Settings tab. Using a form rather than hook_settings().
*/
function contact_admin_settings() {
$form['contact_form_information'] = array('#type' => 'textarea',
'#title' => t('Additional information'),
......@@ -311,7 +301,7 @@ function contact_admin_settings() {
$form['reset'] = array('#type' => 'submit',
'#value' => t('Reset to defaults'),
);
// Use system_settings_form for the callback.
return drupal_get_form('contact_admin_settings', $form, 'system_settings_form');
}
......
......@@ -26,7 +26,7 @@ function contact_help($section) {
case 'admin/modules#description':
return t('Enables the use of both personal and site-wide contact forms.');
case 'admin/contact':
$output = t('This page lets you setup <a href="%form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="%settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('%settings' => url('admin/contact/settings'), '%form' => url('contact')));
$output = t('This page lets you setup <a href="%form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="%settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('%settings' => url('admin/settings/contact'), '%form' => url('contact')));
if (!module_exist('menu')) {
$menu_note = t('The menu item can be customized and configured only once the menu module has been <a href="%modules-page">enabled</a>.', array('%modules-page' => url('admin/modules')));
}
......@@ -55,43 +55,36 @@ function contact_menu($may_cache) {
'callback' => 'contact_admin_categories',
'access' => user_access('administer site configuration'),
);
$items[] = array('path' => 'admin/contact/category',
'title' => t('categories'),
'callback' => 'contact_admin_categories',
'access' => user_access('administer site configuration'),
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items[] = array('path' => 'admin/contact/category/list',
$items[] = array('path' => 'admin/contact/list',
'title' => t('list'),
'callback' => 'contact_admin_categories',
'access' => user_access('administer site configuration'),
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items[] = array('path' => 'admin/contact/category/add',
$items[] = array('path' => 'admin/contact/add',
'title' => t('add category'),
'callback' => 'contact_admin_edit',
'access' => user_access('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
$items[] = array('path' => 'admin/contact/category/edit',
$items[] = array('path' => 'admin/contact/edit',
'title' => t('edit contact category'),
'callback' => 'contact_admin_edit',
'access' => user_access('administer site configuration'),
'type' => MENU_CALLBACK,
);
$items[] = array('path' => 'admin/contact/category/delete',
$items[] = array('path' => 'admin/contact/delete',
'title' => t('delete contact'),
'callback' => 'contact_admin_delete',
'access' => user_access('administer site configuration'),
'type' => MENU_CALLBACK,
);
$items[] = array('path' => 'admin/contact/settings',
'title' => t('settings'),
$items[] = array('path' => 'admin/settings/contact',
'title' => t('contact form'),
'callback' => 'contact_admin_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
'type' => MENU_NORMAL_ITEM,
);
$items[] = array('path' => 'contact',
'title' => t('contact'),
......@@ -154,7 +147,7 @@ function contact_admin_categories() {
$result = db_query('SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category');
$rows = array();
while ($category = db_fetch_object($result)) {
$rows[] = array($category->category, $category->recipients, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/contact/category/edit/'. $category->cid), l(t('delete'), 'admin/contact/category/delete/'. $category->cid));
$rows[] = array($category->category, $category->recipients, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/contact/edit/'. $category->cid), l(t('delete'), 'admin/contact/delete/'. $category->cid));
}
$header = array(t('Category'), t('Recipients'), t('Selected'), array('data' => t('Operations'), 'colspan' => 2));
......@@ -165,7 +158,7 @@ function contact_admin_categories() {
* Category edit page.
*/
function contact_admin_edit($cid = NULL) {
if (arg(3) == "edit" && $cid > 0) {
if (arg(2) == "edit" && $cid > 0) {
$edit = db_fetch_array(db_query("SELECT * FROM {contact} WHERE cid = %d", $cid));
}
$form['category'] = array('#type' => 'textfield',
......@@ -241,7 +234,7 @@ function contact_admin_edit_submit($form_id, $form_values) {
$recipients[$key] = trim($recipient);
}
$form_values['recipients'] = implode(',', $recipients);
if (arg(3) == 'add') {
if (arg(2) == 'add') {
db_query("INSERT INTO {contact} (category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%s', %d, %d)", $form_values['category'], $form_values['recipients'], $form_values['reply'], $form_values['weight'], $form_values['selected']);
drupal_set_message(t('Category %category has been added.', array('%category' => theme('placeholder', $form_values['category']))));
watchdog('mail', t('Contact form: category %category added.', array('%category' => theme('placeholder', $form_values['category']))), WATCHDOG_NOTICE, l(t('view'), 'admin/contact'));
......@@ -277,16 +270,13 @@ function contact_admin_delete($cid = NULL) {
* Process category delete form submission.
*/
function contact_admin_delete_submit($form_id, $form_values) {
db_query("DELETE FROM {contact} WHERE cid = %d", arg(4));
db_query("DELETE FROM {contact} WHERE cid = %d", arg(3));
drupal_set_message(t('Category %category has been deleted.', array('%category' => theme('placeholder', $form_values['category']))));
watchdog('mail', t('Contact form: category %category deleted.', array('%category' => theme('placeholder', $form_values['category']))), WATCHDOG_NOTICE);
return 'admin/contact';
}
/**
* Settings tab. Using a form rather than hook_settings().
*/
function contact_admin_settings() {
$form['contact_form_information'] = array('#type' => 'textarea',
'#title' => t('Additional information'),
......@@ -311,7 +301,7 @@ function contact_admin_settings() {
$form['reset'] = array('#type' => 'submit',
'#value' => t('Reset to defaults'),
);
// Use system_settings_form for the callback.
return drupal_get_form('contact_admin_settings', $form, 'system_settings_form');
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -33,8 +33,6 @@ function forum_help($section) {
return t('<p>Containers help you organize your forums. The job of a container is to hold, or contain, other forums that are related. For example, a container named "Food" might hold two forums named "Fruit" and "Vegetables".</p>');
case 'admin/forum/add/forum':
return t('<p>A forum holds discussion topics that are related. For example, a forum named "Fruit" might contain topics titled "Apples" and "Bananas".</p>');
case 'admin/forum/configure':
return t('This is where you can configure system-wide options for how your forums act and display.');
case 'node/add#forum':
return t('Create a new topic for discussion in the forums.');
}
......@@ -75,11 +73,11 @@ function forum_menu($may_cache) {
'callback' => 'forum_form_forum',
'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/forum/configure',
'title' => t('configure'),
'callback' => 'forum_admin_configure',
$items[] = array('path' => 'admin/settings/forum',
'title' => t('forums'),
'callback' => 'forum_admin_settings',
'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK);
'type' => MENU_NORMAL_ITEM);
}
elseif (is_numeric(arg(4))) {
$term = taxonomy_get_term(arg(4));
......@@ -172,10 +170,7 @@ function forum_taxonomy($op, $type, $term = NULL) {
}
}
/**
* Implementation of hook_settings
*/
function forum_admin_configure() {
function forum_admin_settings() {
$form = array();
$number = drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 150, 200, 250, 300, 350, 400, 500));
......
......@@ -33,8 +33,6 @@ function forum_help($section) {
return t('<p>Containers help you organize your forums. The job of a container is to hold, or contain, other forums that are related. For example, a container named "Food" might hold two forums named "Fruit" and "Vegetables".</p>');
case 'admin/forum/add/forum':
return t('<p>A forum holds discussion topics that are related. For example, a forum named "Fruit" might contain topics titled "Apples" and "Bananas".</p>');
case 'admin/forum/configure':
return t('This is where you can configure system-wide options for how your forums act and display.');
case 'node/add#forum':
return t('Create a new topic for discussion in the forums.');
}
......@@ -75,11 +73,11 @@ function forum_menu($may_cache) {
'callback' => 'forum_form_forum',
'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/forum/configure',
'title' => t('configure'),
'callback' => 'forum_admin_configure',
$items[] = array('path' => 'admin/settings/forum',
'title' => t('forums'),
'callback' => 'forum_admin_settings',
'access' => user_access('administer forums'),
'type' => MENU_LOCAL_TASK);
'type' => MENU_NORMAL_ITEM);
}
elseif (is_numeric(arg(4))) {
$term = taxonomy_get_term(arg(4));
......@@ -172,10 +170,7 @@ function forum_taxonomy($op, $type, $term = NULL) {
}
}
/**
* Implementation of hook_settings
*/
function forum_admin_configure() {
function forum_admin_settings() {
$form = array();
$number = drupal_map_assoc(array(5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 150, 200, 250, 300, 350, 400, 500));
......
......@@ -34,9 +34,6 @@ function node_help($section) {
return $output;
case 'admin/modules#description':
return t('Allows content to be submitted to the site and displayed on pages.');
case 'admin/node/configure':
case 'admin/node/configure/settings':
return t('<p>Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.</p>');
case 'admin/node':
return t('<p>Below is a list of all of the posts on your site. Other forms of content are listed elsewhere (e.g. <a href="%comments">comments</a>).</p><p>Clicking a title views the post, while clicking an author\'s name views their user information.</p>', array('%comments' => url('admin/comment')));
case 'admin/node/search':
......
......@@ -34,9 +34,6 @@ function node_help($section) {
return $output;
case 'admin/modules#description':
return t('Allows content to be submitted to the site and displayed on pages.');
case 'admin/node/configure':
case 'admin/node/configure/settings':
return t('<p>Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.</p>');
case 'admin/node':
return t('<p>Below is a list of all of the posts on your site. Other forms of content are listed elsewhere (e.g. <a href="%comments">comments</a>).</p><p>Clicking a title views the post, while clicking an author\'s name views their user information.</p>', array('%comments' => url('admin/comment')));
case 'admin/node/search':
......
......@@ -29,9 +29,9 @@ function path_help($section) {
<li>add a URL alias: <a href="%admin-path-add">administer &gt;&gt; url aliases &gt;&gt; add alias</a>.</li>
<li>administer the list of URL aliases: <a href="%admin-path">administer &gt;&gt; url aliases</a>.</li>
<li>read how to <a href="%external-http-drupal-org-node-15365">configure clean URLs</a> for your webserver.
<li>enable clean url\'s to remove the =? at <a href="%admin-settings">administer &gt;&gt; settings</a>.</li>
<li>enable clean url\'s to remove the =? at <a href="%admin-clean-url-settings">administer &gt;&gt; settings &gt;&gt; clean URLs</a>.</li>
</ul>
', array('%admin-path-add' => url('admin/path/add'), '%admin-path' => url('admin/path'), '%external-http-drupal-org-node-15365' => 'http://drupal.org/node/15365', '%admin-settings' => url('admin/settings')));
', array('%admin-path-add' => url('admin/path/add'), '%admin-path' => url('admin/path'), '%external-http-drupal-org-node-15365' => 'http://drupal.org/node/15365', '%admin-clean-url-settings' => url('admin/settings/clean-urls')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%path">Path page</a>.', array('%path' => 'http://drupal.org/handbook/modules/path/')) .'</p>';
return $output;
case 'admin/modules#description':
......
......@@ -29,9 +29,9 @@ function path_help($section) {
<li>add a URL alias: <a href="%admin-path-add">administer &gt;&gt; url aliases &gt;&gt; add alias</a>.</li>
<li>administer the list of URL aliases: <a href="%admin-path">administer &gt;&gt; url aliases</a>.</li>
<li>read how to <a href="%external-http-drupal-org-node-15365">configure clean URLs</a> for your webserver.
<li>enable clean url\'s to remove the =? at <a href="%admin-settings">administer &gt;&gt; settings</a>.</li>
<li>enable clean url\'s to remove the =? at <a href="%admin-clean-url-settings">administer &gt;&gt; settings &gt;&gt; clean URLs</a>.</li>
</ul>
', array('%admin-path-add' => url('admin/path/add'), '%admin-path' => url('admin/path'), '%external-http-drupal-org-node-15365' => 'http://drupal.org/node/15365', '%admin-settings' => url('admin/settings')));
', array('%admin-path-add' => url('admin/path/add'), '%admin-path' => url('admin/path'), '%external-http-drupal-org-node-15365' => 'http://drupal.org/node/15365', '%admin-clean-url-settings' => url('admin/settings/clean-urls')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%path">Path page</a>.', array('%path' => 'http://drupal.org/handbook/modules/path/')) .'</p>';
return $output;
case 'admin/modules#description':
......
......@@ -60,7 +60,7 @@ function profile_menu($may_cache) {
'access' => user_access('access user profiles'),
'type' => MENU_SUGGESTED_ITEM);
$items[] = array('path' => 'admin/settings/profile',
'title' => t('profiles'),
'title' => t('user profiles'),
'callback' => 'profile_admin_overview');
$items[] = array('path' => 'admin/settings/profile/add',
'title' => t('add field'),
......
......@@ -60,7 +60,7 @@ function profile_menu($may_cache) {
'access' => user_access('access user profiles'),
'type' => MENU_SUGGESTED_ITEM);
$items[] = array('path' => 'admin/settings/profile',
'title' => t('profiles'),
'title' => t('user profiles'),
'callback' => 'profile_admin_overview');
$items[] = array('path' => 'admin/settings/profile/add',
'title' => t('add field'),
......
......@@ -151,11 +151,18 @@ function search_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'search', 'title' => t('search'),
$items[] = array('path' => 'search',
'title' => t('search'),
'callback' => 'search_view',
'access' => user_access('search content'),
'type' => MENU_SUGGESTED_ITEM);
$items[] = array('path' => 'admin/settings/search/wipe', 'title' => t('Clear index'),
$items[] = array('path' => 'admin/settings/search',
'title' => t('search'),
'callback' => 'search_admin_settings',