TYPO3 CMS  TYPO3_6-2
PageInfoViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 use \TYPO3\CMS\Backend\Utility\BackendUtility;
5 use \TYPO3\CMS\Backend\Utility\IconUtility;
6 
7 /* *
8  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
9  * *
10  * It is free software; you can redistribute it and/or modify it under *
11  * the terms of the GNU Lesser General Public License, either version 3 *
12  * of the License, or (at your option) any later version. *
13  * *
14  * *
15  * This script is distributed in the hope that it will be useful, but *
16  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
17  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
18  * General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU Lesser General Public *
21  * License along with the script. *
22  * If not, see http://www.gnu.org/licenses/lgpl.html *
23  * *
24  * The TYPO3 project - inspiring people to share! *
25  * */
40 
47  public function render() {
48  $doc = $this->getDocInstance();
50  $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
51  // Add icon with clickmenu, etc:
52  if ($pageRecord['uid']) {
53  // If there IS a real page
54  $alttext = BackendUtility::getRecordIconAltText($pageRecord, 'pages');
55  $iconImg = IconUtility::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
56  // Make Icon:
57  $theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
58  } else {
59  // On root-level of page tree
60  // Make Icon
61  $iconImg = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
62  if ($GLOBALS['BE_USER']->user['admin']) {
63  $theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
64  } else {
65  $theIcon = $iconImg;
66  }
67  }
68  // Setting icon with clickmenu + uid
69  $pageInfo = $theIcon . '<em>[pid: ' . $pageRecord['uid'] . ']</em>';
70  return $pageInfo;
71  }
72 }
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static readPageAccess($id, $perms_clause)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getRecordIconAltText($row, $table='pages')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]