[BUGFIX] Exclude E_STRICT from errors with PHP 5.4
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / mod4 / select_image.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasper@typo3.com)
6 * (c) 2004-2011 Stanislas Rolland <typo3(arobas)jbr.ca>
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 * A copy is found in the textfile GPL.txt and important notices to the license
18 * from the author is found in LICENSE.txt distributed with these scripts.
19 *
20 *
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28 /**
29 * Displays image selector for the RTE
30 *
31 * @author Kasper Skårhøj <kasper@typo3.com>
32 * @author Stanislas Rolland <typo3(arobas)jbr.ca>
33 */
34
35 error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
36 unset($MCONF);
37 require('conf.php');
38 require($BACK_PATH.'init.php');
39 $LANG->includeLLFile('EXT:lang/locallang_browse_links.xml');
40 $LANG->includeLLFile('EXT:rtehtmlarea/mod4/locallang.xml');
41 $LANG->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xml');
42
43 /**
44 * Script class for the Element Browser window.
45 *
46 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
47 * @package TYPO3
48 * @subpackage core
49 */
50 class tx_rtehtmlarea_SC_select_image {
51 public $mode = 'rte';
52 public $button = 'image';
53 protected $content = '';
54
55 /**
56 * Main function, rendering the element browser in RTE mode.
57 *
58 * @return void
59 */
60 function main() {
61 // Setting alternative browsing mounts (ONLY local to browse_links.php this script so they stay "read-only")
62 $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.altElementBrowserMountPoints'));
63 if ($altMountPoints) {
64 $altMountPoints = t3lib_div::trimExplode(',', $altMountPoints);
65 foreach ($altMountPoints as $filePathRelativeToFileadmindir) {
66 $GLOBALS['BE_USER']->addFileMount('', $filePathRelativeToFileadmindir, $filePathRelativeToFileadmindir, 1, 'readonly');
67 }
68 $GLOBALS['FILEMOUNTS'] = $GLOBALS['BE_USER']->returnFilemounts();
69 }
70 // Rendering type by user function
71 $browserRendered = FALSE;
72 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
73 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
74 $browserRenderObj = t3lib_div::getUserObj($classRef);
75 if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
76 if ($browserRenderObj->isValid($this->mode, $this)) {
77 $this->content .= $browserRenderObj->render($this->mode, $this);
78 $browserRendered = TRUE;
79 break;
80 }
81 }
82 }
83 }
84 // If type was not rendered, use default rendering functions
85 if (!$browserRendered) {
86 $GLOBALS['SOBE']->browser = t3lib_div::makeInstance('tx_rtehtmlarea_select_image');
87 $GLOBALS['SOBE']->browser->init();
88 $modData = $GLOBALS['BE_USER']->getModuleData('select_image.php', 'ses');
89 list($modData, $store) = $GLOBALS['SOBE']->browser->processSessionData($modData);
90 $GLOBALS['BE_USER']->pushModuleData('select_image.php', $modData);
91 $this->content = $GLOBALS['SOBE']->browser->main_rte();
92 }
93 }
94
95 /**
96 * Print module content
97 *
98 * @return void
99 */
100 function printContent() {
101 echo $this->content;
102 }
103 }
104
105 // Make instance:
106 $SOBE = t3lib_div::makeInstance('tx_rtehtmlarea_SC_select_image');
107 $SOBE->main();
108 $SOBE->printContent();
109
110 ?>