You are here

function book_access_menu_alter in Book access 1.x

Same name and namespace in other branches
  1. 6.2 book_access.module \book_access_menu_alter()
  2. 6 book_access.module \book_access_menu_alter()
  3. 7.2 book_access.module \book_access_menu_alter()

@FIXME hook_menu_alter() is gone in Drupal 8. You will have to port its functionality manually. The are several mechanisms for this:

To alter routes, you must implement a route subscriber class. An empty one has been generated for you in src/Routing/RouteSubscriber.php.

To alter menu link definitions, see hook_menu_links_discovered_alter(). An empty implementation has been created at the end of this file.

To alter local task definitions, see hook_menu_local_tasks_alter(). An empty implementation has been created for you at the end of this file.

To alter local actions, see hook_menu_local_actions_alter(). An empty implementation has been created for you at the end of this file.

Contextual links are altered during rendering only. See hook_contextual_links_view_alter(). An empty implementation has been created for you at the end of this file.

See also

https://www.drupal.org/node/2118147#alter

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Menu%21me...

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Menu%21me...

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Menu%21me...

https://api.drupal.org/api/drupal/core%21modules%21contextual%21contextu...

File

./book_access.module, line 257

Code

function book_access_menu_alter(&$items) {

  /*  if (isset($items['node/%node/outline'])) {
    $items['node/%node/outline']['access callback'] = '_book_access_outline_access';
    }

    if (isset($items['node/%node/outline/remove'])) {
    $items['node/%node/outline/remove']['access callback'] = '_book_access_outline_remove_access';
    }*/
}