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