[FEATURE] Improve Backend Logging module
authorDominique Feyer <dominique.feyer@reelpeek.net>
Sat, 9 Jul 2011 07:53:10 +0000 (09:53 +0200)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Sat, 9 Jul 2011 12:08:48 +0000 (14:08 +0200)
- Remove the error sign after the error icons

Resolves: #28014
Change-Id: Ibdcfd7e951ec59fed69e42726422169bf05e3684
Reviewed-on: http://review.typo3.org/3168
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
t3lib/class.t3lib_bedisplaylog.php
typo3/sysext/belog/class.tx_belog_webinfo.php
typo3/sysext/belog/mod/index.php [changed mode: 0644->0755]

index fefa244..41c87c7 100644 (file)
@@ -205,6 +205,16 @@ class t3lib_BEDisplayLog {
                $this->lastActionLabel = '';
        }
 
+       /**
+        * Return the error icon
+        *
+        * @param int $error
+        * @return string
+        */
+       function getErrorIcon($error = 0) {
+               return $GLOBALS['SOBE']->doc->icons($error >= 2 ? 3 : 2);
+       }
+
        /**
         * Formats input string in red-colored font tags
         *
index 02fa4a9..627ba31 100755 (executable)
@@ -121,7 +121,7 @@ class tx_belog_webinfo extends t3lib_extobjbase {
 
                $this->localLang();
 
-               $lF = t3lib_div::makeInstance('logFunctions_ext');
+               $displayLogInstance = t3lib_div::makeInstance('logFunctions_ext');
 
                $theOutput='';
                $menu='';
@@ -228,7 +228,7 @@ class tx_belog_webinfo extends t3lib_extobjbase {
                } else {
                        $where_part.=' AND userid='.$GLOBALS['BE_USER']->user['uid'];   // Self user
                }
-               $lF->be_user_Array = &$this->pObj->be_user_Array;
+               $displayLogInstance->be_user_Array = &$this->pObj->be_user_Array;
 
                if ($GLOBALS['BE_USER']->workspace!==0) {
                        $where_part.=' AND workspace='.intval($GLOBALS['BE_USER']->workspace);
@@ -238,7 +238,7 @@ class tx_belog_webinfo extends t3lib_extobjbase {
                        // Select 100 recent log entries:
                $log = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', '1=1'.$where_part, '', 'uid DESC', 100);
 
-               $codeArr = $lF->initArray();
+               $codeArr = $displayLogInstance->initArray();
                $oldHeader = '';
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($log))       {
                        $header = $this->pObj->doc->formatTime($row['tstamp'],10);
@@ -247,18 +247,18 @@ class tx_belog_webinfo extends t3lib_extobjbase {
                        if ($header!=$oldHeader)        {
                                $theOutput.=$this->pObj->doc->spacer(10);
                                $theOutput.=$this->pObj->doc->section($oldHeader,$this->pObj->doc->table($codeArr));
-                               $codeArr=$lF->initArray();
+                               $codeArr = $displayLogInstance->initArray();
                                $oldHeader=$header;
-                               $lF->reset();
+                               $displayLogInstance->reset();
                        }
 
                        $i++;
-                       $codeArr[$i][]=$lF->getTimeLabel($row['tstamp']);
-                       $codeArr[$i][]=$lF->getUserLabel($row['userid'],$row['workspace']);
-                       $codeArr[$i][]=$row['error'] ? $lF->getErrorFormatting($lF->errorSign[$row['error']],$row['error']) : '';
-                       $codeArr[$i][]=$lF->getActionLabel($row['type'].'_'.$row['action']);
-                       $codeArr[$i][]=$row['tablename'];
-                       $codeArr[$i][]=$lF->formatDetailsForList($row);
+                       $codeArr[$i][] = $displayLogInstance->getTimeLabel($row['tstamp']);
+                       $codeArr[$i][] = $displayLogInstance->getUserLabel($row['userid'], $row['workspace']);
+                       $codeArr[$i][] = $row['error'] ? $displayLogInstance->getErrorIcon($row['error']) : '';
+                       $codeArr[$i][] = $displayLogInstance->getActionLabel($row['type'] . '_' . $row['action']);
+                       $codeArr[$i][] = $row['tablename'];
+                       $codeArr[$i][] = $displayLogInstance->formatDetailsForList($row);
                }
                $theOutput.=$this->pObj->doc->spacer(10);
                $theOutput.=$this->pObj->doc->section($header,$this->pObj->doc->table($codeArr));
old mode 100644 (file)
new mode 100755 (executable)
index 0a651cc..8900025
@@ -60,7 +60,11 @@ class SC_mod_tools_log_index {
        var $doc;
 
        var $content;
-       var $lF;
+
+       /**
+        * @var t3lib_BEDisplayLog
+        */
+       var $displayLogInstance;
        var $be_user_Array;
 
        var $theTime = 0;
