/src/typo3_src-4.2.0alpha1/typo3/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         
00100         var $browser;
00101 
00107         var $doc;
00108 
00114         function init ()        {
00115 
00116                         // Find "mode"
00117                 $this->mode = t3lib_div::_GP('mode');
00118                 if (!$this->mode)       {
00119                         $this->mode = 'rte';
00120                 }
00121 
00122                         // Creating backend template object:
00123                         // this might not be needed but some classes refer to $GLOBALS['SOBE']->doc, so ...
00124                 $this->doc = t3lib_div::makeInstance('template');
00125                 $this->doc->docType= 'xhtml_trans';
00126                 $this->doc->backPath = $GLOBALS['BACK_PATH'];
00127         }
00128 
00129 
00135         function main() {
00136                 global $BE_USER, $BACK_PATH;
00137 
00138                 $this->content = '';
00139 
00140                         // render type by user func
00141                 $browserRendered = false;
00142                 if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
00143                         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
00144                                 $browserRenderObj = t3lib_div::getUserObj($classRef);
00145                                 if(is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render'))   {
00146                                         if ($browserRenderObj->isValid($this->mode, $this)) {
00147                                                 $this->content .=  $browserRenderObj->render($this->mode, $this);
00148                                                 $browserRendered = true;
00149                                                 break;
00150                                         }
00151                                 }
00152                         }
00153                 }
00154 
00155                         // if type was not rendered use default rendering functions
00156                 if(!$browserRendered) {
00157 
00158                         $this->browser = t3lib_div::makeInstance('browse_links');
00159                         $this->browser->init();
00160 
00161                         $modData = $BE_USER->getModuleData('browse_links.php','ses');
00162                         list($modData, $store) = $this->browser->processSessionData($modData);
00163                         $BE_USER->pushModuleData('browse_links.php',$modData);
00164 
00165                                 // Output the correct content according to $this->mode
00166                         switch((string)$this->mode)     {
00167                                 case 'rte':
00168                                         $this->content = $this->browser->main_rte();
00169                                 break;
00170                                 case 'db':
00171                                         $this->content = $this->browser->main_db();
00172                                 break;
00173                                 case 'file':
00174                                 case 'filedrag':
00175                                         $this->content = $this->browser->main_file();
00176                                 break;
00177                                 case 'wizard':
00178                                         $this->content = $this->browser->main_rte(1);
00179                                 break;
00180                         }
00181                 }
00182         }
00183 
00189         function printContent() {
00190                 echo $this->content;
00191         }
00192 
00193 
00194 }
00195 
00196 
00197 // Include extension?
00198 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browse_links.php'])  {
00199         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browse_links.php']);
00200 }
00201 
00202 
00203 
00204 
00205 
00206 
00207 
00208 
00209 // Make instance:
00210 $SOBE = t3lib_div::makeInstance('SC_browse_links');
00211 $SOBE->init();
00212 $SOBE->main();
00213 $SOBE->printContent();
00214 ?>

This documentation has been generated automatically from TYPO3 source code using Doxygen and is provided as is by Cast Iron Coding as a courtesy to other TYPO3 developers and users. Please consider Cast Iron Coding — a full-service web development agency in Portland, Oregon specializing in TYPO3 extension development — for all of your TYPO3 development and consulting needs!