Fixed bug #16049: Loading mask doesn't disappear on hitting Esc/cancel loading
[Packages/TYPO3.CMS.git] / typo3 / class.show_rechis.inc
index eafa03a..33f17b7 100644 (file)
@@ -2,8 +2,8 @@
 /***************************************************************
 *  Copyright notice
 *
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
-*  (c) 2006-2009 Sebastian Kurfuerst (sebastian@garbage-group.de)
+*  (c) 1999-2009 Kasper Skårhøj (kasperYYYY@typo3.com)
+*  (c) 2006-2009 Sebastian Kurfürst (sebastian@garbage-group.de)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  * $Id$
  * XHTML Compliant
  *
  * $Id$
  * XHTML Compliant
  *
- * @author     Sebastian Kurfuerst <sebastian@garbage-group.de>
+ * @author     Sebastian Kurfürst <sebastian@garbage-group.de>
  */
 
 
 /**
  * Class for the record history display script (show_rechis.php)
  *
  */
 
 
 /**
  * Class for the record history display script (show_rechis.php)
  *
- * @author     Sebastian Kurfuerst <sebastian@garbage-group.de>
+ * @author     Sebastian Kurfürst <sebastian@garbage-group.de>
  * @package TYPO3
  * @subpackage core
  */
  * @package TYPO3
  * @subpackage core
  */
