TYPO3 CMS  TYPO3_7-6
PageInfoViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * *
12  * This script is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
14  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
15  * General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Lesser General Public *
18  * License along with the script. *
19  * If not, see http://www.gnu.org/licenses/lgpl.html *
20  * *
21  * The TYPO3 project - inspiring people to share! *
22  * */
23 
30 
45 {
52  public function render()
53  {
54  return static::renderStatic(
55  [],
57  $this->renderingContext
58  );
59  }
60 
69  {
70  $id = GeneralUtility::_GP('id');
71  $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
72  // Add icon with clickmenu, etc:
74  $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
75  if ($pageRecord['uid']) {
76  // If there IS a real page
77  $altText = BackendUtility::getRecordIconAltText($pageRecord, 'pages');
78  $theIcon = '<span title="' . $altText . '">' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>';
79  // Make Icon:
80  $theIcon = BackendUtility::wrapClickMenuOnIcon($theIcon, 'pages', $pageRecord['uid']);
81 
82  // Setting icon with clickmenu + uid
83  $theIcon .= ' <em>[PID: ' . $pageRecord['uid'] . ']</em>';
84  } else {
85  // On root-level of page tree
86  // Make Icon
87  $theIcon = '<span title="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '">' . $iconFactory->getIcon('apps-pagetree-page-domain', Icon::SIZE_SMALL)->render() . '</span>';
88  if ($GLOBALS['BE_USER']->user['admin']) {
89  $theIcon = BackendUtility::wrapClickMenuOnIcon($theIcon, 'pages', 0);
90  }
91  }
92  return $theIcon;
93  }
94 }
static readPageAccess($id, $perms_clause)
static renderStatic(array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
static getRecordIconAltText($row, $table='pages')
static wrapClickMenuOnIcon( $content, $table, $uid=0, $listFrame=true, $addParams='', $enDisItems='', $returnTagParameters=false)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']