1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 01:54:12 +02:00

Corrected and tested news ping services feature. Now throws messages correctly to the admin , as well as logs correctly to both the e107_system/logs folder and the admin-log.

This commit is contained in:
Cameron
2014-01-12 08:06:29 -08:00
parent 4a9b4c1819
commit 1b7cf701e8
3 changed files with 49 additions and 16 deletions

View File

@@ -544,7 +544,11 @@ class e_admin_log
*/
public function logMessage($text, $type = '', $logLevel = TRUE, $session = FALSE)
{
if(empty($text)) return;
if(empty($text))
{
e107::getMessage()->addDebug("Log Message was empty: ".print_a(debug_backtrace(true)),true);
return $this; // changing to text will break chained methods.
}
if(!$type) $type = E_MESSAGE_INFO;
if($logLevel === TRUE) $logLevel = $type;
@@ -556,7 +560,8 @@ class e_admin_log
$logArray = array('message' => $text, 'dislevel' => $type, 'loglevel' => $logLevel, 'session' => $session, 'time'=>time());
$this->_messages[] = $logArray;
$this->_allMessages[] = $logArray;
$this->_allMessages[] = $logArray;
return $this;
}
@@ -645,12 +650,16 @@ class e_admin_log
* @param $oldArray (optional) - when included, only the changes between the arrays is saved.
* @param $type (optional) default: LOG_MESSAGE_NODISPLAY. or E_MESSAGE_WARNING, E_MESSAGE_NOTICE, E_MESSAGE_SUCCESS
*/
public function addArray($array, $oldArray= null, $type = LOG_MESSAGE_NODISPLAY )
public function addArray($array, $oldArray= null, $type = LOG_MESSAGE_NODISPLAY , $session = false)
{
if(is_array($oldArray))
{
$text = array_diff_recursive($array,$oldArray); // Located in core_functions.php
}
else
{
$text = $array;
}
return $this->logMessage($text, $type, $type, $session);
}