/**
  * @param \ACP3\Core\Breadcrumb\Title $title
  */
 private function addPageTitlePostfix(Title $title)
 {
     if ($this->request->getModule() !== 'acp') {
         if (!empty($title->getPageTitlePostfix())) {
             $title->setPageTitlePostfix($title->getPageTitlePostfix() . $title->getPageTitleSeparator() . $this->translator->t('acp', 'acp'));
         } else {
             $title->setPageTitlePostfix($this->translator->t('acp', 'acp'));
         }
     }
 }
Exemplo n.º 2
0
 /**
  * @return void
  */
 protected function setMetaStatements()
 {
     if ($this->currentPage > 1) {
         $postfix = $this->translator->t('system', 'page_x', ['%page%' => $this->currentPage]);
         $this->title->setPageTitlePostfix($postfix);
     }
 }
Exemplo n.º 3
0
 /**
  * Generates the table of contents
  *
  * @param array   $pages
  * @param string  $baseUrlPath
  * @param boolean $titlesFromDb
  * @param boolean $customUris
  *
  * @return string
  */
 public function generateTOC(array $pages, $baseUrlPath = '', $titlesFromDb = false, $customUris = false)
 {
     if (!empty($pages)) {
         $baseUrlPath = $baseUrlPath === '' ? $this->request->getUriWithoutPages() : $baseUrlPath;
         $toc = [];
         $i = 0;
         foreach ($pages as $page) {
             $pageNumber = $i + 1;
             $toc[$i]['title'] = $this->fetchTocPageTitle($page, $pageNumber, $titlesFromDb);
             $toc[$i]['uri'] = $this->fetchTocPageUri($customUris, $page, $pageNumber, $baseUrlPath);
             $toc[$i]['selected'] = $this->isCurrentPage($customUris, $page, $pageNumber, $i);
             if ($toc[$i]['selected'] === true) {
                 $this->title->setPageTitlePostfix($toc[$i]['title']);
             }
             ++$i;
         }
         $this->view->assign('toc', $toc);
         return $this->view->fetchTemplate('System/Partials/toc.tpl');
     }
     return '';
 }