node_book_nav.inc
Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008 function panels_node_book_nav_panels_content_types() {
00009 if (module_exists('book')) {
00010 $items['node_book_nav'] = array(
00011 'title' => t('Node book navigation'),
00012
00013 'single' => TRUE,
00014 'content_types' => 'panels_admin_content_types_node_book_nav',
00015 'render callback' => 'panels_content_node_book_nav',
00016 'title callback' => 'panels_admin_title_node_book_nav',
00017 );
00018 return $items;
00019 }
00020 }
00021
00022
00023
00024
00025
00026 function panels_content_node_book_nav($conf, $panel_args, $context) {
00027 $node = isset($context->data) ? drupal_clone($context->data) : NULL;
00028 $block = new stdClass();
00029 $block->module = 'book_nav';
00030
00031 $block->subject = t('Book navigation');
00032 if ($node) {
00033 $block->content = theme('book_navigation', $node);
00034 $block->delta = $node->nid;
00035 }
00036 else {
00037 $block->content = t('Book navigation goes here.');
00038 $block->delta = 'unknown';
00039 }
00040
00041 return $block;
00042 }
00043
00044
00045
00046
00047 function panels_admin_content_types_node_book_nav() {
00048 return array(
00049 'node_type' => array(
00050 'title' => t('Book navigation'),
00051 'icon' => 'icon_node.png',
00052 'path' => panels_get_path('content_types/node'),
00053 'description' => t('A list of files attached to the node.'),
00054 'required context' => new panels_required_context(t('Node'), 'node'),
00055 'category' => array(t('Node context'), -9),
00056 ),
00057 );
00058 }
00059
00060 function panels_admin_title_node_book_nav($conf, $context) {
00061 return t('"@s" book navigation', array('@s' => $context->identifier));
00062 }
00063