function node_gallery_api_get_item_navigator in Node Gallery 7
Builds an array with the data necessary to navigate a gallery.
Parameters
int $ngid: The nid of the gallery to navigate within.
int $nid: The nid of the current image.
bool $reset: (optional) boolean when set to true, clears the caches.
Return value
array An associative array consisting of:
- total: The count of published images in the gallery.
- parent: The nid of the gallery.
- current: The nid of the current image.
- prev_nid: The nid of the previous image.
- next_nid: The nid of the next image.
- first_nid: The nid of the first image in the gallery.
- last_nid: The nid of the last image in the gallery.
2 calls to node_gallery_api_get_item_navigator()
- node_gallery_api_views_handler_item_navigator::render in includes/
views/ node_gallery_api_views_handler_item_navigator.inc - Render the field.
- _node_gallery_api_item_view in ./
node_gallery_api.module - Attaches the image navigator to the image node's content.
File
- ./
node_gallery_api.module, line 1132 - Node Gallery module.
Code
function node_gallery_api_get_item_navigator($ngid, $nid, $reset = FALSE) {
$navigator['total'] = node_gallery_api_get_item_count($ngid, $reset);
$navigator['gallery_nid'] = $ngid;
$navigator['current'] = node_gallery_api_get_item_position($ngid, $nid, $reset);
$navigator['prev_nid'] = node_gallery_api_get_prev_item($ngid, $nid, $reset);
$navigator['next_nid'] = node_gallery_api_get_next_item($ngid, $nid, $reset);
$navigator['first_nid'] = node_gallery_api_get_first_item($ngid, $reset);
$navigator['last_nid'] = node_gallery_api_get_last_item($ngid, $reset);
$navigator['image_nids'] = node_gallery_api_get_item_list($ngid, $reset);
return $navigator;
}