modules/doc: Fix toc links

The DocParser generates toc links with a hard-coded URL. This should
be changed to be generated from a route. But we did not decide how
to handle route overrides yet.

refs #4820
This commit is contained in:
Eric Lippmann 2014-05-23 14:22:35 +02:00
parent 1d5c4c5055
commit 5923622fb8
1 changed files with 4 additions and 5 deletions

View File

@ -104,14 +104,13 @@ class DocParser
$item = end($toc)->item->addChild(
$id,
array(
// TODO(el): URL should be generated from a route else we always have to adapt the
// URL here when we change URLs
'url' => Url::fromPath(
'doc/module/view',
array(
'name' => $this->module
)
$this->module === null ? 'doc/icingaweb' : 'doc/module/' . $this->module
)->setAnchor($id)->getRelativeUrl(),
'title' => htmlspecialchars($header),
'priority' => $itemPriority++,
'priority' => $itemPriority++, // Post-increment is on purpose
'attribs' => $attribs
)
);