Doc: make PDF export action reachable

refs #1716
This commit is contained in:
Alexander A. Klimov 2018-01-26 12:12:27 +01:00
parent f2f9ab5bc0
commit 7a444df040

View File

@ -7,6 +7,7 @@ use Icinga\Module\Doc\Renderer\DocSectionRenderer;
use Icinga\Module\Doc\Renderer\DocTocRenderer; use Icinga\Module\Doc\Renderer\DocTocRenderer;
use Icinga\Web\Controller; use Icinga\Web\Controller;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Web\Widget\Tabextension\OutputFormat;
class DocController extends Controller class DocController extends Controller
{ {
@ -52,11 +53,13 @@ class DocController extends Controller
} }
$title = $first === null ? ucfirst($chapter) : $first->getTitle(); $title = $first === null ? ucfirst($chapter) : $first->getTitle();
$this->view->title = $title; $this->view->title = $title;
$this->getTabs()->add('toc', array( $this->getTabs()
'active' => true, ->add('toc', array(
'title' => $title, 'active' => true,
'url' => Url::fromRequest() 'title' => $title,
)); 'url' => Url::fromRequest()
))
->extend(new OutputFormat(array(OutputFormat::TYPE_CSV, OutputFormat::TYPE_JSON)));
$this->render('chapter', null, true); $this->render('chapter', null, true);
} }
@ -77,11 +80,13 @@ class DocController extends Controller
->setUrlParams($urlParams); ->setUrlParams($urlParams);
$name = ucfirst($name); $name = ucfirst($name);
$title = sprintf($this->translate('%s Documentation'), $name); $title = sprintf($this->translate('%s Documentation'), $name);
$this->getTabs()->add('toc', array( $this->getTabs()
'active' => true, ->add('toc', array(
'title' => $title, 'active' => true,
'url' => Url::fromRequest() 'title' => $title,
)); 'url' => Url::fromRequest()
))
->extend(new OutputFormat(array(OutputFormat::TYPE_CSV, OutputFormat::TYPE_JSON)));
$this->render('toc', null, true); $this->render('toc', null, true);
} }