} 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.
'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'));
$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';
<table width="<?php echo ($this->countWidgets() ? 73 : 100) ?>%" style="background-color:<?php echo $style->background ?>;">
<tr>
<?php
- $tilesperrow = $prefs->getValue('tilesperrow');
$cellwidth = round(100 / $tilesperrow);
$count = 0;
foreach ($this->_galleryList as $galleryId => $gallery) {
echo '<td width="' . $width . '%" class="ansel-tile">' . $gallery->getTile(null, $style, false, $this->_params) . '</td>';
- if (!(++$count % $prefs->getValue('tilesperrow'))) {
+ if (!(++$count % $tilesperrow)) {
if ($count < $this->_numGalleries) {
echo '</tr><tr>';
}
}
}
- $tilesperrow = $prefs->getValue('tilesperrow');
while ($count++ % $tilesperrow) {
echo '<td width="' . $width . '%"> </td>';
} ?>