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