Doc: Add tabs

This commit is contained in:
Eric Lippmann 2016-01-05 16:52:11 +01:00
parent 313a02d9f0
commit 85c477e577

View File

@ -6,6 +6,7 @@ namespace Icinga\Module\Doc;
use Icinga\Module\Doc\Renderer\DocSectionRenderer; 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;
class DocController extends Controller class DocController extends Controller
{ {
@ -41,6 +42,11 @@ class DocController extends Controller
->setUrlParams($urlParams) ->setUrlParams($urlParams)
->setHighlightSearch($this->params->get('highlight-search')); ->setHighlightSearch($this->params->get('highlight-search'));
$this->view->title = $chapter; $this->view->title = $chapter;
$this->getTabs()->add('toc', array(
'active' => true,
'title' => ucfirst($chapter),
'url' => Url::fromRequest()
));
$this->render('chapter', null, true); $this->render('chapter', null, true);
} }
@ -61,6 +67,11 @@ class DocController extends Controller
->setUrlParams($urlParams); ->setUrlParams($urlParams);
$name = ucfirst($name); $name = ucfirst($name);
$this->view->title = sprintf($this->translate('%s Documentation'), $name); $this->view->title = sprintf($this->translate('%s Documentation'), $name);
$this->getTabs()->add('toc', array(
'active' => true,
'title' => $name,
'url' => Url::fromRequest()
));
$this->render('toc', null, true); $this->render('toc', null, true);
} }