TYPO3 CMS  TYPO3_8-7
PagePathViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
20 
35 {
36 
42  protected $escapeOutput = false;
43 
50  public function render()
51  {
52  return static::renderStatic(
53  [],
54  $this->buildRenderChildrenClosure(),
55  $this->renderingContext
56  );
57  }
58 
66  public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
67  {
68  $id = GeneralUtility::_GP('id');
69  $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
70  // Is this a real page
71  if ($pageRecord['uid']) {
72  $title = $pageRecord['_thePathFull'];
73  } else {
74  $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
75  }
76  // Setting the path of the page
77  $pagePath = htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.path')) . ': <span class="typo3-docheader-pagePath">';
78  // crop the title to title limit (or 50, if not defined)
79  $cropLength = empty($GLOBALS['BE_USER']->uc['titleLen']) ? 50 : $GLOBALS['BE_USER']->uc['titleLen'];
80  $croppedTitle = GeneralUtility::fixed_lgd_cs($title, -$cropLength);
81  if ($croppedTitle !== $title) {
82  $pagePath .= '<abbr title="' . htmlspecialchars($title) . '">' . htmlspecialchars($croppedTitle) . '</abbr>';
83  } else {
84  $pagePath .= htmlspecialchars($title);
85  }
86  $pagePath .= '</span>';
87  return $pagePath;
88  }
89 }
static readPageAccess($id, $perms_clause)
static renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
static fixed_lgd_cs($string, $chars, $appendString='...')
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']