Added feature #15783: Improve ExtJS skin: Tabs
[Packages/TYPO3.CMS.git] / typo3 / alt_doc.php
index e1d09ff..ae11003 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2009 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]
  */
 
 
-require('init.php');
-require('template.php');
-$LANG->includeLLFile('EXT:lang/locallang_alt_doc.xml');
-require_once (PATH_t3lib.'class.t3lib_tceforms.php');
-require_once (PATH_t3lib.'class.t3lib_clipboard.php');
-
-require_once (PATH_t3lib.'class.t3lib_tcemain.php');
-require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');
-require_once (PATH_t3lib.'class.t3lib_transferdata.php');
-
+require_once('init.php');
+require_once('template.php');
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_alt_doc.xml');
 
 t3lib_BEfunc::lockRecords();
 
@@ -98,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
  */
@@ -200,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');
@@ -253,7 +246,7 @@ class SC_alt_doc {
         * @return      boolean         True, then save the document (data submitted)
         */
        function doProcessData()        {
-               $out = $this->doSave || isset($_POST['_savedok_x']) || isset($_POST['_saveandclosedok_x']) || isset($_POST['_savedokview_x']) || isset($_POST['_savedoknew_x']) || isset($_POST['_translation_savedok_x']);
+               $out = $this->doSave || isset($_POST['_savedok_x']) || isset($_POST['_saveandclosedok_x']) || isset($_POST['_savedokview_x']) || isset($_POST['_savedoknew_x']) || isset($_POST['_translation_savedok_x']) || isset($_POST['_translation_savedokclear_x']);
                return $out;
        }
 
@@ -279,9 +272,14 @@ class SC_alt_doc {
                        // Only options related to $this->data submission are included here.
                $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                $tce->stripslashes_values=0;
+
                if (isset($_POST['_translation_savedok_x']))    {
                        $tce->updateModeL10NdiffData = 'FORCE_FFUPD';
                }
+               if (isset($_POST['_translation_savedokclear_x']))       {
+                       $tce->updateModeL10NdiffData = 'FORCE_FFUPD';
+                       $tce->updateModeL10NdiffDataClear = TRUE;
+               }
 
                        // Setting default values specific for the user:
                $TCAdefaultOverride = $BE_USER->getTSConfigProp('TCAdefaults');
@@ -453,7 +451,7 @@ class SC_alt_doc {
                $this->doc->setModuleTemplate('templates/alt_doc.html');
                $this->doc->form = '<form action="'.htmlspecialchars($this->R_URI).'" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';
 
-               $this->doc->loadPrototype();
+               $this->doc->getPageRenderer()->loadPrototype();
                $this->doc->JScode = $this->doc->wrapScriptTags('
                        function jumpToUrl(URL,formEl)  {       //
                                if (!TBE_EDITOR.isFormChanged())        {
@@ -463,8 +461,12 @@ class SC_alt_doc {
                                }
                        }
                                // Object: TS:
+                               // passwordDummy and decimalSign are used by tbe_editor.js and have to be declared here as
+                               // TS object overwrites the object declared in tbe_editor.js
                        function typoSetup      ()      {       //
                                this.uniqueID = "";
+                               this.passwordDummy = "********";
+                               this.decimalSign = ".";
                        }
                        var TS = new typoSetup();
 
@@ -666,7 +668,8 @@ class SC_alt_doc {
                                                                                $CALC_PERMS = $BE_USER->calcPerms($calcPRec);   // Permissions for the parent page
                                                                                if ($table=='pages')    {       // If pages:
                                                                                        $hasAccess = $CALC_PERMS&8 ? 1 : 0;
-                                                                                       $this->viewId = $calcPRec['pid'];
+                                                                                       #$this->viewId = $calcPRec['pid'];
+                                                                                       $this->viewId = 0;
                                                                                } else {
                                                                                        $hasAccess = $CALC_PERMS&16 ? 1 : 0;
                                                                                        $this->viewId = $calcPRec['uid'];
@@ -703,6 +706,18 @@ class SC_alt_doc {
                                                                } else $hasAccess = 0;
                                                        }
 
+                                                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']))       {
+                                                               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck'] as $_funcRef)       {
+                                                                       $_params = array(
+                                                                               'table'         =>      $table,
+                                                                               'uid'           =>      $theUid,
+                                                                               'cmd'           =>      $cmd,
+                                                                               'hasAccess' => $hasAccess
+                                                                       );
+                                                                       $hasAccess = t3lib_div::callUserFunction($_funcRef, $_params, $this);
+                                                               }
+                                                       }
+
                                                        // AT THIS POINT we have checked the access status of the editing/creation of records and we can now proceed with creating the form elements:
 
                                                        if ($hasAccess) {
@@ -767,28 +782,25 @@ class SC_alt_doc {
                                                                        }
 
                                                                                // Display "is-locked" message:
-                                                                       if ($lockInfo = t3lib_BEfunc::isRecordLocked($table,$rec['uid']))       {
-                                                                               $lockIcon = '
-
-                                                                                       <!-- Warning box: -->
-                                                                                       <table border="0" cellpadding="0" cellspacing="0" class="warningbox">
-                                                                                               <tr>
-                                                                                                       <td><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/recordlock_warning3.gif','width="17" height="12"').' alt="" /></td>
-                                                                                                       <td>'.htmlspecialchars($lockInfo['msg']).'</td>
-                                                                                               </tr>
-                                                                                       </table>
-                                                                               ';
-                                                                       } else $lockIcon = '';
+                                                                       if ($lockInfo = t3lib_BEfunc::isRecordLocked($table, $rec['uid'])) {
+                                                                               $lockedMessage = t3lib_div::makeInstance(
+                                                                                       't3lib_FlashMessage',
+                                                                                       htmlspecialchars($lockInfo['msg']),
+                                                                                       '',
+                                                                                       t3lib_FlashMessage::WARNING
+                                                                               );
+                                                                               t3lib_FlashMessageQueue::addMessage($lockedMessage);
+                                                                       }
 
                                                                                // Combine it all:
-                                                                       $editForm.= $lockIcon.$panel;
+                                                                       $editForm .= $panel;
                                                                }
 
                                                                $thePrevUid = $rec['uid'];
                                                        } else {
                                                                $this->errorC++;
                                                                $editForm.=$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.noEditPermission',1).'<br /><br />'.
-                                                                                       ($deniedAccessReason ? 'Reason: '.htmlspecialchars($deniedAccessReason).'<br/><br/>' : '');
+                                                                       ($deniedAccessReason ? 'Reason: ' . htmlspecialchars($deniedAccessReason) . '<br /><br />' : '');
                                                        }
                                                }
                                        }
@@ -817,7 +829,8 @@ class SC_alt_doc {
                        'history' => '',
                        'columns_only' => '',
                        'csh' => '',
-                       'translation_save' => ''
+                       'translation_save' => '',
+                       'translation_saveclear' => ''
                );
 
                        // Render SAVE type buttons:
@@ -825,30 +838,31 @@ class SC_alt_doc {
                if (!$this->errorC && !$TCA[$this->firstEl['table']]['ctrl']['readOnly'])       {
 
                                // SAVE button:
-                       $buttons['save'] = '<input type="image" class="c-inputButton" name="_savedok" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
+                       $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save', array( 'html' => '<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />' ));
 
                                // SAVE / VIEW button:
                        if ($this->viewId && !$this->noView && t3lib_extMgm::isLoaded('cms') && $this->getNewIconMode($this->firstEl['table'], 'saveDocView')) {
-                               $buttons['save_view'] = '<input type="image" class="c-inputButton" name="_savedokview" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedokshow.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', 1) . '" />';
+                               $buttons['save_view'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-view',array('html'=>'<input type="image" class="c-inputButton" name="_savedokview" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', 1) . '" />'));
                        }
 
                                // SAVE / NEW button:
                        if (count($this->elementsData)==1 && $this->getNewIconMode($this->firstEl['table'])) {
-                               $buttons['save_new'] = '<input type="image" class="c-inputButton" name="_savedoknew" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedoknew.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveNewDoc', 1) . '" />';
+                               $buttons['save_new'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-new',array('html'=>'<input type="image" class="c-inputButton" name="_savedoknew" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveNewDoc', 1) . '" />'));
                        }
 
                                // SAVE / CLOSE
-                       $buttons['save_close'] = '<input type="image" class="c-inputButton" name="_saveandclosedok" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />';
+                       $buttons['save_close'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-close',array('html'=>'<input type="image" class="c-inputButton" name="_saveandclosedok" src="clear.gif" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />'));
 
                                // FINISH TRANSLATION / SAVE / CLOSE
                        if ($GLOBALS['TYPO3_CONF_VARS']['BE']['explicitConfirmationOfTranslation'])     {
                                $buttons['translation_save'] = '<input type="image" class="c-inputButton" name="_translation_savedok" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/translationsavedok.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.translationSaveDoc', 1) . '" />';
+                               $buttons['translation_saveclear'] = '<input type="image" class="c-inputButton" name="_translation_savedokclear" src="' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/translationsavedok_clear.gif', '', 1) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.translationSaveDocClear', 1) . '" />';
                        }
                }
 
                        // CLOSE button:
-               $buttons['close'] = '<a href="#" onclick="document.editform.closeDoc.value=1; document.editform.submit(); return false;">'.
-                               '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/closedok.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc',1).'" alt="" />'.
+               $buttons['close'] = '<a href="#" onclick="document.editform.closeDoc.value=1; document.editform.submit(); return false;" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '">' .
+                                       t3lib_iconWorks::getSpriteIcon('actions-document-close') .
                                '</a>';
 
 
