You are here

function node_gallery_json_get_images in Node Gallery 6.3

Page callback for json image object requests.

Parameters

object $gallery: The node object of a gallery

integer $image_nid: The integer that contains the nid of the "current" image. If not specified, all images are returned.

integer $to_left: The number of images to the left of the current image to fetch.

integer $to_right: The number of images to the right of the current image to fetch.

1 string reference to 'node_gallery_json_get_images'
node_gallery_menu in ./node_gallery.module
Implements hook_menu().

File

./node_gallery.pages.inc, line 833
Handles displaying of Node gallery pages.

Code

function node_gallery_json_get_images($gallery, $image_nid = NULL, $to_left = 0, $to_right = 0) {
  if (empty($image_nid)) {
    return drupal_json(node_gallery_get_images($gallery));
  }
  if (empty($to_left)) {
    $to_left = 0;
  }
  if (empty($to_right)) {
    $to_right = 0;
  }
  return drupal_json(node_gallery_get_images_slice($gallery, $image_nid, $to_left, $to_right));
}