From: Michael J. Rubinsky Date: Mon, 3 Jan 2011 17:18:42 +0000 (-0500) Subject: return the gallery's parent id too X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3dae1b041ccebef8c9f0289429626b7a804c6c5d;p=horde.git return the gallery's parent id too --- 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()) {