nav: Give item renderer a chance to set the CSS class of the outer li element
refs #5543
This commit is contained in:
parent
4593c78d16
commit
8341415d28
|
@ -352,8 +352,9 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
|
||||||
foreach ($this as $item) {
|
foreach ($this as $item) {
|
||||||
/** @var NavigationItem $item */
|
/** @var NavigationItem $item */
|
||||||
if ($item->shouldRender()) {
|
if ($item->shouldRender()) {
|
||||||
|
$content = $item->render();
|
||||||
$this->content[] = $this->beginItemMarkup($item);
|
$this->content[] = $this->beginItemMarkup($item);
|
||||||
$this->content[] = $item->render();
|
$this->content[] = $content;
|
||||||
$this->content[] = $this->endItemMarkup();
|
$this->content[] = $this->endItemMarkup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,14 +162,15 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
|
||||||
foreach ($this as $item) {
|
foreach ($this as $item) {
|
||||||
/** @var NavigationItem $item */
|
/** @var NavigationItem $item */
|
||||||
if ($item->shouldRender()) {
|
if ($item->shouldRender()) {
|
||||||
$this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
|
|
||||||
|
|
||||||
if ($this->getUseStandardItemRenderer()) {
|
if ($this->getUseStandardItemRenderer()) {
|
||||||
$renderer = new NavigationItemRenderer();
|
$renderer = new NavigationItemRenderer();
|
||||||
$this->content[] = $renderer->render($item);
|
$content = $renderer->render($item);
|
||||||
} else {
|
} else {
|
||||||
$this->content[] = $item->render();
|
$content = $item->render();
|
||||||
}
|
}
|
||||||
|
$this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
|
||||||
|
|
||||||
|
$this->content[] = $content;
|
||||||
|
|
||||||
if (! $item->hasChildren()) {
|
if (! $item->hasChildren()) {
|
||||||
$this->content[] = $this->getInnerIterator()->endItemMarkup();
|
$this->content[] = $this->getInnerIterator()->endItemMarkup();
|
||||||
|
|
Loading…
Reference in New Issue