[Shuttlebb-svn] SF.net SVN: shuttlebb: [88] branch/sources/class_message.php
Brought to you by:
afterlife69,
danb00
|
From: <aft...@us...> - 2006-12-10 17:27:43
|
Revision: 88
http://svn.sourceforge.net/shuttlebb/?rev=88&view=rev
Author: afterlife69
Date: 2006-12-10 09:26:57 -0800 (Sun, 10 Dec 2006)
Log Message:
-----------
Modified Paths:
--------------
branch/sources/class_message.php
Modified: branch/sources/class_message.php
===================================================================
--- branch/sources/class_message.php 2006-12-10 09:25:11 UTC (rev 87)
+++ branch/sources/class_message.php 2006-12-10 17:26:57 UTC (rev 88)
@@ -13,10 +13,17 @@
*/
/**
+ * @ignore
+ */
+define('ERROR_CRITICAL', 'Critical_Error');
+define('ERROR_MAJOR', 'Major_Error');
+define('ERROR_MINOR', 'Minor_Error');
+define('GENERAL_MESSAGE', 'General_Message');
+
+/**
* Message handler
*
- * @package shuttlebb
- * @subpackage message_handler
+ * @package message_handler
* @author ShuttleBB Development Team <dev...@sh...>
* @author Dean Newman <web...@au...>
*/
@@ -25,17 +32,47 @@
var $message;
var $title;
var $level;
-
var $line;
var $file;
var $sql;
function message_handler($level, $message, $title = '', $line = '', $file = '', $sql = '')
{
+ /**
+ * Set class properties
+ */
+ $this->level = $level;
+ $this->message = $message;
+ $this->title = $title;
+ $this->line = $line;
+ $this->file = $file;
+ $this->sql = $sql;
+
+ /**
+ * Ensure level is set
+ */
+ if ( ! in_array ( $this->level, array(GENERAL_MESSAGE, ERROR_CRITICAL, ERROR_MAJOR, ERROR_MINOR) ) )
+ {
+ $this->level = GENERAL_MESSAGE;
+ }
+
+ /**
+ * Report and display error
+ */
+ if ( in_array ( $this->level, array(ERROR_CRITICAL, ERROR_MAJOR, ERROR_MINOR) ) )
+ {
+ $this->report_error();
+ $this->display_error();
+ }
+ else
+ {
+ }
+
+ return;
}
- function report()
+ function report_error()
{
global $db;
@@ -67,19 +104,34 @@
function sql_insert_log()
{
+ global $db;
+
+ if ( ! is_object($db) )
+ {
+ return;
+ }
}
function file_insert_log()
{
+ if ( ! defined ( 'ERROR_LOG_FILE' ) )
+ {
+ return;
+ }
}
function mail_insert_log()
{
+ if ( ! defined ( 'ERROR_LOG_EMAIL' ) )
+ {
+ return;
+ }
}
- function render()
+ function display_error()
{
- global $template, $db;
+ global $template;
+ global $db;
/**
* If the template object is not set
@@ -107,12 +159,12 @@
* Delete current output
*/
ob_end_clean();
-
+
/**
* Render template
*/
- $template->assign('error', array(
- 'level' => $this->level,
+ $template->assign('info', array(
+ 'level' => ( isset($lang[$this->level]) ) ? $lang[$this->level] : $this->level,
'title' => $this->title,
'message' => $this->message,
'line' => $this->line,
@@ -120,12 +172,16 @@
'sql' => $this->sql)
);
- $template->display('error_' . $this->level . '.html');
+ $template->display(strtolower($this->level) . '.html');
$db->sql_close();
exit;
}
+
+ function display()
+ {
+ }
}
?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|