From d582054c77b22daeb08d2bff17794b9a69a20dd4 Mon Sep 17 00:00:00 2001
From: mensonge
Date: Wed, 12 Dec 2007 16:29:16 +0000
Subject: import of scuttle 0.7.2
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@1 b3834d28-1941-0410-a4f8-b48e95affb8f
---
functions.inc.php | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 160 insertions(+)
create mode 100644 functions.inc.php
(limited to 'functions.inc.php')
diff --git a/functions.inc.php b/functions.inc.php
new file mode 100644
index 0000000..63b789a
--- /dev/null
+++ b/functions.inc.php
@@ -0,0 +1,160 @@
+sql_error();
+ $debug_text = '';
+
+ if ($sql_error['message'] != '')
+ $debug_text .= '
'. T_('SQL Error') .' : '. $sql_error['code'] .' '. $sql_error['message'];
+
+ if ($sql_store != '')
+ $debug_text .= '
'. $sql_store;
+
+ if ($err_line != '' && $err_file != '')
+ $debug_text .= '
'. T_('Line') .' : '. $err_line .'
'. T_('File') .' :'. $err_file;
+ }
+
+ switch($msg_code) {
+ case GENERAL_MESSAGE:
+ if ($msg_title == '')
+ $msg_title = T_('Information');
+ break;
+
+ case CRITICAL_MESSAGE:
+ if ($msg_title == '')
+ $msg_title = T_('Critical Information');
+ break;
+
+ case GENERAL_ERROR:
+ if ($msg_text == '')
+ $msg_text = T_('An error occured');
+
+ if ($msg_title == '')
+ $msg_title = T_('General Error');
+ break;
+
+ case CRITICAL_ERROR:
+ // Critical errors mean we cannot rely on _ANY_ DB information being
+ // available so we're going to dump out a simple echo'd statement
+
+ if ($msg_text == '')
+ $msg_text = T_('An critical error occured');
+
+ if ($msg_title == '')
+ $msg_title = T_('Critical Error');
+ break;
+ }
+
+ // Add on DEBUG info if we've enabled debug mode and this is an error. This
+ // prevents debug info being output for general messages should DEBUG be
+ // set TRUE by accident (preventing confusion for the end user!)
+ if (DEBUG && ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) {
+ if ($debug_text != '')
+ $msg_text = $msg_text . '
'. T_('DEBUG MODE') .''. $debug_text;
+ }
+
+ echo "\n