'default' => true));
$storage = $GLOBALS['injector']->getInstance('Ansel_Storage');
- if ($storage->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+ if (empty($GLOBALS['conf']['gallery']['listlimit']) ||
+ ($storage->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit'])) {
+
foreach ($storage->listGalleries() as $gal) {
$params['gallery']['values'][$gal->id] = $gal->get('name');
}
'default' => '__random',
'values' => array('all' => 'All')));
$storage = $GLOBALS['injector']->getInstance('Ansel_Storage');
- if ($storage->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+ 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');
}
'default' => 10),
);
- if ($GLOBALS['injector']->getInstance('Ansel_Storage')->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+ 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) {
if (!$gal->hasPasswd() && $gal->isOldEnough()) {
$params['gallery']['values'][$id] = $gal->get('name');