[TASK] Update TYPO3 version in ext_emconf.php and composer.json
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / Classes / PageTree.php
1 <?php
2 namespace TYPO3\CMS\Rtehtmlarea;
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
17 /**
18 * Displays the page/file tree for browsing database records or files.
19 * Used from TCEFORMS an other elements
20 * In other words: This is the ELEMENT BROWSER!
21 *
22 * Adapted for htmlArea RTE by Stanislas Rolland
23 *
24 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
25 * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
26 */
27 use TYPO3\CMS\Core\Utility\GeneralUtility;
28
29 /**
30 * Class which generates the page tree
31 *
32 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
33 */
34 class PageTree extends \TYPO3\CMS\Backend\Tree\View\ElementBrowserPageTreeView {
35
36 /**
37 * Create the page navigation tree in HTML
38 *
39 * @param array Tree array
40 * @return string HTML output.
41 */
42 public function printTree($treeArr = '') {
43 $titleLen = (int)$GLOBALS['BE_USER']->uc['titleLen'];
44 if (!is_array($treeArr)) {
45 $treeArr = $this->tree;
46 }
47 $out = '';
48 $c = 0;
49 foreach ($treeArr as $k => $v) {
50 $c++;
51 $bgColorClass = ($c + 1) % 2 ? 'bgColor' : 'bgColor-10';
52 if ($GLOBALS['SOBE']->browser->curUrlInfo['act'] == 'page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'] == $v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
53 $arrCol = '<td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_right.gif', 'width="5" height="9"') . ' class="c-blinkArrowR" alt="" /></td>';
54 $bgColorClass = 'bgColor4';
55 } else {
56 $arrCol = '<td></td>';
57 }
58 $aOnClick = 'return jumpToUrl(' . GeneralUtility::quoteJSvalue($this->getThisScript() . 'act=' . $GLOBALS['SOBE']->browser->act . '&editorNo=' . $GLOBALS['SOBE']->browser->editorNo . '&contentTypo3Language=' . $GLOBALS['SOBE']->browser->contentTypo3Language . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&expandPage=' . $v['row']['uid']) . ');';
59 $cEbullet = $this->ext_isLinkable($v['row']['doktype'], $v['row']['uid']) ? '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '"><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/arrowbullet.gif', 'width="18" height="16"') . ' alt="" /></a>' : '';
60 $out .= '
61 <tr class="' . $bgColorClass . '">
62 <td nowrap="nowrap"' . ($v['row']['_CSSCLASS'] ? ' class="' . $v['row']['_CSSCLASS'] . '"' : '') . '>' . $v['HTML'] . $this->wrapTitle($this->getTitleStr($v['row'], $titleLen), $v['row'], $this->ext_pArrPages) . '</td>' . $arrCol . '<td>' . $cEbullet . '</td>
63 </tr>';
64 }
65 $out = '
66
67
68 <!--
69 Navigation Page Tree:
70 -->
71 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
72 ' . $out . '
73 </table>';
74 return $out;
75 }
76
77 }