commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / ctools / plugins / content_types / node_context / node_book_children.inc
1 <?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 'title' => t('Book children'),
11 'icon' => 'icon_node.png',
12 'description' => t('The children menu the book the node belongs to.'),
13 'required context' => new ctools_context_required(t('Node'), 'node'),
14 'category' => t('Node'),
15 );
16 }
17
18 function ctools_node_book_children_content_type_render($subtype, $conf, $panel_args, $context) {
19 $node = isset($context->data) ? clone($context->data) : NULL;
20 $block = new stdClass();
21 $block->module = 'book_children';
22
23 $block->title = t('Book children');
24 if ($node) {
25 $block->content = isset($node->book) ? book_children($node->book) : '';
26 $block->delta = $node->nid;
27 }
28 else {
29 $block->content = t('Book children menu goes here.');
30 $block->delta = 'unknown';
31 }
32
33 return $block;
34 }
35
36 function ctools_node_book_children_content_type_admin_title($subtype, $conf, $context) {
37 return t('"@s" book children', array('@s' => $context->identifier));
38 }
39
40 function ctools_node_book_children_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 }