NavigationRenderer: Do not render an empty header

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-07 13:25:25 +02:00
parent f9441c91d5
commit 6b13f2a987

View File

@ -244,11 +244,13 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
$this->getElementTag(), $this->getElementTag(),
$this->getCssClass() !== null ? ' class="' . $this->getCssClass() . '"' : '' $this->getCssClass() !== null ? ' class="' . $this->getCssClass() . '"' : ''
); );
if (($heading = $this->getHeading()) !== null) {
$content[] = sprintf( $content[] = sprintf(
'<h%1$d id="navigation" class="sr-only" tabindex="-1">%2$s</h%1$d>', '<h%1$d id="navigation" class="sr-only" tabindex="-1">%2$s</h%1$d>',
static::HEADING_RANK, static::HEADING_RANK,
$this->view()->escape($this->getHeading()) $this->view()->escape($heading)
); );
}
$content[] = $this->beginChildrenMarkup(); $content[] = $this->beginChildrenMarkup();
return join("\n", $content); return join("\n", $content);
} }