Added feature #15783: Improve ExtJS skin: Tabs
[Packages/TYPO3.CMS.git] / typo3 / wizard_rte.php
old mode 100755 (executable)
new mode 100644 (file)
index 22c430f..513bb93
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@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
  * Wizard to display the RTE in "full screen" mode
  *
  * $Id$
- * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
+ * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -55,9 +55,6 @@ $BACK_PATH='';
 require ('init.php');
 require ('template.php');
 $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
-require_once (PATH_t3lib.'class.t3lib_tceforms.php');
-require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');
-require_once (PATH_t3lib.'class.t3lib_transferdata.php');
 
 t3lib_BEfunc::lockRecords();
 
@@ -74,7 +71,7 @@ t3lib_BEfunc::lockRecords();
 /**
  * Script Class for rendering the full screen RTE display
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -92,6 +89,7 @@ class SC_wizard_rte {
                // Internal, static: GPvars
        var $P;                                         // Wizard parameters, coming from TCEforms linking to the wizard.
        var $popView;                           // If set, launch a new window with the current records pid.
+       var $R_URI;                                     // Set to the URL of this script including variables which is needed to re-display the form. See main()
 
 
 
@@ -105,6 +103,7 @@ class SC_wizard_rte {
                        // Setting GPvars:
                $this->P = t3lib_div::_GP('P');
                $this->popView = t3lib_div::_GP('popView');
+               $this->R_URI = t3lib_div::linkThisScript(array('popView' => ''));
 
                        // "Module name":
                $this->MCONF['name']='xMOD_wizard_rte.php';
@@ -158,7 +157,7 @@ class SC_wizard_rte {
                        $tceforms->colorScheme[0]=$this->doc->bgColor;  // SPECIAL: Setting background color of the RTE to ordinary background
 
                                // Initialize style for RTE object:
-                       $RTEobj = &t3lib_BEfunc::RTEgetObj();   // Getting reference to the RTE object used to render the field!
+                       $RTEobj = t3lib_BEfunc::RTEgetObj();    // Getting reference to the RTE object used to render the field!
                        if ($RTEobj->ID == 'rte')       {
                                $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';      // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
                        }
@@ -179,7 +178,7 @@ class SC_wizard_rte {
                        if (strcmp($fieldTSConfig['RTEfullScreenWidth'],''))    {
                                $width=$fieldTSConfig['RTEfullScreenWidth'];
                        } else {
-                               $width='500';
+                               $width='100%';
                        }
 
                                // Get the form field and wrap it in the table with the buttons:
@@ -198,7 +197,7 @@ class SC_wizard_rte {
                                </table>';
 
                                // Adding hidden fields:
-                       $formContent.= '<input type="hidden" name="redirect" value="'.htmlspecialchars($R_URI).'" />
+                       $formContent.= '<input type="hidden" name="redirect" value="'.htmlspecialchars($this->R_URI).'" />
                                                <input type="hidden" name="_serialNumber" value="'.md5(microtime()).'" />';
 
 
@@ -251,8 +250,7 @@ class SC_wizard_rte {
                );
 
                if ($this->P['table'] && $this->P['field'] && $this->P['uid'] && $this->checkEditAccess($this->P['table'],$this->P['uid'])) {
-                       $closeUrl = $this->P['returnUrl'];
-                       $R_URI=t3lib_div::linkThisScript(array('popView' => ''));
+                       $closeUrl = t3lib_div::sanitizeLocalUrl($this->P['returnUrl']);
 
                        // Getting settings for the undo button:
                        $undoButton = 0;
@@ -283,8 +281,8 @@ class SC_wizard_rte {
 
                        // Undo/Revert:
                        if ($undoButton)        {
-                               $buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars('window.location.href=\'show_rechis.php?element=' . rawurlencode($this->P['table'] . ':' . $this->P['uid']) . '&revert=' . rawurlencode('field:' . $this->P['field']) . '&sumUp=-1&returnUrl=' . rawurlencode($R_URI) . '\'; return false;') . '">' .
-                                       '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/undo.gif') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge(time() - $undoButtonR['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
+                               $buttons['undo'] = '<a href="#" onclick="' . htmlspecialchars('window.location.href=\'show_rechis.php?element=' . rawurlencode($this->P['table'] . ':' . $this->P['uid']) . '&revert=' . rawurlencode('field:' . $this->P['field']) . '&sumUp=-1&returnUrl=' . rawurlencode($this->R_URI) . '\'; return false;') . '">' .
+                                       '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/undo.gif') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $undoButtonR['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
                                        '</a>';
                        }
 
@@ -328,22 +326,13 @@ class SC_wizard_rte {
        }
 }
 
-// Include extension?
+
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_rte.php'])   {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_rte.php']);
 }
 
 
 
-
-
-
-
-
-
-
-
-
 // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_rte');
 $SOBE->init();