@@ -859,8 +873,8 @@ class SC_alt_doc {
                                        // Delete:
                                if ($this->firstEl['deleteAccess'] && !$TCA[$this->firstEl['table']]['ctrl']['readOnly'] && !$this->getNewIconMode($this->firstEl['table'],'disableDelete')) {
                                        $aOnClick = 'return deleteRecord(\''.$this->firstEl['table'].'\',\''.$this->firstEl['uid'].'\',unescape(\''.rawurlencode($this->retUrl).'\'));';
-                                       $buttons['delete'] = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
-                                                       '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/deletedok.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->getLL('deleteItem',1).'" alt="" />'.
+                                       $buttons['delete'] = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'" title="' . $LANG->getLL('deleteItem', TRUE) . '">' .
+                                                       t3lib_iconWorks::getSpriteIcon('actions-edit-delete') .
                                                        '</a>';
                                }
 
@@ -868,22 +882,23 @@ class SC_alt_doc {
                                $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->firstEl['table'], 'sys_history').' AND recuid='.intval($this->firstEl['uid']), '', 'tstamp DESC', '1');
                                if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes))     {
                                        $aOnClick = 'window.location.href=\'show_rechis.php?element='.rawurlencode($this->firstEl['table'].':'.$this->firstEl['uid']).'&revert=ALL_FIELDS&sumUp=-1&returnUrl='.rawurlencode($this->R_URI).'\'; return false;';
-                                       $buttons['undo'] = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
-                                                       '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/undo.gif','width="21" height="16"').' class="c-inputButton" title="'.htmlspecialchars(sprintf($LANG->getLL('undoLastChange'),t3lib_BEfunc::calcAge(time()-$undoButtonR['tstamp'],$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))).'" alt="" />'.
-                                                       '</a>';
+                                       $buttons['undo'] = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"'.
+                                               ' title="' . htmlspecialchars(sprintf($LANG->getLL('undoLastChange'), t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $undoButtonR['tstamp'], $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '">' .
+                                                       t3lib_iconWorks::getSpriteIcon('actions-edit-undo') .
+                                               '</a>';
                                }
                                if ($this->getNewIconMode($this->firstEl['table'],'showHistory'))       {
                                        $aOnClick = 'window.location.href=\'show_rechis.php?element='.rawurlencode($this->firstEl['table'].':'.$this->firstEl['uid']).'&returnUrl='.rawurlencode($this->R_URI).'\'; return false;';
                                        $buttons['history'] = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
-                                                       '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/history2.gif','width="13" height="12"').' class="c-inputButton" alt="" />'.
-                                                       '</a>';
+                                                       t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
+                                               '</a>';
                                }
 
                                        // If only SOME fields are shown in the form, this will link the user to the FULL form:
                                if ($this->columnsOnly) {
-                                       $buttons['columns_only'] = '<a href="'.htmlspecialchars($this->R_URI.'&columnsOnly=').'">'.
-                                                       '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/edit2.gif','width="11" height="12"').' class="c-inputButton" title="'.$LANG->getLL('editWholeRecord',1).'" alt="" />'.
-                                                       '</a>';
+                                       $buttons['columns_only'] = '<a href="'.htmlspecialchars($this->R_URI.'&columnsOnly=').'" title="' . $LANG->getLL('editWholeRecord', TRUE) . '">' .
+                                                       t3lib_iconWorks::getSpriteIcon('actions-document-open') .
+                                               '</a>';
                                }
                        }
                }