@@ -75,7 +79,7 @@ class SC_mod_tools_log_index {
        function init() {
                $this->MCONF = $GLOBALS['MCONF'];
 
-               $this->lF = t3lib_div::makeInstance('t3lib_BEDisplayLog');
+               $this->displayLogInstance = t3lib_div::makeInstance('t3lib_BEDisplayLog');
 
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
@@ -119,7 +123,7 @@ class SC_mod_tools_log_index {
 
                $this->menuConfig();
                $this->be_user_Array = t3lib_BEfunc::getUserNames();
-               $this->lF->be_user_Array = &$this->be_user_Array;
+               $this->displayLogInstance->be_user_Array = &$this->be_user_Array;
        }
 
        /**
@@ -281,7 +285,7 @@ class SC_mod_tools_log_index {
                ));
 
 
-               $codeArr = $this->lF->initArray();
+               $codeArr = $this->displayLogInstance->initArray();
                $oldHeader='';
                $c=0;
 
@@ -406,8 +410,8 @@ class SC_mod_tools_log_index {
 
 
                foreach($logPids as $pid)       {
-                       $codeArr = $this->lF->initArray();
-                       $this->lF->reset();
+                       $codeArr = $this->displayLogInstance->initArray();
+                       $this->displayLogInstance->reset();
                        $oldHeader='';
 
                        $this->content.=$this->doc->divider(5);
@@ -443,18 +447,18 @@ class SC_mod_tools_log_index {
                                if ($header!=$oldHeader)        {
                                        $this->content.=$this->doc->spacer(10);
                                        $this->content.=$this->doc->section($oldHeader,$this->doc->table($codeArr));
-                                       $codeArr=$this->lF->initArray();
+                                       $codeArr = $this->displayLogInstance->initArray();
                                        $oldHeader=$header;
-                                       $this->lF->reset();
+                                       $this->displayLogInstance->reset();
                                }
 
                                $i++;
-                               $codeArr[$i][]=$this->lF->getTimeLabel($row['tstamp']);
-                               $codeArr[$i][]=$this->lF->getUserLabel($row['userid'],$row['workspace']);
-                               $codeArr[$i][]=$this->lF->getTypeLabel($row['type']);
-                               $codeArr[$i][]=$row['error'] ? $this->lF->getErrorFormatting($this->lF->errorSign[$row['error']],$row['error']) : '';
-                               $codeArr[$i][]=$this->lF->getActionLabel($row['type'].'_'.$row['action']);
-                               $codeArr[$i][]=$this->lF->formatDetailsForList($row);
+                               $codeArr[$i][] = $this->displayLogInstance->getTimeLabel($row['tstamp']);
+                               $codeArr[$i][] = $this->displayLogInstance->getUserLabel($row['userid'], $row['workspace']);
+                               $codeArr[$i][] = $this->displayLogInstance->getTypeLabel($row['type']);
+                               $codeArr[$i][] = $row['error'] ? $this->displayLogInstance->getErrorIcon($row['error']) : '';
+                               $codeArr[$i][] = $this->displayLogInstance->getActionLabel($row['type'] . '_' . $row['action']);
+                               $codeArr[$i][] = $this->displayLogInstance->formatDetailsForList($row);
                        }
                        $this->content.=$this->doc->spacer(10);
                        $this->content.=$this->doc->section($header,$this->doc->table($codeArr));
@@ -541,4 +545,4 @@ $SOBE = t3lib_div::makeInstance('SC_mod_tools_log_index');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>