@@ -65,7 +65,7 @@ class recordHistory {
        function recordHistory()        {
                        // GPvars:
                $this->element = t3lib_div::_GP('element');
        function recordHistory()        {
                        // GPvars:
                $this->element = t3lib_div::_GP('element');
-               $this->returnUrl = t3lib_div::_GP('returnUrl');
+               $this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
                $this->lastSyslogId = t3lib_div::_GP('diff');
                $this->rollbackFields = t3lib_div::_GP('rollbackFields');
                        // resolve sh_uid if set
                $this->lastSyslogId = t3lib_div::_GP('diff');
                $this->rollbackFields = t3lib_div::_GP('rollbackFields');
                        // resolve sh_uid if set
@@ -95,8 +95,7 @@ class recordHistory {
                        $this->createChangeLog();
                        $completeDiff = $this->createMultipleDiff();
                        $this->performRollback($completeDiff);
                        $this->createChangeLog();
                        $completeDiff = $this->createMultipleDiff();
                        $this->performRollback($completeDiff);
-                       Header ('Location: '.t3lib_div::locationHeaderUrl($this->returnUrl));
-                       exit;
+                       t3lib_utility_Http::redirect($this->returnUrl);
                }
 
                        // save snapshot
                }
 
                        // save snapshot
@@ -325,7 +324,7 @@ class recordHistory {
                        // get link to page history if the element history is shown
                $elParts = explode(':',$this->element);
                if ($elParts[0] != 'pages')     {
                        // get link to page history if the element history is shown
                $elParts = explode(':',$this->element);
                if ($elParts[0] != 'pages')     {
-                       $content .= '<b>'.$LANG->getLL('elementHistory',1).'</b><br />';
+                       $content .= '<strong>'.$LANG->getLL('elementHistory',1).'</strong><br />';
                        $pid = t3lib_BEfunc::getRecordRaw($elParts[0],'uid='.intval($elParts[1]));
                        $content .= $this->linkPage($LANG->getLL('elementHistory_link',1),array('element' => 'pages:'.$pid['pid']));
                }
                        $pid = t3lib_BEfunc::getRecordRaw($elParts[0],'uid='.intval($elParts[1]));
                        $content .= $this->linkPage($LANG->getLL('elementHistory_link',1),array('element' => 'pages:'.$pid['pid']));
                }
@@ -347,7 +346,7 @@ class recordHistory {
                $lines=array();
 
                        // Initialize:
                $lines=array();
 
                        // Initialize:
-               $lines[] = '<tr class="bgColor5 c-head">
+               $lines[] = '<tr class="t3-row-header">
                                <td> </td>
                                <td>'.$LANG->getLL('time',1).'</td>
                                <td>'.$LANG->getLL('age',1).'</td>
                                <td> </td>
                                <td>'.$LANG->getLL('time',1).'</td>
                                <td>'.$LANG->getLL('age',1).'</td>
@@ -368,7 +367,7 @@ class recordHistory {
                $tmpTsConfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN',t3lib_BEfunc::getPagesTSconfig($pid));
                $expirationTime = isset($tmpTsConfig['properties']['default.']['history.']['maxAgeDays']) ? $tmpTsConfig['properties']['default.']['history.']['maxAgeDays'] : 30;
 
                $tmpTsConfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN',t3lib_BEfunc::getPagesTSconfig($pid));
                $expirationTime = isset($tmpTsConfig['properties']['default.']['history.']['maxAgeDays']) ? $tmpTsConfig['properties']['default.']['history.']['maxAgeDays'] : 30;
 
-               $expirationTimestamp = $expirationTime ? (time() - 60*60*24*$expirationTime) : 0;
+               $expirationTimestamp = $expirationTime ? ($GLOBALS['EXEC_TIME'] - 60 * 60 * 24 * $expirationTime) : 0;
                $expirationWarning = 0;
 
                $be_user_array = t3lib_BEfunc::getUserNames();
                $expirationWarning = 0;
 
                $be_user_array = t3lib_BEfunc::getUserNames();
@@ -389,8 +388,8 @@ class recordHistory {
                                $expirationWarning = 1;
 
                                $lines[] = '
                                $expirationWarning = 1;
 
                                $lines[] = '
-                               <tr class="bgColor4-20">
-                                       <td colspan="7"><b>'.$LANG->getLL('consistenceWarning',1).'</b></td>
+                               <tr class="c-headLine">
+                                       <td colspan="7"><strong>'.$LANG->getLL('consistenceWarning',1).'</strong></td>
                                </tr>';
                        }
 
                                </tr>';
                        }
 
@@ -406,11 +405,11 @@ class recordHistory {
                        $singleLine = array();
 
                                // diff link
                        $singleLine = array();
 
                                // diff link
-                       $image = '<img'.t3lib_iconWorks::skinImg('','gfx/button_top_right.gif').' align="top" alt="'.$LANG->getLL('sumUpChanges',1).'" title="'.$LANG->getLL('sumUpChanges',1).'" />';
+                       $image = t3lib_iconWorks::getSpriteIcon('actions-view-go-forward', array('title' => $LANG->getLL('sumUpChanges', TRUE)));
                        $singleLine[] = '<span>'.$this->linkPage($image,array('diff' => $sysLogUid)).'</span>'; // remove first link
 
                        $singleLine[] = htmlspecialchars(t3lib_BEfunc::datetime($entry['tstamp']));     // add time
                        $singleLine[] = '<span>'.$this->linkPage($image,array('diff' => $sysLogUid)).'</span>'; // remove first link
 
                        $singleLine[] = htmlspecialchars(t3lib_BEfunc::datetime($entry['tstamp']));     // add time
-                       $singleLine[] = htmlspecialchars(t3lib_BEfunc::calcAge(time()-$entry['tstamp'],$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')));  // add age
+                       $singleLine[] = htmlspecialchars(t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $entry['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')));        // add age
                        $singleLine[] = htmlspecialchars($userName);    // add user name
                        $singleLine[] = $this->linkPage($this->generateTitle($entry['tablename'],$entry['recuid']),array('element' => $entry['tablename'].':'.$entry['recuid']),'',$LANG->getLL('linkRecordHistory',1));        // add record UID
 
                        $singleLine[] = htmlspecialchars($userName);    // add user name
                        $singleLine[] = $this->linkPage($this->generateTitle($entry['tablename'],$entry['recuid']),array('element' => $entry['tablename'].':'.$entry['recuid']),'',$LANG->getLL('linkRecordHistory',1));        // add record UID
 
@@ -444,11 +443,10 @@ class recordHistory {
                                $singleLine[] = '';
                        }
 
                                $singleLine[] = '';
                        }
 
-                       $bgColorClass = $entry['snapshot'] ? 'bgColor2' : 'bgColor4-20';
                                // put line together
                        $lines[] = '
                                // put line together
                        $lines[] = '
-                               <tr class="'.$bgColorClass.'">
-                                       <td>'.implode('</td><td>',$singleLine).'</td>
+                               <tr class="db_list_normal">
+                                       <td>' . implode('</td><td>', $singleLine) . '</td>
                                </tr>';
                }
 
                                </tr>';
                }
 
@@ -457,15 +455,23 @@ class recordHistory {
                        <!--
                                History (list):
                        -->
                        <!--
                                History (list):
                        -->
-                       <table border="0" cellpadding="2" cellspacing="2" id="typo3-history">
-                               '.implode('',$lines).'
+                       <table class="typo3-dblist" border="0" cellpadding="0" cellspacing="0" id="typo3-history">
+                               ' . implode('', $lines) . '
                        </table>';
 
                if ($this->lastSyslogId)        {
                        </table>';
 
                if ($this->lastSyslogId)        {
-                       $theCode .= '<br />' .  $this->linkPage('<img'.t3lib_iconWorks::skinImg('','gfx/group_tobottom.gif').' alt="'.$LANG->getLL('fullView',1).'" title="'.$LANG->getLL('fullView',1).'" />',array('diff' => ''));
+                       $theCode .= '<br />' .  $this->linkPage(t3lib_iconWorks::getSpriteIcon('actions-move-to-bottom', array('title' => $LANG->getLL('fullView', TRUE))), array('diff' => ''));
                }
                }
+
                        // Add message about the difference view.
                        // Add message about the difference view.
-               $theCode .= '<br /><img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.$LANG->getLL('differenceMsg').'<br /><br />';
+               $flashMessage = t3lib_div::makeInstance(
+                       't3lib_FlashMessage',
+                       $GLOBALS['LANG']->getLL('differenceMsg'),
+                       '',
+                       t3lib_FlashMessage::INFO
+               );
+
+               $theCode .= '<br /><br />' . $flashMessage->render() . '<br />';
 
                        // Add CSH:
                $theCode .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_'.($this->sumUp ? 'sum' : 'log'), $GLOBALS['BACK_PATH'],'');
 
                        // Add CSH:
                $theCode .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'history_'.($this->sumUp ? 'sum' : 'log'), $GLOBALS['BACK_PATH'],'');
@@ -494,10 +500,10 @@ class recordHistory {
                                $elParts = explode(':',$key);
                                        // turn around diff because it should be a "rollback preview"
                                if ($diff['insertsDeletes'][$key] == 1) {       // insert
                                $elParts = explode(':',$key);
                                        // turn around diff because it should be a "rollback preview"
                                if ($diff['insertsDeletes'][$key] == 1) {       // insert
-                                       $record .= '<b>'.$LANG->getLL('delete',1).'</b>';
+                                       $record .= '<strong>'.$LANG->getLL('delete',1).'</strong>';
                                        $record .= '<br />';
                                } elseif ($diff['insertsDeletes'][$key] == -1)  {
                                        $record .= '<br />';
                                } elseif ($diff['insertsDeletes'][$key] == -1)  {
-                                       $record .= '<b>'.$LANG->getLL('insert',1).'</b>';
+                                       $record .= '<strong>'.$LANG->getLL('insert',1).'</strong>';
                                        $record .= '<br />';
                                }
                                        // build up temporary diff array
                                        $record .= '<br />';
                                }
                                        // build up temporary diff array