[BUGFIX] Fix the element browsers
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / Classes / PageTree.php
1 <?php
2 namespace TYPO3\CMS\Rtehtmlarea;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
8 * (c) 2005-2012 Stanislas Rolland <typo3(arobas)sjbr.ca>
9 * All rights reserved
10 *
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 * A copy is found in the textfile GPL.txt and important notices to the license
20 * from the author is found in LICENSE.txt distributed with these scripts.
21 *
22 *
23 * This script is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * This copyright notice MUST APPEAR in all copies of the script!
29 ***************************************************************/
30 /**
31 * Displays the page/file tree for browsing database records or files.
32 * Used from TCEFORMS an other elements
33 * In other words: This is the ELEMENT BROWSER!
34 *
35 * Adapted for htmlArea RTE by Stanislas Rolland
36 *
37 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
38 * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
39 */
40 /**
41 * Class which generates the page tree
42 *
43 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
44 * @package TYPO3
45 * @subpackage core
46 */
47 class PageTree extends \rtePageTree {
48
49 /**
50 * Create the page navigation tree in HTML
51 *
52 * @param array Tree array
53 * @return string HTML output.
54 * @todo Define visibility
55 */
56 public function printTree($treeArr = '') {
57 $titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']);
58 if (!is_array($treeArr)) {
59 $treeArr = $this->tree;
60 }
61 $out = '';
62 $c = 0;
63 foreach ($treeArr as $k => $v) {
64 $c++;
65 $bgColorClass = ($c + 1) % 2 ? 'bgColor' : 'bgColor-10';
66 if (($GLOBALS['SOBE']->browser->curUrlInfo['act'] == 'page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'] == $v['row']['uid']) && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
67 $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>';
68 $bgColorClass = 'bgColor4';
69 } else {
70 $arrCol = '<td></td>';
71 }
72 $aOnClick = ((((((((((('return jumpToUrl(\'' . $this->thisScript) . '?act=') . $GLOBALS['SOBE']->browser->act) . '&editorNo=') . $GLOBALS['SOBE']->browser->editorNo) . '&contentTypo3Language=') . $GLOBALS['SOBE']->browser->contentTypo3Language) . '&mode=') . $GLOBALS['SOBE']->browser->mode) . '&expandPage=') . $v['row']['uid']) . '\');';
73 $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>' : '';
74 $out .= (((((((((('
75 <tr class="' . $bgColorClass) . '">
76 <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>
77 </tr>';
78 }
79 $out = ('
80
81
82 <!--
83 Navigation Page Tree:
84 -->
85 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
86 ' . $out) . '
87 </table>';
88 return $out;
89 }
90
91 }
92
93
94 ?>