You are here

function node_gallery_get_image_parent_gallery_config in Node Gallery 6.2

5 calls to node_gallery_get_image_parent_gallery_config()
node_gallery_form_alter in ./node_gallery.module
node_gallery_lightbox2_nodeapi in contrib/node_gallery_lightbox2/node_gallery_lightbox2.module
Implementation of hook_nodeapi
node_gallery_link_alter in ./node_gallery.module
Implementation of hook_link_alter().
node_gallery_preprocess_node in ./node_gallery.module
_node_gallery_image_view in ./node_gallery.module

File

./node_gallery.inc, line 208
Node gallery models

Code

function node_gallery_get_image_parent_gallery_config($image) {
  static $image_gallery_configs;

  //use the $image->nid as a token, because we don't know the image's parent gallery type.
  if (empty($image_gallery_configs[$image->nid])) {
    if (!empty($image->gid)) {
      $parent_type = db_result(db_query("SELECT n.type FROM {node} n INNER JOIN {node_galleries} ng ON n.nid = ng.gid\n       WHERE ng.nid = %d", $image->nid));
      $image_gallery_configs[$image->nid] = node_gallery_get_config($parent_type);
    }
  }
  return $image_gallery_configs[$image->nid];
}