示例#1
0
 /**
  * @return string
  */
 public function getDetails()
 {
     if ($this->details === null) {
         $pageTitle = $this->stringFormatter->makeStringUrlSafe($this->title->getPageTitle());
         $this->details = $this->request->getModule() . '-' . $this->request->getController() . '-' . $pageTitle;
     }
     return $this->details;
 }
示例#2
0
文件: Pagination.php 项目: acp3/core
 /**
  * @return void
  */
 protected function setMetaStatements()
 {
     if ($this->currentPage > 1) {
         $postfix = $this->translator->t('system', 'page_x', ['%page%' => $this->currentPage]);
         $this->title->setPageTitlePostfix($postfix);
     }
 }
示例#3
0
 /**
  * Title constructor.
  * @param Steps $steps
  * @param EventDispatcherInterface $eventDispatcher
  * @param SettingsInterface $config
  */
 public function __construct(Steps $steps, EventDispatcherInterface $eventDispatcher, SettingsInterface $config)
 {
     parent::__construct($steps, $eventDispatcher);
     $settings = $config->getSettings(Schema::MODULE_NAME);
     if (isset($settings['site_title'])) {
         $this->siteTitle = $settings['site_title'];
     }
 }
示例#4
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 '';
 }
 /**
  * @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'));
         }
     }
 }
示例#6
0
文件: SiteTitle.php 项目: acp3/core
 /**
  * @param array                     $params
  * @param \Smarty_Internal_Template $smarty
  *
  * @return string
  */
 public function process(array $params, \Smarty_Internal_Template $smarty)
 {
     return $this->title->getSiteTitle();
 }