Galleries are referred to by id in Ansel, not name
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 31 Jan 2011 14:21:21 +0000 (09:21 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 31 Jan 2011 14:21:57 +0000 (09:21 -0500)
ansel/lib/Block/recent_comments.php
ansel/lib/Block/recently_added.php

index eb5c600..35f74a0 100644 (file)
@@ -44,8 +44,8 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
         if (empty($GLOBALS['conf']['gallery']['listlimit']) ||
             ($storage->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit'])) {
 
-            foreach ($storage->listGalleries(array('perm' => Horde_Perms::READ)) as $id => $gal) {
-                $params['gallery']['values'][$id] = $gal->get('name');
+            foreach ($storage->listGalleries(array('perm' => Horde_Perms::READ)) as $gal) {
+                $params['gallery']['values'][$gal->getId()] = $gal->get('name');
             }
         }
 
index 49d0e54..3596077 100644 (file)
@@ -47,9 +47,9 @@ class Horde_Block_ansel_recently_added extends Horde_Block
         if (empty($GLOBALS['conf']['gallery']['listlimit']) ||
             ($GLOBALS['injector']->getInstance('Ansel_Storage')->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit'])) {
 
-            foreach ($GLOBALS['injector']->getInstance('Ansel_Storage')->listGalleries(array('perm' => Horde_Perms::READ)) as $id => $gal) {
+            foreach ($GLOBALS['injector']->getInstance('Ansel_Storage')->listGalleries(array('perm' => Horde_Perms::READ)) as $gal) {
                 if (!$gal->hasPasswd() && $gal->isOldEnough()) {
-                    $params['gallery']['values'][$id] = $gal->get('name');
+                    $params['gallery']['values'][$gal->getId()] = $gal->get('name');
                 }
             }
         }