doc: set page title

refs #4820
This commit is contained in:
Eric Lippmann 2014-08-19 13:38:18 +02:00
parent d35e0816c9
commit 55b3a5384a
4 changed files with 22 additions and 8 deletions

View File

@ -1,5 +1,5 @@
<div class="controls">
<h1><?= $this->translate(sprintf('%s Documentation', ucfirst($docName))); ?></h1>
<h1><?= $title ?></h1>
</div>
<div class="content toc">
<?= $tocRenderer->render($this, $this->getHelper('Url')); ?>

View File

@ -27,6 +27,7 @@ class DocController extends ModuleActionController
$url,
$urlParams
);
$this->view->title = $chapterId;
$this->_helper->viewRenderer('chapter', null, true);
}
@ -42,7 +43,9 @@ class DocController extends ModuleActionController
{
$parser = new DocParser($path);
$this->view->tocRenderer = new TocRenderer($parser->getDocTree(), $url, $urlParams);
$name = ucfirst($name);
$this->view->docName = $name;
$this->view->title = $this->translate(sprintf('%s Documentation', $name));
$this->_helper->viewRenderer('toc', null, true);
}

View File

@ -222,7 +222,7 @@ class SectionRenderer extends Renderer
if ($renderNavigation) {
foreach ($this->docTree as $chapter) {
if ($chapter->getValue()->getId() === $section->getChapterId()) {
$content[] = '<ul class="navigation">';
$navigation = array('<ul class="navigation">');
$this->docTree->prev();
$prev = $this->docTree->current();
if ($prev !== null) {
@ -240,8 +240,8 @@ class SectionRenderer extends Renderer
);
$url = $view->url($path);
$url->setAnchor($this->encodeAnchor($prev->getId()));
$content[] = sprintf(
'<li><a %shref="%s">%s</a></li>',
$navigation[] = sprintf(
'<li class="prev"><a %shref="%s">%s</a></li>',
$prev->isNoFollow() ? 'rel="nofollow" ' : '',
$url->getAbsoluteUrl(),
$view->escape($prev->getTitle())
@ -253,7 +253,7 @@ class SectionRenderer extends Renderer
$this->docTree->next();
}
$url = $view->url($this->tocUrl);
$content[] = sprintf(
$navigation[] = sprintf(
'<li><a href="%s">%s</a></li>',
$url->getAbsoluteUrl(),
mt('doc', 'Index')
@ -274,14 +274,15 @@ class SectionRenderer extends Renderer
);
$url = $view->url($path);
$url->setAnchor($this->encodeAnchor($next->getId()));
$content[] = sprintf(
'<li><a %shref="%s">%s</a></li>',
$navigation[] = sprintf(
'<li class="next"><a %shref="%s">%s</a></li>',
$next->isNoFollow() ? 'rel="nofollow" ' : '',
$url->getAbsoluteUrl(),
$view->escape($next->getTitle())
);
}
$content[] = '</ul>';
$navigation[] = '</ul>';
$content = array_merge($navigation, $content, $navigation);
break;
}
}

View File

@ -48,5 +48,15 @@ div.chapter > ul.navigation {
color: #fff;
text-decoration: none;
}
&.prev {
padding-right: 0.6em;
border-right: 2px solid #fff;
}
&.next {
padding-left: 0.6em;
border-left: 2px solid #fff;
}
}
}