lib: Fix navigation usage in the limiter widget

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-27 13:22:43 +02:00
parent d79a160547
commit a9f0aa6bcd
1 changed files with 2 additions and 4 deletions

View File

@ -80,7 +80,7 @@ class Limiter extends AbstractWidget
$navigation = new Navigation();
$navigation->setLayout(Navigation::LAYOUT_TABS);
foreach (static::$limits as $limit => $label) {
$navigationItem = new NavigationItem();
$navigationItem = new NavigationItem($limit);
$navigationItem
->setActive($activeLimit === $limit)
->setAttribute(
@ -90,17 +90,15 @@ class Limiter extends AbstractWidget
$limit
)
)
->setId($limit)
->setLabel($label)
->setUrl($url->with(array('limit' => $limit)));
$navigation->addItem($navigationItem);
}
if ($activeLimit === 0) {
$navigationItem = new NavigationItem();
$navigationItem = new NavigationItem(0);
$navigationItem
->setActive(true)
->setAttribute('title', t('Show all items on this page'))
->setId(0)
->setLabel(t('all'));
$navigation->addItem($navigationItem);
}