From 5923622fb8b80089fbc00189da4be84ebf8b4db4 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 23 May 2014 14:22:35 +0200 Subject: [PATCH] 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 --- modules/doc/library/Doc/DocParser.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/doc/library/Doc/DocParser.php b/modules/doc/library/Doc/DocParser.php index 39f8c8718..04086469b 100644 --- a/modules/doc/library/Doc/DocParser.php +++ b/modules/doc/library/Doc/DocParser.php @@ -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 ) );