From dad7dc9e6ca0c9d2028a8b9d799a8ff8cf5fa0e4 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 27 May 2014 15:06:48 +0200 Subject: [PATCH] Doc: Rename `DocController::renderDocAndToc()' to `renderChapter()' Prepare that every chapter is displayed on a new page. refs #4820 --- modules/doc/library/Doc/DocController.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/doc/library/Doc/DocController.php b/modules/doc/library/Doc/DocController.php index 967f7f070..0929eac4e 100644 --- a/modules/doc/library/Doc/DocController.php +++ b/modules/doc/library/Doc/DocController.php @@ -9,25 +9,24 @@ use Icinga\Web\Controller\ActionController; class DocController extends ActionController { /** - * Publish doc HTML and toc to the view + * Render a chapter * - * @param string $module Name of the module for which to populate doc and toc. `null` for Icinga Web 2's doc + * @param string $chapterName Name of the chapter + * @param string $path Path to the documentation */ - protected function renderDocAndToc($module = null) + protected function renderChapter($chapterName, $path) { - $parser = new DocParser($module); + $parser = new DocParser($path); list($docHtml, $docToc) = $parser->getDocAndToc(); - $this->view->docHtml = $docHtml; - $this->view->docToc = $docToc; - $this->view->docName = $module === null ? 'Icinga Web 2' : ucfirst($module); - $this->_helper->viewRenderer('partials/docandtoc', null, true); + $this->view->chapterHtml = $docHtml; + $this->_helper->viewRenderer('partials/chapter', null, true); } /** * Render a toc * * @param string $path Path to the documentation - * @param string + * @param string $name Name of the documentation */ protected function renderToc($path, $name) {