Documentation TYPO3 par Ameos

browse_links.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
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 
00078 class SC_browse_links {
00079 
00080 
00091         var $mode;
00092         
00101         var $browser;
00102 
00103 
00109         function init ()        {
00110 
00111                         // Find "mode"
00112                 $this->mode = t3lib_div::_GP('mode');
00113                 if (!$this->mode)       {
00114                         $this->mode = 'rte';
00115                 }
00116 
00117                         // Creating backend template object:
00118                         // this might not be needed but some classes refer to $GLOBALS['SOBE']->doc, so ...
00119                 $this->doc = t3lib_div::makeInstance('template');
00120                 $this->doc->docType= 'xhtml_trans';
00121                 $this->doc->backPath = $GLOBALS['BACK_PATH'];
00122         }
00123 
00124 
00130         function main() {
00131                 global $BE_USER, $BACK_PATH;
00132 
00133                 $this->content = '';
00134 
00135                         // render type by user func
00136                 $browserRendered = false;
00137                 if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
00138                         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
00139                                 $browserRenderObj = t3lib_div::getUserObj($classRef);
00140                                 if(is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render'))   {
00141                                         if ($browserRenderObj->isValid($this->mode, $this)) {
00142                                                 $this->content .=  $browserRenderObj->render($this->mode, $this);
00143                                                 $browserRendered = true;
00144                                                 break;
00145                                         }
00146                                 }
00147                         }
00148                 }
00149 
00150                         // if type was not rendered use default rendering functions
00151                 if(!$browserRendered) {
00152 
00153                         $this->browser = t3lib_div::makeInstance('browse_links');
00154                         $this->browser->init();
00155 
00156                         $modData = $BE_USER->getModuleData('browse_links.php','ses');
00157                         list($modData, $store) = $this->browser->processSessionData($modData);
00158                         $BE_USER->pushModuleData('browse_links.php',$modData);
00159 
00160                                 // Output the correct content according to $this->mode
00161                         switch((string)$this->mode)     {
00162                                 case 'rte':
00163                                         $this->content = $this->browser->main_rte();
00164                                 break;
00165                                 case 'db':
00166                                         $this->content = $this->browser->main_db();
00167                                 break;
00168                                 case 'file':
00169                                 case 'filedrag':
00170                                         $this->content = $this->browser->main_file();
00171                                 break;
00172                                 case 'wizard':
00173                                         $this->content = $this->browser->main_rte(1);
00174                                 break;
00175                         }
00176                 }
00177         }
00178 
00184         function printContent() {
00185                 echo $this->content;
00186         }
00187 
00188 
00189 }
00190 
00191 
00192 // Include extension?
00193 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browse_links.php'])  {
00194         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browse_links.php']);
00195 }
00196 
00197 
00198 
00199 
00200 
00201 
00202 
00203 
00204 // Make instance:
00205 $SOBE = t3lib_div::makeInstance('SC_browse_links');
00206 $SOBE->init();
00207 $SOBE->main();
00208 $SOBE->printContent();
00209 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6