TYPO3 CMS  TYPO3_7-6
BrowseTreeView.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 
19 
24 {
28  public $fieldArray = [
29  'uid',
30  'pid',
31  'title',
32  'doktype',
33  'nav_title',
34  'mount_pid',
35  'php_tree_stop',
36  't3ver_id',
37  't3ver_state',
38  'hidden',
39  'starttime',
40  'endtime',
41  'fe_group',
42  'module',
43  'extendToSubpages',
44  'nav_hide',
45  't3ver_wsid',
46  't3ver_move_id',
47  'is_siteroot'
48  ];
49 
54  public $treeName = 'browsePages';
55 
60  public $table = 'pages';
61 
66  public $domIdPrefix = 'pages';
67 
71  public $ext_showNavTitle = false;
72 
81  public function init($clause = '', $orderByFields = '')
82  {
83  // This will hide records from display - it has nothing to do with user rights!!
84  $clauseExcludePidList = '';
85  if ($pidList = $this->getBackendUser()->getTSConfigVal('options.hideRecords.pages')) {
86  if ($pidList = $this->getDatabaseConnection()->cleanIntList($pidList)) {
87  $clauseExcludePidList = ' AND pages.uid NOT IN (' . $pidList . ')';
88  }
89  }
90  // This is very important for making trees of pages: Filtering out deleted pages, pages with no access to and sorting them correctly:
91  parent::init(' AND ' . $this->getBackendUser()->getPagePermsClause(1) . ' ' . $clause . $clauseExcludePidList, 'sorting');
92  $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
93  $this->MOUNTS = $this->getBackendUser()->returnWebmounts();
94  if ($pidList) {
95  // Remove mountpoint if explicitly set in options.hideRecords.pages (see above)
96  $hideList = explode(',', $pidList);
97  $this->MOUNTS = array_diff($this->MOUNTS, $hideList);
98  }
99  }
100 
108  public function getTitleAttrib($row)
109  {
110  return BackendUtility::titleAttribForPages($row, '1=1 ' . $this->clause, 0);
111  }
112 
121  public function wrapIcon($icon, $row)
122  {
123  // Wrap icon in click-menu link.
124  $theIcon = '';
125  if (!$this->ext_IconMode) {
126  $theIcon = BackendUtility::wrapClickMenuOnIcon($icon, $this->treeName, $this->getId($row), 0);
127  } elseif ($this->ext_IconMode === 'titlelink') {
128  $aOnClick = 'return jumpTo(' . GeneralUtility::quoteJSvalue($this->getJumpToParam($row)) . ',this,'
129  . GeneralUtility::quoteJSvalue($this->domIdPrefix . $this->getId($row)) . ',' . $this->bank . ');';
130  $theIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $icon . '</a>';
131  }
132  return $theIcon;
133  }
134 
143  public function getTitleStr($row, $titleLen = 30)
144  {
145  if ($this->ext_showNavTitle && isset($row['nav_title']) && trim($row['nav_title']) !== '') {
146  $title = parent::getTitleStr(['title' => $row['nav_title']], $titleLen);
147  } else {
148  $title = parent::getTitleStr($row, $titleLen);
149  }
150  if (!empty($row['is_siteroot']) && $this->getBackendUser()->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
151  $rows = $this->getDatabaseConnection()->exec_SELECTgetRows(
152  'domainName,sorting',
153  'sys_domain',
154  'pid=' . $this->getDatabaseConnection()->quoteStr(
155  $row['uid'] . BackendUtility::deleteClause('sys_domain') . BackendUtility::BEenableFields('sys_domain'),
156  'sys_domain'
157  ),
158  '',
159  'sorting',
160  1);
161  if (is_array($rows) && !empty($rows)) {
162  $title = sprintf('%s [%s]', $title, htmlspecialchars($rows[0]['domainName']));
163  }
164  }
165  return $title;
166  }
167 }
static BEenableFields($table, $inv=false)
init($clause='', $orderByFields='')
static titleAttribForPages($row, $perms_clause='', $includeAttrib=true)
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']
static deleteClause($table, $tableAlias='')