Fixed bug #14968: Add unit tests for t3lib_div::validIP (Thanks to Nikolas Hagelstein...
[Packages/TYPO3.CMS.git] / typo3 / class.show_rechis.inc
old mode 100755 (executable)
new mode 100644 (file)
index eafa03a..245bdfc
@@ -95,8 +95,7 @@ class recordHistory {
                        $this->createChangeLog();
                        $completeDiff = $this->createMultipleDiff();
                        $this->performRollback($completeDiff);
-                       Header ('Location: '.t3lib_div::locationHeaderUrl($this->returnUrl));
-                       exit;
+                       t3lib_utility_Http::redirect($this->returnUrl);
                }
 
                        // 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')     {
-                       $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']));
                }
@@ -347,7 +346,7 @@ class recordHistory {
                $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>
@@ -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;
 
-               $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();
@@ -389,8 +388,8 @@ class recordHistory {
                                $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>';
                        }
 
@@ -406,11 +405,11 @@ class recordHistory {
                        $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[] = 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
 
@@ -444,11 +443,10 @@ class recordHistory {
                                $singleLine[] = '';
                        }
 
-                       $bgColorClass = $entry['snapshot'] ? 'bgColor2' : 'bgColor4-20';
                                // 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>';
                }
 
@@ -457,15 +455,23 @@ class recordHistory {
                        <!--
                                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)        {
-                       $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.
-               $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'],'');
@@ -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
-                                       $record .= '<b>'.$LANG->getLL('delete',1).'</b>';
+                                       $record .= '<strong>'.$LANG->getLL('delete',1).'</strong>';
                                        $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