index d6bc4f7a6aa7cc3f35bdccb11d2873826120f8a9..4f765a5b58fad8eb42cdec984b98a177b6167d74 100644 (file)
define("WARNING_DIALOG" , 10002);
define("ERROR_DIALOG" , 10003);
define("CONFIRM_DIALOG" , 10004);
-define("FATAL_ERROR_DIALOG" , 10005);
+define("OK_CANCEL_DIALOG" , 10005);
+define("FATAL_ERROR_DIALOG" , 10006);
class msg_dialog
{
public function __construct($s_title,$s_message,$i_type)
{
global $config;
+
+ if(empty($s_message)) return;
- if(!in_array($i_type,array(INFO_DIALOG,WARNING_DIALOG,ERROR_DIALOG,CONFIRM_DIALOG,FATAL_ERROR_DIALOG))){
+ if(!in_array($i_type,array(INFO_DIALOG,WARNING_DIALOG,ERROR_DIALOG,CONFIRM_DIALOG,FATAL_ERROR_DIALOG,OK_CANCEL_DIALOG))){
trigger_error("Invalid msg_dialog type.");
$i_type = INFO_DIALOG;
}
/* Append trace information, only if error messages are enabled */
if( isset($config) &&
is_object($config) &&
- isset($config->data['MAIN']['DISPLAYERRORS']) &&
- preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS'])){
+ $config->get_cfg_value("displayerrors") == "true" ){
$this->a_Trace = debug_backtrace();
}
if(!session::is_set('msg_dialogs')){
public static function displayChecks($messages)
{
/* Assemble the message array to a plain string */
- foreach ($message as $error){
+ foreach ($messages as $error){
msg_dialog::display(_("Error"), $error, ERROR_DIALOG);
}
}