function _node_gallery_image_view in Node Gallery 6.2
Same name and namespace in other branches
- 6.3 node_gallery.module \_node_gallery_image_view()
1 call to _node_gallery_image_view()
- node_gallery_nodeapi in ./
node_gallery.module - Implementation of hook_nodeapi().
File
- ./
node_gallery.module, line 363 - Node gallery module file
Code
function _node_gallery_image_view(&$node, $teaser = NULL, $page = NULL) {
$config = node_gallery_get_image_parent_gallery_config($node);
if ($config['content_display'] == 'gallery') {
$node->content['body']['#value'] = node_gallery_get_gallery_content($node->gid, $teaser);
$tmp = $node->content['body'];
unset($node->content);
$node->content['body'] = $tmp;
}
if ($config['image_comment'] == 'gallery') {
$node->comment = variable_get('comment_' . $config['gallery_type'], COMMENT_NODE_READ_WRITE);
}
elseif ($config['image_comment' == 'image']) {
$node->image_comment = $node->comment;
//this is a hack for display comments in vars['comment'];
$node->comment = 0;
}
if (!$teaser) {
$gallery_node = node_load($node->gid);
drupal_set_breadcrumb(array(
l(t('Home'), NULL),
l(t('Galleries'), 'galleries'),
l(t('!user\'s Galleries', array(
'!user' => $node->name,
)), 'galleries/' . $node->uid),
l($gallery_node->title, 'node/' . $gallery_node->nid),
));
$node->content['image_navigator'] = array(
'#value' => theme('gallery_image_navigator', node_gallery_get_image_navigator($node->gid, $node->nid), $node),
'#weight' => -10,
);
$node->content['image'] = array(
'#value' => theme('image_detail_view', $node, $config),
'#weight' => -5,
);
}
else {
$node->content['image'] = array(
'#value' => theme('image_view', $config['teaser']['image'], $node),
'#weight' => -3,
);
}
}