Documentation TYPO3 par Ameos |
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com) 00006 * (c) 2005-2006 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> 00007 * All rights reserved 00008 * 00009 * This script is part of the TYPO3 project. The TYPO3 project is 00010 * free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * The GNU General Public License can be found at 00016 * http://www.gnu.org/copyleft/gpl.html. 00017 * A copy is found in the textfile GPL.txt and important notices to the license 00018 * from the author is found in LICENSE.txt distributed with these scripts. 00019 * 00020 * 00021 * This script is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00024 * GNU General Public License for more details. 00025 * 00026 * This copyright notice MUST APPEAR in all copies of the script! 00027 ***************************************************************/ 00041 error_reporting (E_ALL ^ E_NOTICE); 00042 unset($MCONF); 00043 require('conf.php'); 00044 require($BACK_PATH.'init.php'); 00045 require($BACK_PATH.'template.php'); 00046 require_once('class.tx_rtehtmlarea_browse_links.php'); 00047 $LANG->includeLLFile('EXT:rtehtmlarea/mod3/locallang.xml'); 00048 $LANG->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xml'); 00049 00057 class tx_rtehtmlarea_SC_browse_links { 00058 var $mode; 00059 00065 function main() { 00066 global $BE_USER, $SOBE; 00067 00068 $this->mode = t3lib_div::_GP('mode'); 00069 if (!$this->mode) { 00070 $this->mode = 'rte'; 00071 } 00072 00073 $this->content = ''; 00074 00075 // render type by user func 00076 $browserRendered = false; 00077 if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) { 00078 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) { 00079 $browserRenderObj = t3lib_div::getUserObj($classRef); 00080 if(is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render')) { 00081 if ($browserRenderObj->isValid($this->mode, $this)) { 00082 $this->content .= $browserRenderObj->render($this->mode, $this); 00083 $browserRendered = true; 00084 break; 00085 } 00086 } 00087 } 00088 } 00089 00090 // if type was not rendered use default rendering functions 00091 if(!$browserRendered) { 00092 00093 $SOBE->browser = t3lib_div::makeInstance('tx_rtehtmlarea_browse_links'); 00094 $SOBE->browser->init(); 00095 00096 $modData = $BE_USER->getModuleData('browse_links.php','ses'); 00097 list($modData, $store) = $SOBE->browser->processSessionData($modData); 00098 $BE_USER->pushModuleData('browse_links.php',$modData); 00099 00100 // Output the correct content according to $this->mode 00101 switch((string)$this->mode) { 00102 case 'rte': 00103 $this->content = $SOBE->browser->main_rte(); 00104 break; 00105 case 'db': 00106 $this->content = $SOBE->browser->main_db(); 00107 break; 00108 case 'file': 00109 case 'filedrag': 00110 $this->content = $SOBE->browser->main_file(); 00111 break; 00112 case 'wizard': 00113 $this->content = $SOBE->browser->main_rte(1); 00114 break; 00115 } 00116 } 00117 } 00118 00124 function printContent() { 00125 echo $this->content; 00126 } 00127 00128 00129 } 00130 00131 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod3/browse_links.php']) { 00132 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod3/browse_links.php']); 00133 } 00134 00135 // Make instance: 00136 $SOBE = t3lib_div::makeInstance('tx_rtehtmlarea_SC_browse_links'); 00137 $SOBE->main(); 00138 $SOBE->printContent(); 00139 ?>