Added feature #15783: Improve ExtJS skin: Tabs
[Packages/TYPO3.CMS.git] / typo3 / alt_doc.php
index 300bb5d..ae11003 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2010 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
  * which allows the user to edit the content of one or more database records.
  *
  * $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]
@@ -78,9 +78,9 @@
  */
 
 
-require('init.php');
-require('template.php');
-$LANG->includeLLFile('EXT:lang/locallang_alt_doc.xml');
+require_once('init.php');
+require_once('template.php');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_alt_doc.xml');
 
 t3lib_BEfunc::lockRecords();
 
@@ -91,7 +91,7 @@ t3lib_BEfunc::lockRecords();
  * Script Class: Drawing the editing form for editing records in TYPO3.
  * Notice: It does NOT use tce_db.php to submit data to, rather it handles submissions itself
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -193,7 +193,7 @@ class SC_alt_doc {
                $this->defVals = t3lib_div::_GP('defVals');
                $this->overrideVals = t3lib_div::_GP('overrideVals');
                $this->columnsOnly = t3lib_div::_GP('columnsOnly');
-               $this->returnUrl = t3lib_div::_GP('returnUrl');
+               $this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
                $this->closeDoc = t3lib_div::_GP('closeDoc');
                $this->doSave = t3lib_div::_GP('doSave');
                $this->returnEditConf = t3lib_div::_GP('returnEditConf');
@@ -981,10 +981,15 @@ class SC_alt_doc {
        function functionMenus()        {
                global $LANG;
 
+               if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShowPalettes')) {
                        // Show palettes:
-               return '
-                               <!-- Function menus (checkboxes for selecting options): -->
+                       return '
+                               <!-- Function menu (checkbox for showing all palettes): -->
                                <br />'.t3lib_BEfunc::getFuncCheck('','SET[showPalettes]',$this->MOD_SETTINGS['showPalettes'],'alt_doc.php',t3lib_div::implodeArrayForUrl('',array_merge($this->R_URL_getvars,array('SET'=>''))),'id="checkShowPalettes"').'<label for="checkShowPalettes">'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPalettes',1).'</label>';
+               }
+               else {
+                       return '';
+               }
        }
 
 
@@ -1184,7 +1189,7 @@ class SC_alt_doc {
                        if (is_array($localizedRecord)) {
                                        // Create parameters and finally run the classic page module for creating a new page translation
                                $params = '&edit['.$table.']['.$localizedRecord['uid'].']=edit';
-                               $returnUrl = '&returnUrl='.rawurlencode(t3lib_div::_GP('returnUrl'));
+                               $returnUrl = '&returnUrl='.rawurlencode(t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl')));
                                $location = $GLOBALS['BACK_PATH'].'alt_doc.php?'.$params.$returnUrl;
 
                                t3lib_utility_Http::redirect($location);