@@ -920,7 +935,7 @@ class SC_alt_doc {
 
                if (is_array($this->tceforms->extraFormHeaders)) {
                        $extraTemplate = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, '###DOCHEADER_EXTRAHEADER###');
-                       $extraTemplate = t3lib_parsehtml::substituteMarker($extraTemplate, '###EXTRAHEADER###', implode(chr(10), $this->tceforms->extraFormHeaders));
+                       $extraTemplate = t3lib_parsehtml::substituteMarker($extraTemplate, '###EXTRAHEADER###', implode(LF, $this->tceforms->extraFormHeaders));
                }
                return $extraTemplate;
        }
@@ -966,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 '';
+               }
        }
 
 
@@ -999,8 +1019,9 @@ class SC_alt_doc {
                        return '';
                }
                $aOnClick = 'vHWin=window.open(\''.t3lib_div::linkThisScript(array('returnUrl'=>'close.html')).'\',\''.md5($this->R_URI).'\',\'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
-               return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
-                               '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/open_in_new_window.gif','width="19" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.openInNewWindow',1).'" alt="" /></a>';
+               return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.openInNewWindow', TRUE) . '">' .
+                               t3lib_iconWorks::getSpriteIcon('actions-window-open') .
+                       '</a>';
        }
 
 
@@ -1013,7 +1034,7 @@ class SC_alt_doc {
                if (count($this->tceforms->commentMessages))    {
                        $tceformMessages = '
                                <!-- TCEFORM messages
-                               '.htmlspecialchars(implode(chr(10),$this->tceforms->commentMessages)).'
+                               '.htmlspecialchars(implode(LF,$this->tceforms->commentMessages)).'
                                -->
                        ';
                }
@@ -1073,13 +1094,20 @@ class SC_alt_doc {
                                $fetchFields = 'uid,'.$languageField.','.$transOrigPointerField;
 
                                        // get record in current language
+                               $rowCurrent = t3lib_befunc::getLiveVersionOfRecord($table, $uid, $fetchFields);
+                               if (!is_array($rowCurrent)) {
                                $rowCurrent = t3lib_befunc::getRecord($table, $uid, $fetchFields);
+                               }
+
                                $currentLanguage = $rowCurrent[$languageField];
 
                                if ($currentLanguage>-1)        {       // Disabled for records with [all] language!
                                                // get record in default language if needed
                                        if ($currentLanguage) {
+                                               $rowsByLang[0] = t3lib_befunc::getLiveVersionOfRecord($table, $rowCurrent[$transOrigPointerField], $fetchFields);
+                                               if (!is_array($rowsByLang[0])) {
                                                $rowsByLang[0] = t3lib_befunc::getRecord($table, $rowCurrent[$transOrigPointerField], $fetchFields);
+                                               }
                                        } else {
                                                $rowsByLang[0] = $rowCurrent;
                                        }
@@ -1161,11 +1189,10 @@ 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;
 
-                               header('Location: '.t3lib_div::locationHeaderUrl($location));
-                               exit;
+                               t3lib_utility_Http::redirect($location);
                        }
                }
        }
@@ -1366,9 +1393,6 @@ class SC_alt_doc {
        function getNewIconMode($table, $key = 'saveDocNew') {
                $TSconfig = $GLOBALS['BE_USER']->getTSConfig('options.'.$key);
                $output = trim(isset($TSconfig['properties'][$table]) ? $TSconfig['properties'][$table] : $TSconfig['value']);
-               if (($key == 'saveDocNew' || $key == 'saveDocView') && $TSconfig['value'] != '0') {
-                       $output = !(isset($TSconfig['properties'][$table]) && $TSconfig['properties'][$table] == '0');
-               }
                return $output;
        }
 
@@ -1415,8 +1439,7 @@ class SC_alt_doc {
 
                        // If code is NOT set OR set to 1, then make a header location redirect to $this->retUrl
                if (!$code || $code==1) {
-                       Header('Location: '.t3lib_div::locationHeaderUrl($this->retUrl));
-                       exit;
+                       t3lib_utility_Http::redirect($this->retUrl);
                } else {
                        $this->setDocument('',$this->retUrl);
                }
@@ -1445,8 +1468,7 @@ class SC_alt_doc {
                                $retUrl = $sParts['path'].'?'.$setupArr[2].'&returnUrl='.rawurlencode($retUrl);
                        }
                }
-               Header('Location: '.t3lib_div::locationHeaderUrl($retUrl));
-               exit;
+               t3lib_utility_Http::redirect($retUrl);
        }
 }