TYPO3 API  SVNRelease
browser.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2011 Kasper Skårhøj (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 ***************************************************************/
00027 /**
00028  * This is the frameset to the file/record browser window
00029  *
00030  * $Id: browser.php 10121 2011-01-18 20:15:30Z ohader $
00031  * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
00032  * XHTML-frames compatible.
00033  *
00034  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00035  */
00036 /**
00037  * [CLASS/FUNCTION INDEX of SCRIPT]
00038  *
00039  *
00040  *
00041  *   66: class SC_browser
00042  *   77:     function main()
00043  *  122:     function printContent()
00044  *
00045  * TOTAL FUNCTIONS: 2
00046  * (This index is automatically created/updated by the extension "extdeveval")
00047  *
00048  */
00049 require ('init.php');
00050 require ('template.php');
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 /**
00060  * Script Class, putting the frameset together.
00061  *
00062  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00063  * @package TYPO3
00064  * @subpackage core
00065  */
00066 class SC_browser {
00067 
00068         // Internal, dynamic
00069     var $content;
00070 
00071     /**
00072      * Main function.
00073      * Creates the header code in XHTML, the JavaScript, then the frameset for the two frames.
00074      *
00075      * @return  void
00076      */
00077     function main() {
00078 
00079             // Setting GPvars:
00080         $mode =t3lib_div::_GP('mode');
00081         $bparams = t3lib_div::_GP('bparams');
00082 
00083 
00084             // Set doktype:
00085         $GLOBALS['TBE_TEMPLATE']->docType='xhtml_frames';
00086         $GLOBALS['TBE_TEMPLATE']->JScode=$GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
00087                 function closing()  {   //
00088                     close();
00089                 }
00090                 function setParams(mode,params) {   //
00091                     parent.content.location.href = "browse_links.php?mode="+mode+"&bparams="+params;
00092                 }
00093                 if (!window.opener) {
00094                     alert("ERROR: Sorry, no link to main window... Closing");
00095                     close();
00096                 }
00097         ');
00098 
00099         $this->content.=$GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:TYPO3_Element_Browser'));
00100 
00101             // URL for the inner main frame:
00102         $url = $GLOBALS['BACK_PATH'].'browse_links.php?mode='.rawurlencode($mode).'&bparams='.rawurlencode($bparams);
00103 
00104             // Create the frameset for the window:
00105             // Formerly there were a ' onunload="closing();"' in the <frameset> tag - but it failed on Safari browser on Mac unless the handler was "onUnload"
00106         $this->content.='
00107             <frameset rows="*,1" framespacing="0" frameborder="0" border="0">
00108                 <frame name="content" src="'.htmlspecialchars($url).'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
00109                 <frame name="menu" src="'.$GLOBALS['BACK_PATH'].'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
00110             </frameset>
00111         ';
00112 
00113         $this->content.='
00114 </html>';
00115     }
00116 
00117     /**
00118      * Outputs the page content.
00119      *
00120      * @return  void
00121      */
00122     function printContent() {
00123         echo $this->content;
00124     }
00125 }
00126 
00127 
00128 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/browser.php'])) {
00129     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/browser.php']);
00130 }
00131 
00132 
00133 
00134 // Make instance:
00135 $SOBE = t3lib_div::makeInstance('SC_browser');
00136 $SOBE->main();
00137 $SOBE->printContent();
00138 
00139 ?>