function panels_image_render in Image 5.2
Output function for the 'image' content type. Outputs an image node based on the module and delta supplied in the configuration.
1 string reference to 'panels_image_render'
- image_image_panels_content_types in content_types/
image.inc - Callback function to supply a list of content types.
File
- content_types/
image.inc, line 43
Code
function panels_image_render($conf, $panel_args) {
$nid = $conf['nid'];
if (!is_numeric($nid)) {
return;
}
$node = node_load($nid);
if (!node_access('view', $node)) {
return;
}
$block->module = 'node';
$block->delta = $node->nid;
if (!empty($conf['image_size'])) {
$node->panel_image_size = $conf['image_size'];
}
if (!empty($conf['caption_type'])) {
if ($conf['caption_type'] == 'custom' && !empty($conf['caption_text'])) {
$node->panel_image_caption = check_plain($conf['caption_text']);
}
elseif ($conf['caption_type'] == 'body') {
$node->panel_image_caption = check_markup($node->body, $node->format, FALSE);
}
}
$block->content = node_view($node, FALSE, FALSE, FALSE);
return $block;
}