mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
Add proper titles to the documentation tocs and search results
refs #8458
This commit is contained in:
parent
676f10bb87
commit
a1e7cd8906
@ -107,11 +107,30 @@ class DocSearchRenderer extends DocRenderer
|
|||||||
);
|
);
|
||||||
/** @type \Icinga\Web\Url $url */
|
/** @type \Icinga\Web\Url $url */
|
||||||
$url->setAnchor($this->encodeAnchor($section->getId()));
|
$url->setAnchor($this->encodeAnchor($section->getId()));
|
||||||
$this->content[] = sprintf(
|
$urlAttributes = array(
|
||||||
'<li><a data-base-target="_next" %shref="%s">%s</a>',
|
'data-base-target' => '_next',
|
||||||
$section->getNoFollow() ? 'rel="nofollow" ' : '',
|
'title' => sprintf(
|
||||||
|
$this->getView()->translate(
|
||||||
|
'Show all matches of "%s" in %sthe chapter "%s"',
|
||||||
|
'search.render.section.link'
|
||||||
|
),
|
||||||
|
$this->getInnerIterator()->getSearch()->getInput(),
|
||||||
|
$section->getId() !== $section->getChapter()->getId() ? sprintf(
|
||||||
|
$this->getView()->translate('the section "%s" of ', 'search.render.section.link'),
|
||||||
|
$section->getTitle()
|
||||||
|
) : '',
|
||||||
|
$section->getChapter()->getTitle()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if ($section->getNoFollow()) {
|
||||||
|
$urlAttributes['rel'] = 'nofollow';
|
||||||
|
}
|
||||||
|
$this->content[] = '<li>' . $this->getView()->qlink(
|
||||||
|
$title,
|
||||||
$url->getAbsoluteUrl(),
|
$url->getAbsoluteUrl(),
|
||||||
$title
|
null,
|
||||||
|
$urlAttributes,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
if (! empty($contentMatches)) {
|
if (! empty($contentMatches)) {
|
||||||
$this->content = array_merge($this->content, $contentMatches);
|
$this->content = array_merge($this->content, $contentMatches);
|
||||||
|
@ -87,11 +87,25 @@ class DocTocRenderer extends DocRenderer
|
|||||||
$url = $view->url($path);
|
$url = $view->url($path);
|
||||||
/** @type \Icinga\Web\Url $url */
|
/** @type \Icinga\Web\Url $url */
|
||||||
$url->setAnchor($this->encodeAnchor($section->getId()));
|
$url->setAnchor($this->encodeAnchor($section->getId()));
|
||||||
$this->content[] = sprintf(
|
$urlAttributes = array(
|
||||||
'<li><a data-base-target="_next" %shref="%s">%s</a>',
|
'data-base-target' => '_next',
|
||||||
$section->getNoFollow() ? 'rel="nofollow" ' : '',
|
'title' => sprintf(
|
||||||
|
$this->getView()->translate('Show the %schapter "%s"', 'toc.render.section.link'),
|
||||||
|
$section->getId() !== $section->getChapter()->getId() ? sprintf(
|
||||||
|
$this->getView()->translate('section "%s" of the ', 'toc.render.section.link'),
|
||||||
|
$section->getTitle()
|
||||||
|
) : '',
|
||||||
|
$section->getChapter()->getTitle()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if ($section->getNoFollow()) {
|
||||||
|
$urlAttributes['rel'] = 'nofollow';
|
||||||
|
}
|
||||||
|
$this->content[] = '<li>' . $this->getView()->qlink(
|
||||||
|
$section->getTitle(),
|
||||||
$url->getAbsoluteUrl(),
|
$url->getAbsoluteUrl(),
|
||||||
$view->escape($section->getTitle())
|
null,
|
||||||
|
$urlAttributes
|
||||||
);
|
);
|
||||||
if (! $section->hasChildren()) {
|
if (! $section->hasChildren()) {
|
||||||
$this->content[] = '</li>';
|
$this->content[] = '</li>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user