Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

t3lib_BEDisplayLog Class Reference

List of all members.

Public Member Functions

 initArray ()
 Initialize the log table array with header labels.
 getTimeLabel ($code)
 Get time label for log listing.
 getUserLabel ($code)
 Get user name label for log listing.
 getTypeLabel ($code)
 Get type label for log listing.
 getActionLabel ($code)
 Get action label for log listing.
 getDetails ($code, $text, $data, $sys_log_uid=0)
 Get details for the log entry.
 reset ()
 Reset all internal "last..." variables to blank string.
 getErrorFormatting ($sign)
 Formats input string in red-colored font tags.
 formatDetailsForList ($row)
 Formatting details text for the sys_log row inputted.
 stripPath ($inArr)
 For all entries in the $inArray (expected to be filepaths) the basename is extracted and set as value (if $this->stripPath is set) This is done for log-entries from the FILE modules.

Public Attributes

 $lastTimeLabel = ''
 $lastUserLabel = ''
 $lastTypeLabel = ''
 $lastActionLabel = ''
 $detailsOn = 1
 $stripPath = 1
 $errorSign
 $be_user_Array = array()

Member Function Documentation

t3lib_BEDisplayLog::formatDetailsForList row  ) 
 

Formatting details text for the sys_log row inputted.

Parameters:
array sys_log row
Returns:
string Details string

Definition at line 236 of file class.t3lib_bedisplaylog.php.

References getDetails(), and stripPath().

00236                                        {
00237       $data = unserialize($row['log_data']);
00238       if ($row['type']==2) {
00239          $data=$this->stripPath($data);
00240       }
00241 
00242       return $this->getDetails($row['type'].'_'.$row['action'].'_'.$row['details_nr'],$row['details'],$data,$row['uid']).' ('.$row['details_nr'].')';
00243    }

t3lib_BEDisplayLog::getActionLabel code  ) 
 

Get action label for log listing.

Parameters:
string Key for the action label in locallang
Returns:
string If labe is different from last action label then the label is returned, otherwise "."

Definition at line 162 of file class.t3lib_bedisplaylog.php.

00162                                     {
00163       if ($this->lastActionLabel!=$code)  {
00164          $this->lastActionLabel=$code;
00165          $label=$GLOBALS['LANG']->getLL('action_'.$code);
00166          return $label ? $label : '['.$code.']';
00167       } else return '.';
00168    }

t3lib_BEDisplayLog::getDetails code,
text,
data,
sys_log_uid = 0
 

Get details for the log entry.

Parameters:
string Suffix to "msg_" to get label from locallang.
string Details text
array Data array
integer sys_log uid number
Returns:
string Text string
See also:
formatDetailsForList()

Definition at line 180 of file class.t3lib_bedisplaylog.php.

Referenced by formatDetailsForList().

00180                                                          {
00181          // $code is used later on to substitute errormessages with language-corrected values...
00182       if (is_array($data)) {
00183          if ($this->detailsOn)   {
00184             if (is_object($GLOBALS['LANG'])) {
00185                $label = $GLOBALS['LANG']->getLL('msg_'.$code);
00186             } else {
00187                list($label) = explode(',',$text);
00188             }
00189             if ($label) {$text=$label;}
00190             $text = sprintf($text, htmlspecialchars($data[0]),htmlspecialchars($data[1]),htmlspecialchars($data[2]),htmlspecialchars($data[3]),htmlspecialchars($data[4]));
00191          } else {
00192             $text = str_replace('%s','',$text);
00193          }
00194       }
00195 
00196          // Finding the history for the record
00197       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,fieldlist', 'sys_history', 'sys_log_uid='.intval($sys_log_uid));
00198       $newRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
00199       if (is_array($newRow))  {
00200          $text.=' Changes in fields: <em>'.$newRow['fieldlist'].'</em>.';
00201          $text.=' <a href="'.htmlspecialchars($GLOBALS['BACK_PATH'].'show_rechis.php?sh_uid='.$newRow['uid'].'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'"><b>->His</b></a>';
00202       }
00203 
00204       return $text;
00205    }

t3lib_BEDisplayLog::getErrorFormatting sign  ) 
 

Formats input string in red-colored font tags.

Parameters:
string Input value
Returns:
string Input wrapped in red font-tag and bold

Definition at line 226 of file class.t3lib_bedisplaylog.php.

00226                                        {
00227       return '<font color="red"><b>'.$sign.'</b></font>';
00228    }

t3lib_BEDisplayLog::getTimeLabel code  ) 
 

