From ca8dbdb9386e8a23ae246eac3f532039c31dd31c Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 9 Dec 2014 12:50:29 +0100 Subject: [PATCH] doc: Make path to Icinga Web 2's doc configureable refs #7196 --- .../controllers/IcingawebController.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/doc/application/controllers/IcingawebController.php b/modules/doc/application/controllers/IcingawebController.php index 5740f50a9..d052d8268 100644 --- a/modules/doc/application/controllers/IcingawebController.php +++ b/modules/doc/application/controllers/IcingawebController.php @@ -8,12 +8,20 @@ use Icinga\Module\Doc\DocController; class Doc_IcingawebController extends DocController { + /** + * Get the path to Icinga Web 2's documentation + */ + protected function getDocPath() + { + return $this->Config()->get('documentation', 'path', Icinga::app()->getBaseDir('doc')); + } + /** * View the toc of Icinga Web 2's documentation */ public function tocAction() { - return $this->renderToc(Icinga::app()->getApplicationDir('/../doc'), 'Icinga Web 2', 'doc/icingaweb/chapter'); + return $this->renderToc($this->getDocPath(), 'Icinga Web 2', 'doc/icingaweb/chapter'); } /** @@ -31,7 +39,7 @@ class Doc_IcingawebController extends DocController ); } return $this->renderChapter( - Icinga::app()->getApplicationDir('/../doc'), + $this->getDocPath(), $chapterId, 'doc/icingaweb/toc', 'doc/icingaweb/chapter' @@ -43,6 +51,6 @@ class Doc_IcingawebController extends DocController */ public function pdfAction() { - return $this->renderPdf(Icinga::app()->getApplicationDir('/../doc'), 'Icinga Web 2', 'doc/icingaweb/chapter'); + return $this->renderPdf($this->getDocPath(), 'Icinga Web 2', 'doc/icingaweb/chapter'); } }