From 3dae1b041ccebef8c9f0289429626b7a804c6c5d Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 3 Jan 2011 12:18:42 -0500 Subject: [PATCH] return the gallery's parent id too --- ansel/lib/Gallery.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansel/lib/Gallery.php b/ansel/lib/Gallery.php index 872696d54..37ce737f1 100644 --- a/ansel/lib/Gallery.php +++ b/ansel/lib/Gallery.php @@ -999,6 +999,15 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical implements Seria $json->d = $this->get('desc'); $json->ki = Ansel::getImageUrl($this->getKeyImage(), 'mini', false, Ansel::getStyleDefinition('ansel_default'))->toString(); + // Parent + $parents = $this->get('parents'); + if (empty($parents)) { + $json->p = null; + } else { + $parents = explode(':', $parents); + $json->p = array_pop($parents); + } + if ($full) { $json->sg = array(); if ($this->hasSubGalleries()) { -- 2.11.0