You are here

function node_gallery_gallery_load in Node Gallery 6.3

Same name and namespace in other branches
  1. 6 node_gallery.module \node_gallery_gallery_load()
  2. 6.2 node_gallery.module \node_gallery_gallery_load()

Object replacement function for hook_menu().

Parameters

$nid: The nid of a node.

Return value

A populated node object if the $nid passed in corresponds to a gallery, FALSE if not.

1 call to node_gallery_gallery_load()
node_gallery_form_imagefield_import_form_alter in ./node_gallery.module

File

./node_gallery.module, line 1016
Node gallery module file.

Code

function node_gallery_gallery_load($nid) {
  $types = node_gallery_get_types('gallery');
  if (is_numeric($nid)) {
    $node = node_load($nid);

    // is the current node used in any ng relationships?
    if (in_array($node->type, $types)) {
      return $node;
    }
    else {

      // this is not a ng node
      return FALSE;
    }
  }
  return FALSE;
}