node_body.inc in Chaos Tool Suite (ctools) 6
File
plugins/content_types/node_context/node_body.inc
View source
<?php
$plugin = array(
'single' => TRUE,
'title' => t('Node body'),
'icon' => 'icon_node.png',
'description' => t('The body of the referenced node.'),
'required context' => new ctools_context_required(t('Node'), 'node'),
'category' => t('Node'),
);
function ctools_node_body_content_type_render($subtype, $conf, $panel_args, $context) {
if (empty($context) || empty($context->data)) {
return;
}
$node = $context->data;
$type = node_get_types('type', $node->type);
if (!$type->has_body) {
return;
}
$body = str_replace('<!--break-->', '', $node->body);
$block = new stdClass();
$block->module = 'node_body';
$block->title = $type->body_label;
$block->content = check_markup($body, $node->format, FALSE);
$block->delta = $node->nid;
return $block;
}
function ctools_node_body_content_type_edit_form(&$form, &$form_state) {
}
function ctools_node_body_content_type_admin_title($subtype, $conf, $context) {
return t('"@s" body', array(
'@s' => $context->identifier,
));
}