From 72ab5027b5afc998b9aea89fdbcbed69a56cdfe8 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 28 May 2014 17:18:57 +0200 Subject: [PATCH] doc: Add view script for the toc of Icinga Web 2's doc refs #4820 --- .../controllers/IcingawebController.php | 2 +- .../application/views/scripts/icingaweb/toc.phtml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 modules/doc/application/views/scripts/icingaweb/toc.phtml diff --git a/modules/doc/application/controllers/IcingawebController.php b/modules/doc/application/controllers/IcingawebController.php index 5ddc4d323..0820a82ca 100644 --- a/modules/doc/application/controllers/IcingawebController.php +++ b/modules/doc/application/controllers/IcingawebController.php @@ -13,7 +13,7 @@ class Doc_IcingawebController extends DocController */ public function tocAction() { - $this->renderToc(Icinga::app()->getApplicationDir('/../doc'), 'Icinga Web 2'); + $this->populateToc(Icinga::app()->getApplicationDir('/../doc'), 'Icinga Web 2'); } /** diff --git a/modules/doc/application/views/scripts/icingaweb/toc.phtml b/modules/doc/application/views/scripts/icingaweb/toc.phtml new file mode 100644 index 000000000..065071f01 --- /dev/null +++ b/modules/doc/application/views/scripts/icingaweb/toc.phtml @@ -0,0 +1,15 @@ +
+

documentation

+
+
+ getHelper('Url'); + $view = $this; + ?> + render(function ($section) use ($urlHelper, $view) { + // Chapter name is not yet defined + $path = $urlHelper->url(array('chapterName' => 'tbd'), 'doc/icingaweb/chapter', false, false); + $url = $view->url($path)->setAnchor($section->id); + return sprintf('
  • %s
  • ', $url->getAbsoluteUrl(), $section->title); + }); ?> +