From: Michael J. Rubinsky Date: Wed, 22 Sep 2010 21:16:29 +0000 (-0400) Subject: use the tilesperrow/page value if it exists X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=844a0422d8b2a064ea11deed013090ab7b7663e4;p=horde.git use the tilesperrow/page value if it exists --- diff --git a/ansel/lib/View/List.php b/ansel/lib/View/List.php index c351faabf..389dd4a26 100644 --- a/ansel/lib/View/List.php +++ b/ansel/lib/View/List.php @@ -85,7 +85,7 @@ class Ansel_View_List extends Ansel_View_Base } else { $this->_page = Horde_Util::getFormData('page', 0); } - $this->_g_perPage = $prefs->getValue('tilesperpage'); + $this->_g_perPage = $this->tilesperpage ? $this->tilesperpage : $prefs->getValue('tilesperpage'); // If we are calling from the api, we can just pass a list of gallery // ids instead of doing grouping stuff. @@ -235,6 +235,7 @@ class Ansel_View_List extends Ansel_View_Base 'page' => $this->_page)); } + $tilesperrow = $this->tilesperrow ? $this->tilesperrow : $prefs->getValue('tilesperrow'); // Get top-level / default gallery style. if (empty($this->_params['style'])) { $style = Ansel::getStyleDefinition($prefs->getValue('default_gallerystyle')); @@ -242,7 +243,7 @@ class Ansel_View_List extends Ansel_View_Base $style = Ansel::getStyleDefinition($this->_params['style']); } $count = 0; - $width = round(100 / ($this->tilesperrow ? $this->tilesperrow : $prefs->getValue('tilesperrow'))); + $width = round(100 / $tilesperrow); Horde::startBuffer(); include ANSEL_TEMPLATES . '/view/list.inc'; diff --git a/ansel/templates/view/list.inc b/ansel/templates/view/list.inc index 14abb6812..746e3492b 100644 --- a/ansel/templates/view/list.inc +++ b/ansel/templates/view/list.inc @@ -39,18 +39,16 @@ getValue('tilesperrow'); $cellwidth = round(100 / $tilesperrow); $count = 0; foreach ($this->_galleryList as $galleryId => $gallery) { echo ''; - if (!(++$count % $prefs->getValue('tilesperrow'))) { + if (!(++$count % $tilesperrow)) { if ($count < $this->_numGalleries) { echo ''; } } } - $tilesperrow = $prefs->getValue('tilesperrow'); while ($count++ % $tilesperrow) { echo ''; } ?>
' . $gallery->getTile(null, $style, false, $this->_params) . '