Disable 'show core Outline tab' permission

This commit is contained in:
Manuel Cillero 2017-07-26 14:50:44 +02:00
parent 57cdc2dc17
commit 82d3282b44

View file

@ -25,7 +25,7 @@ function book_made_simple_init()
function book_made_simple_perm()
{
return array('show book reorder tab','show core Outline tab','show core Outline form element');
return array('show book reorder tab','show core Outline form element');
}
/**
* Implementation of hook_menu().
@ -43,14 +43,14 @@ function book_made_simple_menu()
'type' => MENU_NORMAL_ITEM,
);
$items['node/%node/reorder'] = array(
'title' => t('Reorder the book'),
'title' => 'Rearrange',
'page callback' => 'book_made_simple_reorder',
'page arguments' => array(1),
'access callback' => 'is_reorder_access',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
'weight' =>2
);
'weight' => 2
); /*
$items['node/%node/outline'] = array(
'title' => 'Outline',
'page callback' => 'book_outline',
@ -60,8 +60,8 @@ function book_made_simple_menu()
'weight' => 10,
'file' => 'book.pages.inc',
'file path' => drupal_get_path('module','book')
);
return $items;
); */
return $items;
}
function is_outline_access($node = NULL)
@ -693,10 +693,6 @@ function book_made_simple_theme_menu_item_link($link)
{
// Find out which theme function to dispatch to after preprocessing.
$registry = theme_get_registry();
if (isset($link['path']) && $link['path'] == 'node/%/outline' && ! user_access("show core Outline tab"))
{
return null;
}
$function = $registry['BMS']['menu_item_link']['function'];
if ($function)
{