X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_msg_dialog.inc;h=6cd25e6d6f4c0bbe45ab5f8e05ac57ed63d30bd4;hb=f43c362c3ff296dd9270bd48f2c7feecf34b7375;hp=0a9a6a566b125124f0369547bd6cd364b2671e17;hpb=f33a33219e6aa7088341488689833a6f9ec2d54c;p=gosa.git diff --git a/gosa-core/include/class_msg_dialog.inc b/gosa-core/include/class_msg_dialog.inc index 0a9a6a566..6cd25e6d6 100644 --- a/gosa-core/include/class_msg_dialog.inc +++ b/gosa-core/include/class_msg_dialog.inc @@ -1,10 +1,31 @@ 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')){ @@ -63,11 +85,22 @@ class msg_dialog session::set('errorsAlreadyPosted',$errorsAlreadyPosted); } + public static function display($s_title,$s_message,$i_type = INFO_DIALOG) { new msg_dialog($s_title,$s_message,$i_type); } + + public static function displayChecks($messages) + { + /* Assemble the message array to a plain string */ + foreach ($messages as $error){ + msg_dialog::display(_("Error"), $error, ERROR_DIALOG); + } + } + + public function get_ID() { return($this->i_ID); @@ -102,7 +135,7 @@ class msg_dialog $smarty->assign("s_Title",$this->s_Title); $smarty->assign("i_ID",$this->i_ID); $smarty->assign("frame",false); - $smarty->assign("JS",session::get('js')); + $smarty->assign("JS",session::global_get('js')); $smarty->assign("IE",preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT'])); return($smarty->fetch(get_template_path('msg_dialog.tpl'))); } @@ -137,7 +170,7 @@ class msg_dialog $smarty->assign("IE",preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT'])); $return = $smarty->fetch(get_template_path('msg_dialog.tpl')); - if(!session::get('js')){ + if(!session::global_get('js')){ $dialog = array_pop(session::get('msg_dialogs')); $return.= $dialog->execute(); }else{