Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
|
@ -88,7 +88,7 @@ function book_entity_type_build(array &$entity_types) {
|
|||
/**
|
||||
* Implements hook_node_links_alter().
|
||||
*/
|
||||
function book_node_links_alter(array &$node_links, NodeInterface $node, array &$context) {
|
||||
function book_node_links_alter(array &$links, NodeInterface $node, array &$context) {
|
||||
if ($context['view_mode'] != 'rss') {
|
||||
$account = \Drupal::currentUser();
|
||||
|
||||
|
|
@ -97,14 +97,14 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$
|
|||
$child_type = \Drupal::config('book.settings')->get('child_type');
|
||||
$access_control_handler = \Drupal::entityManager()->getAccessControlHandler('node');
|
||||
if (($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines')) && $access_control_handler->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) {
|
||||
$links['book_add_child'] = array(
|
||||
$book_links['book_add_child'] = array(
|
||||
'title' => t('Add child page'),
|
||||
'url' => Url::fromRoute('node.add', ['node_type' => $child_type], ['query' => ['parent' => $node->id()]]),
|
||||
);
|
||||
}
|
||||
|
||||
if ($account->hasPermission('access printer-friendly version')) {
|
||||
$links['book_printer'] = array(
|
||||
$book_links['book_printer'] = array(
|
||||
'title' => t('Printer-friendly version'),
|
||||
'url' => Url::fromRoute('book.export', [
|
||||
'type' => 'html',
|
||||
|
|
@ -116,10 +116,10 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($links)) {
|
||||
$node_links['book'] = array(
|
||||
if (!empty($book_links)) {
|
||||
$links['book'] = array(
|
||||
'#theme' => 'links__node__book',
|
||||
'#links' => $links,
|
||||
'#links' => $book_links,
|
||||
'#attributes' => array('class' => array('links', 'inline')),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue