[BUGFIX] Pootle: Multi-line labels are not rendered properly
[Packages/TYPO3.CMS.git] / typo3 / wizard_rte.php
index 513bb93..348765e 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2010 Kasper Skårhøj (kasperYYYY@typo3.com)
+*  (c) 1999-2011 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 Skårhøj
  * XHTML compliant
  *
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   81: class SC_wizard_rte
- *   99:     function init()
- *  123:     function main()
- *  285:     function printContent()
- *  298:     function checkEditAccess($table,$uid)
- *
- * TOTAL FUNCTIONS: 4
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
 
 
 
 $BACK_PATH='';
 require ('init.php');
 require ('template.php');
-$LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xml');
 
 t3lib_BEfunc::lockRecords();
 
@@ -122,8 +106,6 @@ class SC_wizard_rte {
         * @return      void
         */
        function main() {
-               global $BE_USER,$LANG;
-
                        // translate id to the workspace version:
                if ($versionRec = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $this->P['table'], $this->P['uid'], 'uid')) {
                        $this->P['uid'] = $versionRec['uid'];
@@ -168,8 +150,7 @@ class SC_wizard_rte {
                        $trData->fetchRecord($this->P['table'],$this->P['uid'],'');
 
                                // Getting the processed record content out:
-                       reset($trData->regTableItems_data);
-                       $rec = current($trData->regTableItems_data);
+                       $rec = reset($trData->regTableItems_data);
                        $rec['uid'] = $this->P['uid'];
                        $rec['pid'] = $rawRec['pid'];
 
@@ -198,7 +179,8 @@ class SC_wizard_rte {
 
                                // Adding hidden fields:
                        $formContent.= '<input type="hidden" name="redirect" value="'.htmlspecialchars($this->R_URI).'" />
-                                               <input type="hidden" name="_serialNumber" value="'.md5(microtime()).'" />';
+                                               <input type="hidden" name="_serialNumber" value="'.md5(microtime()).'" />' .
+                                               t3lib_TCEforms::getHiddenTokenField('tceAction');
 
 
                                // Finally, add the whole setup:
@@ -208,7 +190,7 @@ class SC_wizard_rte {
                                $tceforms->printNeededJSFunctions();
                } else {
                                // ERROR:
-                       $this->content.=$this->doc->section($LANG->getLL('forms_title'),'<span class="typo3-red">'.$LANG->getLL('table_noData',1).'</span>',0,1);
+                       $this->content.=$this->doc->section($GLOBALS['LANG']->getLL('forms_title'),'<span class="typo3-red">'.$GLOBALS['LANG']->getLL('table_noData',1).'</span>',0,1);
                }
 
                // Setting up the buttons and markers for docheader
@@ -303,22 +285,21 @@ class SC_wizard_rte {
         * @return      void
         */
        function checkEditAccess($table,$uid)   {
-               global $BE_USER;
-
                $calcPRec = t3lib_BEfunc::getRecord($table,$uid);
                t3lib_BEfunc::fixVersioningPid($table,$calcPRec);
                if (is_array($calcPRec))        {
                        if ($table=='pages')    {       // If pages:
-                               $CALC_PERMS = $BE_USER->calcPerms($calcPRec);
+                               $CALC_PERMS = $GLOBALS['BE_USER']->calcPerms($calcPRec);
                                $hasAccess = $CALC_PERMS&2 ? TRUE : FALSE;
                        } else {
-                               $CALC_PERMS = $BE_USER->calcPerms(t3lib_BEfunc::getRecord('pages',$calcPRec['pid']));   // Fetching pid-record first.
+                                       // Fetching pid-record first.
+                               $CALC_PERMS = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages',$calcPRec['pid']));
                                $hasAccess = $CALC_PERMS&16 ? TRUE : FALSE;
                        }
 
                                // Check internals regarding access:
                        if ($hasAccess) {
-                               $hasAccess = $BE_USER->recordEditAccessInternals($table, $calcPRec);
+                               $hasAccess = $GLOBALS['BE_USER']->recordEditAccessInternals($table, $calcPRec);
                        }
                } else $hasAccess = FALSE;
 
@@ -327,8 +308,8 @@ class SC_wizard_rte {
 }
 
 
-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']);
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/wizard_rte.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/wizard_rte.php']);
 }