function node_gallery_lightbox2_nodeapi in Node Gallery 6.2
Implementation of hook_nodeapi
File
- contrib/
node_gallery_lightbox2/ node_gallery_lightbox2.module, line 77 - node_gallery_lightbox2.module
Code
function node_gallery_lightbox2_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'view':
if (in_array($node->type, (array) node_gallery_get_types('image'))) {
$config = node_gallery_get_image_parent_gallery_config($node);
if ($a4 && $config['original']['view_original'] == 'lightbox2') {
$image_view = theme('image_view', $config['image_size']['preview'], $node);
$node->content['image']['#value'] = "<div class='image-preview'>" . l($image_view, imagecache_create_url($config['original']['lightbox2'], $node->filepath), array(
'attributes' => array(
'rel' => 'lightbox',
),
'html' => TRUE,
)) . "</div>";
}
}
break;
}
}