modules/doc: Rename populateView() to renderDocAndToc()

Rename populateView() to renderDocAndToc() since the method now sets the viewHelper
to docandtoc.phtml

refs #4820
This commit is contained in:
Eric Lippmann 2014-05-23 14:04:36 +02:00
parent 99971e241c
commit 74ea4d19b8
2 changed files with 20 additions and 17 deletions

View File

@ -1,19 +1,20 @@
<h1><?= $docName ?> documentation</h1>
<?php if ($docHtml === null): ?>
<p>No documentation available.</p>
<p>Documentation not available.</p>
<?php else: ?>
<div class="toc">
<?= $this->partial(
'layout/menu.phtml',
'default',
array(
'items' => $docToc->getChildren(),
'sub' => false,
'url' => ''
)
);
?>
</div>
<div class="doc">
<?= $docHtml ?>
</div>
<div class="toc">
<?= $this->partial(
'layout/menu.phtml',
'default',
array(
'items' => $docToc->getChildren(),
'sub' => false,
'url' => ''
)
);
?>
</div>
<div class="doc">
<?= $docHtml ?>
</div>
<?php endif ?>

View File

@ -13,11 +13,13 @@ class Controller extends ActionController
*
* @param string $module Name of the module for which to populate doc and toc. `null` for Icinga Web 2's doc
*/
protected function populateView($module = null)
protected function renderDocAndToc($module = null)
{
$parser = new DocParser($module);
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);
}
}