00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 $BACK_PATH='';
00053 require ('init.php');
00054 require ('template.php');
00055 $LANG->includeLLFile('EXT:lang/locallang_browse_links.xml');
00056
00057 require_once (PATH_typo3.'/class.browse_links.php');
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 class SC_browse_links {
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 var $mode;
00092
00093
00094
00095
00096
00097
00098
00099
00100 var $browser;
00101
00102
00103
00104
00105
00106
00107 var $doc;
00108
00109
00110
00111
00112
00113
00114 function init () {
00115
00116
00117 $this->mode = t3lib_div::_GP('mode');
00118 if (!$this->mode) {
00119 $this->mode = 'rte';
00120 }
00121
00122
00123
00124 $this->doc = t3lib_div::makeInstance('template');
00125 $this->doc->backPath = $GLOBALS['BACK_PATH'];
00126 }
00127
00128
00129
00130
00131
00132
00133
00134 function main() {
00135
00136
00137 $tmpMount = t3lib_div::_GET('setTempDBmount');
00138 if (isset($tmpMount)) {
00139 $GLOBALS['BE_USER']->setAndSaveSessionData('pageTree_temporaryMountPoint', intval($tmpMount));
00140 }
00141
00142
00143 $tempDBmount = intval($GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint'));
00144 if ($tempDBmount) {
00145 $altMountPoints = $tempDBmount;
00146 }
00147
00148 if ($altMountPoints) {
00149 $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(t3lib_div::intExplode(',', $altMountPoints)));
00150 $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
00151 }
00152
00153 $this->content = '';
00154
00155
00156 switch((string)$this->mode) {
00157 case 'rte':
00158 case 'db':
00159 case 'wizard':
00160
00161 $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
00162 if ($altMountPoints) {
00163 $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(t3lib_div::intExplode(',', $altMountPoints)));
00164 $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
00165 }
00166 case 'file':
00167 case 'filedrag':
00168 case 'folder':
00169
00170 $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.altElementBrowserMountPoints'));
00171 if ($altMountPoints) {
00172 $altMountPoints = t3lib_div::trimExplode(',', $altMountPoints);
00173 foreach($altMountPoints as $filePathRelativeToFileadmindir) {
00174 $GLOBALS['BE_USER']->addFileMount('', $filePathRelativeToFileadmindir, $filePathRelativeToFileadmindir, 1, 'readonly');
00175 }
00176 $GLOBALS['FILEMOUNTS'] = $GLOBALS['BE_USER']->returnFilemounts();
00177 }
00178 break;
00179 }
00180
00181
00182
00183 $browserRendered = false;
00184 if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
00185 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
00186 $browserRenderObj = t3lib_div::getUserObj($classRef);
00187 if (is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) {
00188 if ($browserRenderObj->isValid($this->mode, $this)) {
00189 $this->content.= $browserRenderObj->render($this->mode, $this);
00190 $browserRendered = true;
00191 break;
00192 }
00193 }
00194 }
00195 }
00196
00197
00198 if(!$browserRendered) {
00199 $this->browser = t3lib_div::makeInstance('browse_links');
00200 $this->browser->init();
00201 $modData = $GLOBALS['BE_USER']->getModuleData('browse_links.php', 'ses');
00202 list($modData, $store) = $this->browser->processSessionData($modData);
00203 $GLOBALS['BE_USER']->pushModuleData('browse_links.php', $modData);
00204
00205
00206 switch((string)$this->mode) {
00207 case 'rte':
00208 $this->content = $this->browser->main_rte();
00209 break;
00210 case 'db':
00211 $this->content = $this->browser->main_db();
00212 break;
00213 case 'file':
00214 case 'filedrag':
00215 $this->content = $this->browser->main_file();
00216 break;
00217 case 'folder':
00218 $this->content = $this->browser->main_folder();
00219 break;
00220 case 'wizard':
00221 $this->content = $this->browser->main_rte(1);
00222 break;
00223 }
00224 }
00225 }
00226
00227
00228
00229
00230
00231
00232 function printContent() {
00233 echo $this->content;
00234 }
00235
00236
00237 }
00238
00239
00240
00241 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browse_links.php']) {
00242 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browse_links.php']);
00243 }
00244
00245
00246
00247
00248 $SOBE = t3lib_div::makeInstance('SC_browse_links');
00249 $SOBE->init();
00250 $SOBE->main();
00251 $SOBE->printContent();
00252
00253 ?>