Get time label for log listing.

Parameters:
integer Timestamp to display
Returns:
string If the timestamp was also shown last time, then "." is returned. Otherwise the new timestamp formatted with ->doc->formatTime()

Definition at line 119 of file class.t3lib_bedisplaylog.php.

00119                                  {
00120       $t=$GLOBALS['SOBE']->doc->formatTime($code,1);
00121       if ($this->lastTimeLabel!=$t) {
00122          $this->lastTimeLabel=$t;
00123          return $t;
00124       } else return '.';
00125 
00126    }

t3lib_BEDisplayLog::getTypeLabel code  ) 
 

Get type label for log listing.

Parameters:
string Key for the type label in locallang
Returns:
string If labe is different from last type label then the label is returned, otherwise "."

Definition at line 148 of file class.t3lib_bedisplaylog.php.

00148                                  {
00149       if ($this->lastTypeLabel!=$code) {
00150          $this->lastTypeLabel=$code;
00151          $label=$GLOBALS['LANG']->getLL('type_'.$code);
00152          return $label ? $label : '['.$code.']';
00153       } else return '.';
00154    }

t3lib_BEDisplayLog::getUserLabel code  ) 
 

Get user name label for log listing.

Parameters:
integer be_user uid
Returns:
string If username is different from last username then the username, otherwise "."

Definition at line 134 of file class.t3lib_bedisplaylog.php.

00134                                  {
00135       if ($this->lastUserLabel!=$code) {
00136          $this->lastUserLabel=$code;
00137          $label = $this->be_user_Array[$code]['username'];
00138          return $label ? $label : '['.$code.']';
00139       } else return '.';
00140    }

t3lib_BEDisplayLog::initArray  ) 
 

Initialize the log table array with header labels.

Returns:
array

Definition at line 102 of file class.t3lib_bedisplaylog.php.

00102                         {
00103       $codeArr=Array();
00104       $codeArr[0][]='Time';   // Time
00105       $codeArr[0][]='User';
00106       $codeArr[0][]='Type';
00107       $codeArr[0][]='E';
00108       $codeArr[0][]='Action';
00109       $codeArr[0][]='Details';
00110       return $codeArr;
00111    }

t3lib_BEDisplayLog::reset  ) 
 

Reset all internal "last..." variables to blank string.

Returns:
void

Definition at line 212 of file class.t3lib_bedisplaylog.php.

00212                      {
00213       $this->lastTimeLabel='';
00214       $this->lastUserLabel='';
00215       $this->lastTypeLabel='';
00216       $this->lastActionLabel='';
00217    }

t3lib_BEDisplayLog::stripPath inArr  ) 
 

For all entries in the $inArray (expected to be filepaths) the basename is extracted and set as value (if $this->stripPath is set) This is done for log-entries from the FILE modules.

Parameters:
array Array of file paths
Returns:
array
See also:
formatDetailsForList()

Definition at line 253 of file class.t3lib_bedisplaylog.php.

References stripPath().

Referenced by formatDetailsForList(), and stripPath().

00253                               {
00254       if ($this->stripPath && is_array($inArr)) {
00255          while(list($key,$val)=each($inArr)) {
00256             $inArr[$key]=basename($val);
00257          }
00258       }
00259       return $inArr;
00260    }


Member Data Documentation

t3lib_BEDisplayLog::$be_user_Array = array()
 

Definition at line 95 of file class.t3lib_bedisplaylog.php.

t3lib_BEDisplayLog::$detailsOn = 1
 

Definition at line 87 of file class.t3lib_bedisplaylog.php.

t3lib_BEDisplayLog::$errorSign
 

Initial value:

 Array(
      1 => '!',
      2 => 'Sys!',
      3 => 'Secur!'
   )

Definition at line 89 of file class.t3lib_bedisplaylog.php.

t3lib_BEDisplayLog::$lastActionLabel = ''
 

Definition at line 85 of file class.t3lib_bedisplaylog.php.

t3lib_BEDisplayLog::$lastTimeLabel = ''
 

Definition at line 82 of file class.t3lib_bedisplaylog.php.

t3lib_BEDisplayLog::$lastTypeLabel = ''
 

Definition at line 84 of file class.t3lib_bedisplaylog.php.

t3lib_BEDisplayLog::$lastUserLabel = ''
 

Definition at line 83 of file class.t3lib_bedisplaylog.php.

t3lib_BEDisplayLog::$stripPath = 1
 

Definition at line 88 of file class.t3lib_bedisplaylog.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 3 01:06:37 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913