[ansel] Ansel.php changes

David Bates horde at voygr.com
Wed Jan 21 12:54:22 PST 2004


I'm sure someone is working on this, but my First setup of Ansel failed.. with 
some errors

Modified Ansel.php under the lib directory, here is the diff:

retrieving revision 1.40
diff -u -r1.40 Ansel.php
--- Ansel.php   21 Jan 2004 18:51:34 -0000      1.40
+++ Ansel.php   21 Jan 2004 20:53:35 -0000
@@ -92,20 +92,23 @@
         foreach ($galleries as $galleryId => $gallery) {
             $grouped[$gallery->get('owner')][$galleryId] = $gallery;
         }
-
-        // Sort galleries by owner's name
-        require_once HORDE_LIBS . 'Horde/Identity.php';
-        $keys = array_keys($grouped);
-        foreach($keys as $key) {
-            $identity = &new Identity($key);
-            $names[$key] = $identity->getValue('fullname');
-        }
-        asort($names);
-
-        foreach($names as $key => $val) {
-            $sorted[$key] = $grouped[$key];
-        }
-
+
+       $sorted = array();
+
+       if (count($grouped) > 0) {
+           // Sort galleries by owner's name
+           require_once HORDE_LIBS . 'Horde/Identity.php';
+           $keys = array_keys($grouped);
+           foreach($keys as $key) {
+               $identity = &new Identity($key);
+               $names[$key] = $identity->getValue('fullname');
+           }
+           asort($names);
+
+           foreach($names as $key => $val) {
+               $sorted[$key] = $grouped[$key];
+           }
+       }
         return $sorted;
     }


Thanks 
Dave
-- 
It's a dog eat dog world.
  And I'm wearing 'Milkbone' underwear
"Norm - Cheers"






More information about the ansel mailing list