- Modified patch #194166 by profix898 and chx: menu system does not respect MENU_MODIFIABLE_BY_ADMIN.

6.x
Dries Buytaert 2007-11-23 13:31:36 +00:00
parent 7755003386
commit 4d6c7bd41a
1 changed files with 96 additions and 91 deletions

View File

@ -65,7 +65,7 @@ function _menu_overview_tree_form($tree) {
$title = '';
$item = $data['link'];
// Don't show callbacks; these have $item['hidden'] < 0.
if ($item && $item['hidden'] >= 0) {
if ($item && $item['hidden'] >= 0 && ($item['type'] & MENU_MODIFIABLE_BY_ADMIN)) {
$mlid = 'mlid:'. $item['mlid'];
$form[$mlid]['#item'] = $item;
$form[$mlid]['#attributes'] = $item['hidden'] ? array('class' => 'menu-disabled') : array('class' => 'menu-enabled');
@ -222,7 +222,7 @@ function theme_menu_overview_form($form) {
* Menu callback; Build the menu link editing form.
*/
function menu_edit_item(&$form_state, $type, $item, $menu) {
if ($item['type'] & MENU_MODIFIABLE_BY_ADMIN) {
$form['menu'] = array(
'#type' => 'fieldset',
'#title' => t('Menu settings'),
@ -318,6 +318,11 @@ function menu_edit_item(&$form_state, $type, $item, $menu) {
return $form;
}
else {
drupal_access_denied();
return;
}
}
/**
* Validate form values for a menu link being added or edited.