Пример #1
0
 /**
  * Returns the title for the input record. If blank, a "no title" labele (localized) will be returned.
  * '_title' is used for setting an alternative title for folders.
  *
  * @param array $row The input row array (where the key "_title" is used for the title)
  * @param int $titleLen Title length (30)
  * @return string The title
  */
 public function getTitleStr($row, $titleLen = 30)
 {
     return $row['_title'] ?: parent::getTitleStr($row, $titleLen);
 }
Пример #2
0
 /**
  * Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
  * Do NOT htmlspecialchar the string from this function - has already been done.
  *
  * @param array $row The input row array (where the key "title" is used for the title)
  * @param int $titleLen Title length (30)
  * @return string The title.
  */
 public function getTitleStr($row, $titleLen = 30)
 {
     if ($this->ext_showNavTitle && isset($row['nav_title']) && trim($row['nav_title']) !== '') {
         $title = parent::getTitleStr(['title' => $row['nav_title']], $titleLen);
     } else {
         $title = parent::getTitleStr($row, $titleLen);
     }
     if (!empty($row['is_siteroot']) && $this->getBackendUser()->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
         $rows = $this->getDatabaseConnection()->exec_SELECTgetRows('domainName,sorting', 'sys_domain', 'pid=' . $this->getDatabaseConnection()->quoteStr($row['uid'] . BackendUtility::deleteClause('sys_domain') . BackendUtility::BEenableFields('sys_domain'), 'sys_domain'), '', 'sorting', 1);
         if (is_array($rows) && !empty($rows)) {
             $title = sprintf('%s [%s]', $title, htmlspecialchars($rows[0]['domainName']));
         }
     }
     return $title;
 }
Пример #3
0
 /**
  * Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
  * Do NOT htmlspecialchar the string from this function - has already been done.
  *
  * @param array $row The input row array (where the key "title" is used for the title)
  * @param integer $titleLen Title length (30)
  * @return string The title.
  * @todo Define visibility
  */
 public function getTitleStr($row, $titleLen = 30)
 {
     // Get the basic title from the parent implementation in t3lib_treeview
     $title = parent::getTitleStr($row, $titleLen);
     if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
         $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain', 'pid=' . $GLOBALS['TYPO3_DB']->quoteStr($row['uid'] . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_domain') . \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('sys_domain'), 'sys_domain'), '', 'sorting', 1);
         if (is_array($rows) && count($rows) > 0) {
             $title = sprintf('%s [%s]', $title, htmlspecialchars($rows[0]['domainName']));
         }
     }
     return $title;
 }
Пример #4
0
 /**
  * Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
  * Do NOT htmlspecialchar the string from this function - has already been done.
  *
  * @param array $row The input row array (where the key "title" is used for the title)
  * @param int $titleLen Title length (30)
  * @return string The title.
  */
 public function getTitleStr($row, $titleLen = 30)
 {
     if ($this->ext_showNavTitle && isset($row['nav_title']) && trim($row['nav_title']) !== '') {
         $title = parent::getTitleStr(['title' => $row['nav_title']], $titleLen);
     } else {
         $title = parent::getTitleStr($row, $titleLen);
     }
     if (!empty($row['is_siteroot']) && $this->getBackendUser()->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_domain');
         $row = $queryBuilder->select('domainName', 'sorting')->from('sys_domain')->where($queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($row['uid'], \PDO::PARAM_INT)))->orderBy('sorting')->setMaxResults(1)->execute()->fetch();
         if ($row !== false) {
             $title = sprintf('%s [%s]', $title, htmlspecialchars($row['domainName']));
         }
     }
     return $title;
 }