From 844a0422d8b2a064ea11deed013090ab7b7663e4 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 22 Sep 2010 17:16:29 -0400 Subject: [PATCH] use the tilesperrow/page value if it exists --- ansel/lib/View/List.php | 5 +++-- ansel/templates/view/list.inc | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) 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 ''; } ?> -- 2.11.0
' . $gallery->getTile(null, $style, false, $this->_params) . '