list/limits: special treatment for 0 only, not null

This commit is contained in:
Thomas Gelf 2014-06-26 00:39:10 +02:00
parent 7112ed23f4
commit c85a0ac11e
2 changed files with 7 additions and 7 deletions

View File

@ -175,11 +175,11 @@ class Monitoring_ListController extends Controller
));
$limit = $this->params->get('limit');
$this->view->limit = $limit;
if ($limit) {
// TODO: Workaround, paginate should be able to fetch limit from new params
$this->view->services = $query->paginate($this->params->get('limit'));
} else {
if ($limit === 0) {
$this->view->services = $query->getQuery()->fetchAll();
} else {
// TODO: Workaround, paginate should be able to fetch limit from new params
$this->view->services = $query->paginate($limit);
}
}

View File

@ -10,11 +10,11 @@ if (!$this->compact): ?>
<?= $this->filterPreview ?>
<?php endif ?>
</div>
<?php if ($this->limit): ?>
<?php if ($this->limit === 0): ?>
<?= $this->widget('limiter') ?>
<?php else: ?>
<?= $this->widget('limiter')->setCurrentPageCount($this->services->count()) ?>
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)) ?>
<?php else: ?>
<?= $this->widget('limiter') ?>
<?php endif ?>
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/service?' . $this->filter->toQueryString())) ?>
</div>