Fixed bug #16050: htmlArea RTE: Backspacing in empty editing area may raise js error
[Packages/TYPO3.CMS.git] / typo3 / browser.php
index aaf2f25..7a485e1 100644 (file)
@@ -1,22 +1,22 @@
 <?php
 /***************************************************************
 *  Copyright notice
-*  
-*  (c) 1999-2003 Kasper Skaarhoj (kasper@typo3.com)
+*
+*  (c) 1999-2010 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
-*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  This script is part of the TYPO3 project. The TYPO3 project is
 *  free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
-* 
+*
 *  The GNU General Public License can be found at
 *  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license 
+*  A copy is found in the textfile GPL.txt and important notices to the license
 *  from the author is found in LICENSE.txt distributed with these scripts.
 *
-* 
+*
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
-/** 
+/**
  * This is the frameset to the file/record browser window
- * 
+ *
  * $Id$
- * Revised for TYPO3 3.6 July/2003 by Kasper Skaarhoj
+ * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
  * XHTML-frames compatible.
  *
- * @author     Kasper Skaarhoj <kasper@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
  *
  *
  *
- *   66: class SC_browser 
- *   77:     function main()   
- *  121:     function printContent()   
+ *   66: class SC_browser
+ *   77:     function main()
+ *  122:     function printContent()
  *
  * TOTAL FUNCTIONS: 2
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -58,8 +58,8 @@ require ('template.php');
 
 /**
  * Script Class, putting the frameset together.
- * 
- * @author     Kasper Skaarhoj <kasper@typo3.com>
+ *
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -71,15 +71,15 @@ class SC_browser {
        /**
         * Main function.
         * Creates the header code in XHTML, the JavaScript, then the frameset for the two frames.
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function main() {
-               
+
                        // Setting GPvars:
-               $mode =t3lib_div::GPvar('mode');
-               $bparams = t3lib_div::GPvar('bparams');
-               
+               $mode =t3lib_div::_GP('mode');
+               $bparams = t3lib_div::_GP('bparams');
+
 
                        // Set doktype:
                $GLOBALS['TBE_TEMPLATE']->docType='xhtml_frames';
@@ -88,24 +88,25 @@ class SC_browser {
                                        close();
                                }
                                function setParams(mode,params) {       //
-                                       parent.content.document.location = "browse_links.php?mode="+mode+"&bparams="+params;
+                                       parent.content.location.href = "browse_links.php?mode="+mode+"&bparams="+params;
                                }
                                if (!window.opener)     {
                                        alert("ERROR: Sorry, no link to main window... Closing");
                                        close();
                                }
                ');
-               
+
                $this->content.=$GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:TYPO3_Element_Browser'));
 
                        // URL for the inner main frame:
-               $url = 'browse_links.php?mode='.rawurlencode($mode).'&bparams='.rawurlencode($bparams);
+               $url = $GLOBALS['BACK_PATH'].'browse_links.php?mode='.rawurlencode($mode).'&bparams='.rawurlencode($bparams);
 
                        // Create the frameset for the window:
+                       // Formerly there were a ' onunload="closing();"' in the <frameset> tag - but it failed on Safari browser on Mac unless the handler was "onUnload"
                $this->content.='
-                       <frameset rows="*,1" framespacing="0" frameborder="0" border="0" onunload="closing();">
-                               <frame name="content" src="'.htmlspecialchars($url).'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" onblur="closing();" />
-                               <frame name="menu" src="dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
+                       <frameset rows="*,1" framespacing="0" frameborder="0" border="0">
+                               <frame name="content" src="'.htmlspecialchars($url).'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
+                               <frame name="menu" src="'.$GLOBALS['BACK_PATH'].'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
                        </frameset>
                ';
 
@@ -115,30 +116,24 @@ class SC_browser {
 
        /**
         * Outputs the page content.
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function printContent() {
                echo $this->content;
        }
 }
 
-// Include extension?
+
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browser.php'])      {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/browser.php']);
 }
 
 
 
-
-
-
-
-
-
-
 // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_browser');
 $SOBE->main();
 $SOBE->printContent();
+
 ?>
\ No newline at end of file