Commit 2a1e980c authored by Dries's avatar Dries

- Patch #203509 by pwolanin, chx, cwgordon7 et al: fixed menu inheritenace.

parent 67d64ffc
// $Id$
All Drupal code is Copyright 2001 - 2008 by the original authors.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program as the file LICENSE.txt; if not, please see
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
Drupal is a registered trademark of Dries Buytaert.
Drupal includes works under other copyright notices and distributed
......
......@@ -190,12 +190,12 @@ INSTALLATION
8. CRON MAINTENANCE TASKS
Many Drupal modules have periodic tasks that must be triggered by a cron
maintenance task, including search module (to build and update the index
Many Drupal modules have periodic tasks that must be triggered by a cron
maintenance task, including search module (to build and update the index
used for keyword searching), aggregator module (to retrieve feeds from other
sites), ping module (to notify other sites about new or updated content), and
system module (to perform routine maintenance and pruning on system tables).
To activate these tasks, call the cron page by visiting
To activate these tasks, call the cron page by visiting
http://www.example.com/cron.php, which, in turn, executes tasks on behalf
of installed modules.
......
......@@ -2119,10 +2119,6 @@ function _menu_router_build($callbacks) {
// Apply inheritance rules.
foreach ($menu as $path => $v) {
$item = &$menu[$path];
if (!isset($item['access callback']) && isset($item['access arguments'])) {
// Default callback.
$item['access callback'] = 'user_access';
}
if (!$item['_tab']) {
// Non-tab items.
$item['tab_parent'] = '';
......@@ -2164,6 +2160,10 @@ function _menu_router_build($callbacks) {
}
}
}
if (!isset($item['access callback']) && isset($item['access arguments'])) {
// Default callback.
$item['access callback'] = 'user_access';
}
if (!isset($item['access callback']) || empty($item['page callback'])) {
$item['access callback'] = 0;
}
......
......@@ -88,6 +88,7 @@ function profile_menu() {
'description' => 'Create customizable fields for your users.',
'page callback' => 'drupal_get_form',
'page arguments' => array('profile_admin_overview'),
'access arguments' => array('administer users'),
'file' => 'profile.admin.inc',
);
$items['admin/user/profile/add'] = array(
......
......@@ -72,9 +72,12 @@ function system_main_admin_page($arg = NULL) {
*/
function system_admin_menu_block_page() {
$item = menu_get_item();
$content = system_admin_menu_block($item);
$output = theme('admin_block_content', $content);
if ($content = system_admin_menu_block($item)) {
$output = theme('admin_block_content', $content);
}
else {
$output = t('You do not have any administrative items.');
}
return $output;
}
......
......@@ -155,7 +155,7 @@ function system_theme() {
* Implementation of hook_perm().
*/
function system_perm() {
return array('administer site configuration', 'access administration pages', 'administer actions', 'select different theme', 'administer files');
return array('administer site configuration', 'access administration pages', 'administer actions', 'access site reports', 'select different theme', 'administer files');
}
/**
......@@ -234,7 +234,6 @@ function system_menu() {
'position' => 'left',
'weight' => -10,
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('access administration pages'),
'file' => 'system.admin.inc',
);
......@@ -245,7 +244,6 @@ function system_menu() {
'position' => 'right',
'weight' => -5,
'page callback' => 'system_settings_overview',
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/build'] = array(
......@@ -254,7 +252,6 @@ function system_menu() {
'position' => 'right',
'weight' => -10,
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/admin'] = array(
......@@ -263,6 +260,7 @@ function system_menu() {
'position' => 'left',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_admin_theme_settings'),
'access arguments' => array('administer site configuration'),
'block callback' => 'system_admin_theme_settings',
'file' => 'system.admin.inc',
);
......@@ -272,6 +270,7 @@ function system_menu() {
'description' => 'Change which theme your site uses or allows users to set.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_themes_form', NULL),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/build/themes/select'] = array(
......@@ -308,6 +307,7 @@ function system_menu() {
'description' => 'Enable or disable add-on modules for your site.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_modules'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/build/modules/list'] = array(
......@@ -367,6 +367,7 @@ function system_menu() {
'description' => 'Change basic site information, such as the site name, slogan, e-mail address, mission, front page and more.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_site_information_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/error-reporting'] = array(
......@@ -374,12 +375,14 @@ function system_menu() {
'description' => 'Control how Drupal deals with errors including 403/404 errors as well as PHP error reporting.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_error_reporting_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/logging'] = array(
'title' => 'Logging and alerts',
'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destination, such as syslog, database, email, ...etc.",
'page callback' => 'system_logging_overview',
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/performance'] = array(
......@@ -387,6 +390,7 @@ function system_menu() {
'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_performance_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/file-system'] = array(
......@@ -394,6 +398,7 @@ function system_menu() {
'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_file_system_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/image-toolkit'] = array(
......@@ -401,6 +406,7 @@ function system_menu() {
'description' => 'Choose which image toolkit to use if you have installed optional toolkits.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_image_toolkit_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/content/rss-publishing'] = array(
......@@ -416,6 +422,7 @@ function system_menu() {
'description' => "Settings for how Drupal displays date and time, as well as the system's default timezone.",
'page callback' => 'drupal_get_form',
'page arguments' => array('system_date_time_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/date-time/lookup'] = array(
......@@ -429,6 +436,7 @@ function system_menu() {
'description' => 'Take the site off-line for maintenance or bring it back online.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_site_maintenance_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/clean-urls'] = array(
......@@ -436,6 +444,7 @@ function system_menu() {
'description' => 'Enable or disable clean URLs for your site.',
'page callback' => 'drupal_get_form',
'page arguments' => array('system_clean_url_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
$items['admin/settings/clean-urls/check'] = array(
......@@ -460,6 +469,7 @@ function system_menu() {
'title' => 'Reports',
'description' => 'View reports from system logs and other status information.',
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('access site reports'),
'weight' => 5,
'position' => 'left',
'file' => 'system.admin.inc',
......
......@@ -915,7 +915,7 @@ function user_menu() {
'description' => "Manage your site's users, groups and access to site features.",
'position' => 'left',
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('administer site configuration'),
'access arguments' => array('access administration pages'),
'file' => 'system.admin.inc',
'file path' => drupal_get_path('module', 'system'),
);
......@@ -943,6 +943,7 @@ function user_menu() {
'description' => 'Configure default behavior of users, including registration requirements, e-mails, and user pictures.',
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_settings'),
'access arguments' => array('administer users'),
'file' => 'user.admin.inc',
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment