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): ?> <?php if ($docHtml === null): ?>
<p>No documentation available.</p> <p>Documentation not available.</p>
<?php else: ?> <?php else: ?>
<div class="toc"> <div class="toc">
<?= $this->partial( <?= $this->partial(
'layout/menu.phtml', 'layout/menu.phtml',
'default', 'default',
array( array(
'items' => $docToc->getChildren(), 'items' => $docToc->getChildren(),
'sub' => false, 'sub' => false,
'url' => '' 'url' => ''
) )
); );
?> ?>
</div> </div>
<div class="doc"> <div class="doc">
<?= $docHtml ?> <?= $docHtml ?>
</div> </div>
<?php endif ?> <?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 * @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); $parser = new DocParser($module);
list($docHtml, $docToc) = $parser->getDocAndToc(); list($docHtml, $docToc) = $parser->getDocAndToc();
$this->view->docHtml = $docHtml; $this->view->docHtml = $docHtml;
$this->view->docToc = $docToc; $this->view->docToc = $docToc;
$this->view->docName = $module === null ? 'Icinga Web 2' : ucfirst($module);
$this->_helper->viewRenderer('partials/docandtoc', null, true);
} }
} }