Projet

Général

Profil

Paste
Télécharger (1,35 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ctools / plugins / content_types / node_context / node_book_nav.inc @ 1e39edcb

1 85ad3d82 Assos Assos
<?php
2
3
if (module_exists('book')) {
4
  /**
5
   * Plugins are described by creating a $plugin array which will be used
6
   * by the system that includes this file.
7
   */
8
  $plugin = array(
9
    'single' => TRUE,
10 1e39edcb Assos Assos
    'title' => t('Book navigation pager'),
11
    'icon' => '../block/icon_core_booknavigation.png',
12
    'description' => t('The navigational pager and sub pages of the current book node.'),
13 85ad3d82 Assos Assos
    'required context' => new ctools_context_required(t('Node'), 'node'),
14
    'category' => t('Node'),
15
  );
16
}
17
18
function ctools_node_book_nav_content_type_render($subtype, $conf, $panel_args, $context) {
19 136a805a Assos Assos
  $node = isset($context->data) ? clone $context->data : NULL;
20 85ad3d82 Assos Assos
  $block = new stdClass();
21
  $block->module = 'book_nav';
22
23 1e39edcb Assos Assos
  $block->title = t('Book navigation pager');
24 85ad3d82 Assos Assos
  if ($node) {
25
    $block->content = isset($node->book) ? theme('book_navigation', array('book_link' => $node->book)) : '';
26
    $block->delta = $node->nid;
27
  }
28
  else {
29 1e39edcb Assos Assos
    $block->content = t('Book navigation pager goes here.');
30 85ad3d82 Assos Assos
    $block->delta = 'unknown';
31
  }
32
33
  return $block;
34
}
35
36
function ctools_node_book_nav_content_type_admin_title($subtype, $conf, $context) {
37 1e39edcb Assos Assos
  return t('"@s" book navigation pager', array('@s' => $context->identifier));
38 85ad3d82 Assos Assos
}
39
40
function ctools_node_book_nav_content_type_edit_form($form, &$form_state) {
41
  // provide a blank form so we have a place to have context setting.
42
  return $form;
43
}