You are here

social_book.module in Open Social 8.3

The Social book module.

File

modules/social_features/social_book/social_book.module
View source
<?php

/**
 * @file
 * The Social book module.
 */
use Drupal\node\NodeInterface;

/**
 * Implements hook_node_links_alter().
 */
function social_book_node_links_alter(array &$links, NodeInterface $entity, array &$context) {

  // Remove the printer-friendly version link.
  unset($links['book']['#links']['book_printer']);
  unset($links['book']['#links']['book_add_child']);
}

/**
 * Implements hook_menu_local_tasks_alter().
 */
function social_book_menu_local_tasks_alter(&$data, $route_name) {

  // Remove the outline from ALL pages.
  if (isset($data['tabs'][0]['entity.node.book_outline_form'])) {
    unset($data['tabs'][0]['entity.node.book_outline_form']);
  }
}