function node_gallery_get_image_to_gallery_types in Node Gallery 6.3
Builds an array that associates image types with gallery types.
Parameters
$reset: (optional) A boolean that when set to true will clear the cache.
Return value
An associative array where the keys are the image content types and the values are the gallery content types.
3 calls to node_gallery_get_image_to_gallery_types()
- node_gallery_change_gallery_action_form in ./
node_gallery.actions.inc - Builds the form to allow a user to change the gallery of an image.
- node_gallery_get_relationship in ./
node_gallery.inc - Fetches a gallery-to-image relationship from the database.
- node_gallery_nodeapi in ./
node_gallery.module - Implements hook_nodeapi().
File
- ./
node_gallery.inc, line 18 - Shared functions for node_gallery
Code
function node_gallery_get_image_to_gallery_types($reset = FALSE) {
static $i2g = array();
if (empty($i2g) || $reset) {
$result = db_query("SELECT image_type, gallery_type from {node_gallery_relationships}");
while ($r = db_fetch_array($result)) {
$i2g[$r['image_type']] = $r['gallery_type'];
}
}
return $i2g;
}