[TASK] Merge submodule workspaces into core
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / Classes / FolderTree.php
1 <?php
2 namespace TYPO3\CMS\Rtehtmlarea;
3
4 /**
5 * Base extension class which generates the folder tree.
6 * Used directly by the RTE.
7 *
8 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
9 */
10 class FolderTree extends \rteFolderTree {
11
12 /**
13 * Wrapping the title in a link, if applicable.
14 *
15 * @param string Title, ready for output.
16 * @param \TYPO3\CMS\Core\Resource\Folder The "record
17 * @return string Wrapping title string.
18 * @todo Define visibility
19 */
20 public function wrapTitle($title, \TYPO3\CMS\Core\Resource\Folder $folderObject) {
21 if ($this->ext_isLinkable($folderObject)) {
22 $aOnClick = 'return jumpToUrl(\'' . $this->thisScript . '?act=' . $GLOBALS['SOBE']->browser->act . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&editorNo=' . $GLOBALS['SOBE']->browser->editorNo . '&contentTypo3Language=' . $GLOBALS['SOBE']->browser->contentTypo3Language . '&contentTypo3Charset=' . $GLOBALS['SOBE']->browser->contentTypo3Charset . '&expandFolder=' . rawurlencode($folderObject->getCombinedIdentifier()) . '\');';
23 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $title . '</a>';
24 } else {
25 return '<span class="typo3-dimmed">' . $title . '</span>';
26 }
27 }
28
29 /**
30 * Wrap the plus/minus icon in a link
31 *
32 * @param string $icon HTML string to wrap, probably an image tag.
33 * @param string $cmd Command for 'PM' get var
34 * @param boolean $isExpand If expanded
35 * @return string Link-wrapped input string
36 * @access private
37 */
38 public function PMiconATagWrap($icon, $cmd, $isExpand = TRUE) {
39 if ($this->thisScript) {
40 $js = htmlspecialchars('Tree.thisScript=\'' . $GLOBALS['BACK_PATH'] . 'ajax.php\',Tree.load(\'' . $cmd . '\', ' . intval($isExpand) . ', this);');
41 return '<a class="pm" onclick="' . $js . '">' . $icon . '</a>';
42 } else {
43 return $icon;
44 }
45 }
46
47 }
48
49
50 ?>