Projet

Général

Profil

Révision c304a780

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/plugins/content_types/node_context/node_book_menu.inc
1 1
<?php
2 2

  
3
/**
4
 * @file
5
 */
6

  
3 7
if (module_exists('book')) {
4 8
  /**
5 9
   * Plugins are described by creating a $plugin array which will be used
......
61 65
    elseif ($current_bid) {
62 66
      // Only display this block when the user is browsing a book.
63 67
      $select = db_select('node', 'n')
64
          ->fields('n', array('title'))
65
          ->condition('n.nid', $node->book['bid'])
66
          ->addTag('node_access');
68
        ->fields('n', array('title'))
69
        ->condition('n.nid', $node->book['bid'])
70
        ->addTag('node_access');
67 71
      $title = $select->execute()->fetchField();
68 72
      // Only show the block if the user has view access for the top-level node.
69 73
      if ($title) {
70 74
        $tree = menu_tree_all_data($node->book['menu_name'], $node->book);
71 75
        // There should only be one element at the top level.
72 76
        $data = array_shift($tree);
73
        // TODO: subject is not rendered
77
        // TODO: subject is not rendered.
74 78
        $block->subject = theme('book_title_link', array('link' => $data['link']));
75 79
        $block->content = ($data['below']) ? menu_tree_output($data['below']) : '';
76 80
      }
......
92 96
  // Grab block form from the book module.
93 97
  $block_form = book_block_configure($delta = '');
94 98
  // TODO: this does not work yet.
95
  //       See TODO in: ctools_node_book_menu_content_type_render
99
  //       See TODO in: ctools_node_book_menu_content_type_render.
96 100
  if (isset($form_state['input']['book_block_mode'])) {
97 101
    $block_form['book_block_mode']['#default_value'] = $form_state['input']['book_block_mode'];
98 102
  }

Formats disponibles : Unified diff