71 public function wrapIcon($thePageIcon, &$row) {
75 $lockIcon =
'<a href="#" onclick="' . htmlspecialchars($aOnClick) .
'">' .
IconUtility::getSpriteIcon(
'status-warning-in-use', array(
'title' => $lockInfo[
'msg'])) .
'</a>';
80 if (!$this->ext_IconMode) {
81 $thePageIcon =
$GLOBALS[
'TBE_TEMPLATE']->wrapClickMenuOnIcon($thePageIcon,
'pages', $row[
'uid'], 0,
'&bank=' . $this->bank);
82 } elseif ($this->ext_IconMode ===
'titlelink') {
83 $aOnClick =
'return jumpTo(\'' . $this->
getJumpToParam($row) .
'\',
this,\
'' . $this->treeName .
'\');
'; 84 $thePageIcon = '<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '">
' . $thePageIcon . '</a>
'; 86 // Wrap icon in a drag/drop span. 87 $dragDropIcon = '<span
class=
"dragIcon" id=
"dragIconID_' . $row['uid'] . '">
' . $thePageIcon . '</span>
'; 90 if ($this->ext_showPageId) { 91 $pageIdStr = '<span
class=
"dragId">[
' . $row['uid
'] . ']</span>
'; 93 // Call stats information hook 95 if (is_array($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['GLOBAL
']['recStatInfoHooks
'])) { 96 $_params = array('pages
', $row['uid
']); 97 foreach ($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['GLOBAL
']['recStatInfoHooks
'] as $_funcRef) { 98 $stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $this); 101 return $dragDropIcon . $lockIcon . $pageIdStr . $stat; 113 public function wrapStop($str, $row) { 114 if ($row['php_tree_stop
']) { 115 $str .= '<a href=
"' . htmlspecialchars(GeneralUtility::linkThisScript(array('setTempDBmount' => $row['uid']))) . '" class=
"typo3-red">+</a>
'; 130 public function wrapTitle($title, $row, $bank = 0) { 131 // Hook for overriding the page title 132 if (is_array($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['typo3/
class.webpagetree.php
']['pageTitleOverlay
'])) { 133 $_params = array('title
' => &$title, 'row
' => &$row); 134 foreach ($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['typo3/
class.webpagetree.php
']['pageTitleOverlay
'] as $_funcRef) { 135 GeneralUtility::callUserFunction($_funcRef, $_params, $this); 139 $aOnClick = 'return jumpTo(\
'' . $this->
getJumpToParam($row) .
'\',
this,\
'' . $this->domIdPrefix . $this->
getId($row) .
'\',
' . $bank . ');
'; 140 $CSM = ' oncontextmenu=
"' . htmlspecialchars($GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon('', 'pages', $row['uid'], 0, ('&bank=' . $this->bank), '', TRUE)) . ';"'; 141 $thePageTitle = '<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '"' . $CSM . '>
' . $title . '</a>
'; 142 // Wrap title in a drag/drop span. 143 return '<span
class=
"dragTitle" id=
"dragTitleID_' . $row['uid'] . '">
' . $thePageTitle . '</span>
'; 153 public function printTree($treeArr = '') { 154 $titleLen = (int)$this->BE_USER->uc['titleLen
']; 155 if (!is_array($treeArr)) { 156 $treeArr = $this->tree; 159 <!--
TYPO3 tree structure. -->
160 <ul
class=
"tree" id=
"treeRoot">
162 // -- evaluate AJAX request 163 // IE takes anchor as parameter 164 $PM = GeneralUtility::_GP('PM
'); 165 if (($PMpos = strpos($PM, '#
')) !== FALSE) { 166 $PM = substr($PM, 0, $PMpos); 168 $PM = explode('_
', $PM); 169 if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX && is_array($PM) && count($PM) == 4 && $PM[2] != 0) { 171 $expandedPageUid = $PM[2]; 173 // We don't know yet. Will be
set later.
174 $invertedDepthOfAjaxRequestedItem = 0;
177 $collapsedPageUid = $PM[2];
183 $closeDepth = array();
184 foreach ($treeArr as $k => $v) {
185 $classAttr = $v[
'row'][
'_CSSCLASS'];
186 $uid = $v[
'row'][
'uid'];
187 $idAttr = htmlspecialchars($this->domIdPrefix . $this->
getId($v[
'row']) .
'_' . $v[
'bank']);
191 if ($v[
'isFirst'] && !$doCollapse && !($doExpand && $expandedPageUid ==
$uid)) {
196 $classAttr .= $classAttr ?
' expanded' :
'expanded';
199 $classAttr .= $classAttr ?
' last' :
'last';
202 <li id="' . $idAttr .
'"' . ($classAttr ?
' class="' . $classAttr .
'"' :
'') .
'><div class="treeLinkItem">' . $v[
'HTML'] . $this->
wrapTitle($this->
getTitleStr($v[
'row'], $titleLen), $v[
'row'], $v[
'bank']) .
'</div> 205 $itemHTML .=
'</li>';
209 if ($v[
'isLast'] && !($doExpand && $expandedPageUid ==
$uid)) {
210 $closeDepth[$v[
'invertedDepth']] = 1;
214 if ($v[
'isLast'] && !$v[
'hasSub'] && !$doCollapse && !($doExpand && $expandedPageUid ==
$uid)) {
215 for ($i = $v[
'invertedDepth']; $closeDepth[$i] == 1; $i++) {
217 $itemHTML .=
'</ul></li>';
221 if ($doCollapse && $collapsedPageUid ==
$uid) {
222 $this->ajaxStatus = TRUE;
226 if ($doExpand && $expandedPageUid ==
$uid) {
227 $ajaxOutput .= $itemHTML;
228 $invertedDepthOfAjaxRequestedItem = $v[
'invertedDepth'];
229 } elseif ($invertedDepthOfAjaxRequestedItem) {
230 if ($v[
'invertedDepth'] < $invertedDepthOfAjaxRequestedItem) {
231 $ajaxOutput .= $itemHTML;
233 $this->ajaxStatus = TRUE;
240 $this->ajaxStatus = TRUE;
261 public function PMicon($row, $a, $c, $nextCount, $exp) {
262 $PM = $nextCount ? ($exp ?
'minus' :
'plus') :
'join';
263 $BTM = $a == $c ?
'bottom' :
'';
264 $icon =
'<img' .
IconUtility::skinImg($this->backPath, (
'gfx/ol/' . $PM . $BTM .
'.gif'),
'width="18" height="16"') .
' alt="" />';
266 $cmd = $this->bank .
'_' . ($exp ?
'0_' :
'1_') . $row[
'uid'] .
'_' . $this->treeName;
282 if ($this->thisScript) {
284 $js = htmlspecialchars(
'Tree.load(\'' . $cmd .
'\',
' . (int)$isExpand . ',
this);
'); 285 return '<a
class=
"pm" onclick=
"' . $js . '">
' . $icon . '</a>
'; 298 public function getBrowsableTree() { 299 // Get stored tree structure AND updating it if needed according to incoming PM GET var. 300 $this->initializePositionSaving(); 302 $titleLen = (int)$this->BE_USER->uc['titleLen
']; 305 foreach ($this->MOUNTS as $idx => $uid) { 308 $isOpen = $this->stored[$idx][$uid] || $this->expandFirst || $uid === '0
'; 309 // Save ids while resetting everything else. 310 $curIds = $this->ids; 312 $this->ids = $curIds; 313 // Set PM icon for root of mount: 314 $cmd = $this->bank . '_
' . ($isOpen ? '0_
' : '1_
') . $uid . '_
' . $this->treeName; 315 // Only, if not for uid 0 317 $icon = '<img
' . IconUtility::skinImg($this->backPath, ('gfx/ol/
' . ($isOpen ? 'minus
' : 'plus
') . 'only.gif
')) . ' alt=
"" />
'; 318 $firstHtml = $this->PMiconATagWrap($icon, $cmd, !$isOpen); 320 // Preparing rootRec for the mount 322 $rootRec = $this->getRecord($uid); 323 $firstHtml .= $this->getIcon($rootRec); 325 // Artificial record for the tree root, id=0 326 $rootRec = $this->getRootRecord($uid); 327 $firstHtml .= $this->getRootIcon($rootRec); 329 if (is_array($rootRec)) { 330 // In case it was swapped inside getRecord due to workspaces. 331 $uid = $rootRec['uid
']; 332 // Add the root of the mount to ->tree 333 $this->tree[] = array('HTML
' => $firstHtml, 'row
' => $rootRec, 'bank
' => $this->bank, 'hasSub
' => TRUE, 'invertedDepth
' => 1000); 334 // If the mount is expanded, go down: 337 if ($this->addSelfId) { 340 $this->getTree($uid, 999, '', $rootRec['_SUBCSSCLASS
']); 343 $treeArr = array_merge($treeArr, $this->tree); 346 return $this->printTree($treeArr); 359 public function getTree($uid, $depth = 999, $blankLineCode = '', $subCSSclass = '') { 360 // Buffer for id hierarchy is reset: 361 $this->buffer_idH = array(); 363 $depth = (int)$depth; 366 $res = $this->getDataInit($uid, $subCSSclass); 367 $c = $this->getDataCount($res); 368 $crazyRecursionLimiter = 999; 369 $inMenuPages = array(); 370 $outOfMenuPages = array(); 371 $outOfMenuPagesTextIndex = array(); 372 while ($crazyRecursionLimiter > 0 && ($row = $this->getDataNext($res, $subCSSclass))) { 373 $crazyRecursionLimiter--; 375 if ($this->ext_separateNotinmenuPages && ($row['doktype
'] == \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION || $row['doktype
'] >= 200 || $row['nav_hide
'])) { 376 $outOfMenuPages[] = $row; 377 $outOfMenuPagesTextIndex[] = ($row['doktype
'] >= 200 ? 'zzz
' . $row['doktype
'] . '_
' : '') . $row['title
']; 379 $inMenuPages[] = $row; 382 $label_shownAlphabetically = ''; 383 if (count($outOfMenuPages)) { 384 // Sort out-of-menu pages: 385 $outOfMenuPages_alphabetic = array(); 386 if ($this->ext_alphasortNotinmenuPages) { 387 asort($outOfMenuPagesTextIndex); 388 $label_shownAlphabetically = ' (alphabetic)
'; 390 foreach ($outOfMenuPagesTextIndex as $idx => $txt) { 391 $outOfMenuPages_alphabetic[] = $outOfMenuPages[$idx]; 394 $outOfMenuPages_alphabetic[0]['_FIRST_NOT_IN_MENU
'] = TRUE; 395 $allRows = array_merge($inMenuPages, $outOfMenuPages_alphabetic); 397 $allRows = $inMenuPages; 399 // Traverse the records: 400 foreach ($allRows as $row) { 402 $newID = $row['uid
']; 404 $this->tree[] = array(); 406 // Get the key for this space 407 $treeKey = key($this->tree); 408 $LN = $a == $c ? 'blank
' : 'line
'; 409 // If records should be accumulated, do so 410 if ($this->setRecs) { 411 $this->recs[$row['uid
']] = $row; 413 // Accumulate the id of the element in the internal arrays 414 $this->ids[] = ($idH[$row['uid
']]['uid
'] = $row['uid
']); 415 $this->ids_hierarchy[$depth][] = $row['uid
']; 416 // Make a recursive call to the next level 417 if ($depth > 1 && $this->expandNext($newID) && !$row['php_tree_stop
']) { 418 $nextCount = $this->getTree($newID, $depth - 1, $blankLineCode . ',
' . $LN, $row['_SUBCSSCLASS
']); 419 if (count($this->buffer_idH)) { 420 $idH[$row['uid
']]['subrow
'] = $this->buffer_idH; 422 // Set "did expand" flag 425 $nextCount = $this->getCount($newID); 426 // Clear "did expand" flag 429 // Set HTML-icons, if any: 430 if ($this->makeHTML) { 431 if ($row['_FIRST_NOT_IN_MENU
']) { 432 $HTML = '<img
' . IconUtility::skinImg($this->backPath, 'gfx/ol/line.gif
') . ' alt=
"" /><br/><img
' . IconUtility::skinImg($this->backPath, 'gfx/ol/line.gif
') . ' alt=
"" /><i>Not shown in menu
' . $label_shownAlphabetically . ':</i><br>
'; 436 $HTML .= $this->PMicon($row, $a, $c, $nextCount, $exp); 437 $HTML .= $this->wrapStop($this->getIcon($row), $row); 439 // Finally, add the row/HTML content to the ->tree array in the reserved key. 440 $this->tree[$treeKey] = array( 443 'hasSub
' => $nextCount && $this->expandNext($newID), 444 'isFirst
' => $a == 1, 446 'invertedDepth
' => $depth, 447 'blankLineCode
' => $blankLineCode, 448 'bank
' => $this->bank 452 $this->tree[$treeKey]['isLast
'] = TRUE; 454 $this->getDataFree($res); 455 $this->buffer_idH = $idH;
wrapIcon($thePageIcon, &$row)
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
PMiconATagWrap($icon, $cmd, $isExpand=TRUE)
$ext_alphasortNotinmenuPages
static quoteJSvalue($value)
wrapTitle($title, $row, $bank=0)
init($clause='', $orderByFields='')
$ext_separateNotinmenuPages
static isRecordLocked($table, $uid)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
getTitleStr($row, $titleLen=30)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
PMicon($row, $a, $c, $nextCount, $exp)