Return an empty array, not an empty string
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 21 Jan 2011 15:50:32 +0000 (10:50 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 21 Jan 2011 15:50:55 +0000 (10:50 -0500)
ansel/lib/Storage.php
ansel/lib/View/EmbeddedRenderer/Mini.php

index f31136b..dee5fdd 100644 (file)
@@ -875,11 +875,7 @@ class Ansel_Storage
 
         }
 
-        if (count($json)) {
-            return Horde_Serialize::serialize($json, Horde_Serialize::JSON);
-        }
-
-        return '';
+        return Horde_Serialize::serialize($json, Horde_Serialize::JSON);
     }
 
     /**
index d315a6d..07d0662 100644 (file)
@@ -19,28 +19,24 @@ class Ansel_View_EmbeddedRenderer_Mini extends Ansel_View_Gallery
      */
     public function html()
     {
-        /* Required */
+        // Required
         $node = $this->_params['container'];
         if (empty($node)) {
             return '';
         }
 
-        /* Optional */
+        // Optional
         $gallery_slug = !empty($this->_params['gallery_slug']) ? $this->_params['gallery_slug'] : '';
         $gallery_id = !empty($this->_params['gallery_id']) ? $this->_params['gallery_id']: null;
-
         $start = (isset($this->_params['start'])) ? $this->_params['start'] : 0;
         $count = (isset($this->_params['count'])) ? $this->_params['count'] : 0;
         $perpage = (isset($this->_params['perpage'])) ? $this->_params['perpage'] : 0;
         $thumbsize = (!empty($this->_params['thumbsize'])) ? $this->_params['thumbsize'] : 'mini';
-        // Limit to these image views only.
-        if ($thumbsize != 'mini' && $thumbsize != 'thumb' &&
-            $thumbsize != 'screen') {
-
+        if ($thumbsize != 'mini' && $thumbsize != 'thumb' && $thumbsize != 'screen') {
              $thumbsize = 'mini';
         }
 
-        /* An image list instead of a gallery? */
+        // An image list instead of a gallery?
         $images = (!empty($this->_params['images'])) ? $this->_params['images'] : array();
         if (!empty($images)) {
             // Images are filtered for age and password protected galleries