TYPO3 CMS  TYPO3_6-2
BrowseTreeView.php
Go to the documentation of this file.
1 <?php
3 
18 
26 
36  public function init($clause = '', $orderByFields = '') {
37  // This will hide records from display - it has nothing todo with user rights!!
38  $clauseExcludePidList = '';
39  if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
40  if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
41  $clauseExcludePidList = ' AND pages.uid NOT IN (' . $pidList . ')';
42  }
43  }
44  // This is very important for making trees of pages: Filtering out deleted pages, pages with no access to and sorting them correctly:
45  parent::init(' AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1) . ' ' . $clause . $clauseExcludePidList, 'sorting');
46  $this->table = 'pages';
47  $this->setTreeName('browsePages');
48  $this->domIdPrefix = 'pages';
49  $this->iconName = '';
50  $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
51  $this->MOUNTS = $GLOBALS['WEBMOUNTS'];
52  if ($pidList) {
53  // Remove mountpoint if explicitly set in options.hideRecords.pages (see above)
54  $hideList = explode(',', $pidList);
55  $this->MOUNTS = array_diff($this->MOUNTS, $hideList);
56  }
57  $this->fieldArray = array_merge($this->fieldArray, array('doktype', 'php_tree_stop', 't3ver_id', 't3ver_state', 't3ver_wsid', 't3ver_move_id'));
58  $this->fieldArray = array_merge($this->fieldArray, array('hidden', 'starttime', 'endtime', 'fe_group', 'module', 'extendToSubpages', 'is_siteroot', 'nav_hide'));
59  }
60 
69  public function getTitleAttrib($row) {
70  return BackendUtility::titleAttribForPages($row, '1=1 ' . $this->clause, 0);
71  }
72 
82  public function wrapIcon($icon, $row) {
83  // Wrap icon in click-menu link.
84  $theIcon = '';
85  if (!$this->ext_IconMode) {
86  $theIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($icon, $this->treeName, $this->getId($row), 0);
87  } elseif ($this->ext_IconMode === 'titlelink') {
88  $aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row) . '\',this,\'' . $this->domIdPrefix . $this->getId($row) . '\',' . $this->bank . ');';
89  $theIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $icon . '</a>';
90  }
91  return $theIcon;
92  }
93 
103  public function getTitleStr($row, $titleLen = 30) {
104  $title = parent::getTitleStr($row, $titleLen);
105  if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
106  $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain', 'pid=' . $GLOBALS['TYPO3_DB']->quoteStr(($row['uid'] . BackendUtility::deleteClause('sys_domain') . BackendUtility::BEenableFields('sys_domain')), 'sys_domain'), '', 'sorting', 1);
107  if (is_array($rows) && count($rows) > 0) {
108  $title = sprintf('%s [%s]', $title, htmlspecialchars($rows[0]['domainName']));
109  }
110  }
111  return $title;
112  }
113 
123  public function wrapStop($str, $row) {
124  if ($row['php_tree_stop']) {
125  $str .= '<span class="typo3-red">
126  <a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('setTempDBmount' => $row['uid']))) . '" class="typo3-red">+</a>
127  </span>';
128  }
129  return $str;
130  }
131 
132 }
init($clause='', $orderByFields='')
static titleAttribForPages($row, $perms_clause='', $includeAttrib=1)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]