function node_gallery_api_get_item_list in Node Gallery 7
Gets a sorted list of images nids within a gallery.
Parameters
int $ngid: The nid of the gallery to query.
bool $reset: (optional) If TRUE, clears the cache, defaults to FALSE.
Return value
array An array of sorted image nids with a status of published.
5 calls to node_gallery_api_get_item_list()
- node_gallery_api_get_first_item in ./
node_gallery_api.inc - Gets the first image nid within a gallery.
- node_gallery_api_get_item_count in ./
node_gallery_api.inc - Gets the count of published images within a gallery.
- node_gallery_api_get_item_navigator in ./
node_gallery_api.module - Builds an array with the data necessary to navigate a gallery.
- node_gallery_api_get_last_item in ./
node_gallery_api.inc - Gets the last image nid within a gallery.
- node_gallery_api_seek_from_current_item in ./
node_gallery_api.inc - Returns the nid of the image +/-N steps away from the current image node.
File
- ./
node_gallery_api.inc, line 557 - Node Gallery API function
Code
function node_gallery_api_get_item_list($ngid, $reset = FALSE) {
$item_list = drupal_static(__FUNCTION__, array(), $reset);
if (!isset($item_list[$ngid]) || $reset) {
if (!$reset && ($cache = cache_get('node_gallery:' . $ngid . ':item_list'))) {
$item_list[$ngid] = $cache->data;
}
else {
_node_gallery_api_cache_sorted_item_nids($ngid);
$cache = cache_get('node_gallery:' . $ngid . ':item_list');
$item_list[$ngid] = $cache->data;
}
}
return $item_list[$ngid];
}