From 0fea3f2b18bfad91aa99b2864c9e5e7909a85b1f Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 21 Jan 2011 10:50:32 -0500 Subject: [PATCH] Return an empty array, not an empty string --- ansel/lib/Storage.php | 6 +----- ansel/lib/View/EmbeddedRenderer/Mini.php | 12 ++++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index f31136b31..dee5fdd57 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -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); } /** diff --git a/ansel/lib/View/EmbeddedRenderer/Mini.php b/ansel/lib/View/EmbeddedRenderer/Mini.php index d315a6d3e..07d0662c4 100644 --- a/ansel/lib/View/EmbeddedRenderer/Mini.php +++ b/ansel/lib/View/EmbeddedRenderer/Mini.php @@ -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 -- 2.11.0