Fixed bug #14771: Updates for taskcenter, sys_action, impexp (Thanks to Georg Ringer)
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_bedisplaylog.php
index 6e47bf8..757f44a 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2010 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -121,11 +121,15 @@ class t3lib_BEDisplayLog {
         * @return      string          If the timestamp was also shown last time, then "." is returned. Otherwise the new timestamp formatted with ->doc->formatTime()
         */
        function getTimeLabel($code)    {
-               $t=$GLOBALS['SOBE']->doc->formatTime($code,1);
+               #$t=$GLOBALS['SOBE']->doc->formatTime($code,1);
+               $t = date('H:i:s',$code);
+
                if ($this->lastTimeLabel!=$t)   {
                        $this->lastTimeLabel=$t;
                        return $t;
-               } else return '.';
+               } else {
+                       return '.';
+               }
 
        }
 
@@ -141,7 +145,7 @@ class t3lib_BEDisplayLog {
                        $this->lastUserLabel=$code.'_'.$workspace;
                        $label = $this->be_user_Array[$code]['username'];
                        $ws = $this->wsArray[$workspace];
-                       return ($label ? $label : '['.$code.']').'@'.($ws?$ws:$workspace);
+                       return ($label ? htmlspecialchars($label) : '['.$code.']').'@'.($ws?$ws:$workspace);
                } else return '.';
        }
 
@@ -163,13 +167,13 @@ class t3lib_BEDisplayLog {
         * Get action label for log listing
         *
         * @param       string          Key for the action label in locallang
-        * @return      string          If labe is different from last action label then the label is returned, otherwise "."
+        * @return      string          If label is different from last action label then the label is returned, otherwise "."
         */
        function getActionLabel($code)  {
                if ($this->lastActionLabel!=$code)      {
                        $this->lastActionLabel=$code;
                        $label=$GLOBALS['LANG']->getLL('action_'.$code);
-                       return $label ? $label : '['.$code.']';
+                       return $label ? htmlspecialchars($label) : '['.$code.']';
                } else return '.';
        }
 
@@ -188,11 +192,13 @@ class t3lib_BEDisplayLog {
                if (is_array($data))    {
                        if ($this->detailsOn)   {
                                if (is_object($GLOBALS['LANG']))        {
-                                       $label = $GLOBALS['LANG']->getLL('msg_'.$code);
+#                                      $label = $GLOBALS['LANG']->getLL('msg_'.$code);
                                } else {
                                        list($label) = explode(',',$text);
                                }
-                               if ($label)     {$text=$label;}
+                               if ($label)     {
+                                       $text=$label;
+                               }
                                $text = sprintf($text, htmlspecialchars($data[0]),htmlspecialchars($data[1]),htmlspecialchars($data[2]),htmlspecialchars($data[3]),htmlspecialchars($data[4]));
                        } else {
                                $text = str_replace('%s','',$text);
@@ -203,9 +209,13 @@ class t3lib_BEDisplayLog {
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,fieldlist', 'sys_history', 'sys_log_uid='.intval($sys_log_uid));
                $newRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
                if (is_array($newRow))  {
-                       $text.=' Changes in fields: <em>'.$newRow['fieldlist'].'</em>.';
-                       $text.=' <a href="'.htmlspecialchars($GLOBALS['BACK_PATH'].'show_rechis.php?sh_uid='.$newRow['uid'].'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
-                                       '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/history2.gif','width="13" height="12"').' title="Show History" alt="" />'.
+                       $text .= ' ' . sprintf($GLOBALS['LANG']->getLL('changesInFields'), '<em>' . $newRow['fieldlist'] . '</em>');
+                       $text .= ' <a href="' . htmlspecialchars($GLOBALS['BACK_PATH'] . 'show_rechis.php?sh_uid=' . $newRow['uid'] .
+                                       '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' .
+                                       t3lib_iconWorks::getSpriteIcon(
+                                               'actions-document-history-open',
+                                               array('title' => $GLOBALS['LANG']->getLL('showHistory'))
+                                       ) .
                                        '</a>';
                }
 
@@ -260,7 +270,7 @@ class t3lib_BEDisplayLog {
         */
        function stripPath($inArr)      {
                if ($this->stripPath && is_array($inArr))       {
-                       while(list($key,$val)=each($inArr))     {
+                       foreach ($inArr as $key => $val) {
                                $inArr[$key]=basename($val);
                        }
                }