Follow-up to bug #12499: re-added the removed function call and moved the deprecation...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_bedisplaylog.php
index f6e7422..eadd833 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -89,7 +89,7 @@ class t3lib_BEDisplayLog {
        var $errorSign = Array(
                1 => '!',
                2 => 'Sys!',
-               3 => 'Secur!'
+               3 => 'Security!'
        );
        var $wsArray = array(
                0 => 'LIVE',
@@ -108,7 +108,7 @@ class t3lib_BEDisplayLog {
                $codeArr[0][]='Time';   // Time
                $codeArr[0][]='User';
                $codeArr[0][]='Type';
-               $codeArr[0][]='E';
+               $codeArr[0][]='Error';
                $codeArr[0][]='Action';
                $codeArr[0][]='Details';
                return $codeArr;
@@ -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,11 @@ 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'))) . '">' .
+                                       '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/history2.gif', 'width="13" height="12"') .
+                                       ' title="' . $GLOBALS['LANG']->getLL('showHistory') . '" alt="" />' .
                                        '</a>';
                }
 
@@ -232,7 +240,7 @@ class t3lib_BEDisplayLog {
         * @return      string          Input wrapped in red font-tag and bold
         */
        function getErrorFormatting($sign, $error=0)    {
-               return $GLOBALS['SOBE']->doc->icons($error>=2 ? 3:2).$sign;
+               return $GLOBALS['SOBE']->doc->icons($error>=2 ? 3:2).' '.$sign;
        }
 
        /**