url = $url;
$this->urlParams = array_map(array($this, 'encodeUrlParam'), $urlParams);
}
public function beginIteration()
{
$this->content[] = '';
}
public function beginChildren()
{
$this->content[] = '
';
}
public function endChildren()
{
$this->content[] = '
';
}
/**
* Render the toc
*
* @param View $view
* @param Zend_View_Helper_Url $zendUrlHelper
*
* @return string
*/
public function render(View $view, Zend_View_Helper_Url $zendUrlHelper)
{
foreach ($this as $node) {
$section = $node->getValue();
/* @var $section \Icinga\Module\Doc\Section */
$path = $zendUrlHelper->url(
array_merge(
$this->urlParams,
array(
'chapterTitle' => $this->encodeUrlParam($section->getChapterTitle())
)
),
$this->url,
false,
false
);
$url = $view->url($path);
$url->setAnchor($this->encodeAnchor($section->getId()));
$this->content[] = sprintf(
'%s',
$section->isNofollow() ? 'rel="nofollow" ' : '',
$url->getAbsoluteUrl(),
$view->escape($section->getTitle())
);
if (! $this->getInnerIterator()->current()->hasChildren()) {
$this->content[] = '';
}
}
return implode("\n", $this->content);
}
}