You are here

function book_helper_link_alter in Book helper 6

Implementation of hook_link_alter().

File

./book_helper.module, line 226
Improves Drupal's core book module's functionality.

Code

function book_helper_link_alter(&$links, $node, $comment = NULL) {
  $book_link_names = array(
    'book_add_child',
    'book_printer',
  );
  $book_helper_links = variable_get('book_helper_links', $book_link_names);
  foreach ($book_link_names as $book_link_name) {
    if (isset($links[$book_link_name]) && (empty($book_helper_links) || !in_array($book_link_name, $book_helper_links))) {
      unset($links[$book_link_name]);
    }
  }
}