Code

Updated message box
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Sep 2007 12:05:45 +0000 (12:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Sep 2007 12:05:45 +0000 (12:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7327 594d385d-05f5-0310-b6e9-bd551577e9d8

html/include/focus.js
html/main.php
ihtml/themes/default/msg_dialog.tpl
include/class_msg_dialog.inc

index 57fbf000662ec386b7803bafe4101ce9274cc6ea..3f832476f01a8aa053991af8b7c134c9f59fc9d2 100644 (file)
@@ -461,6 +461,8 @@ function next_msg_dialog()
                var cur_id = document.getElementById('current_msg_dialogs').value;
                if(cur_id != ""){
                        hide('e_layer2' + cur_id);      
+                       document.getElementById('closed_msg_dialogs').value += "," + cur_id;
+                       document.getElementById('current_msg_dialogs').value= ""; 
                }
        }
 
@@ -478,6 +480,7 @@ function next_msg_dialog()
                                                ele.style.display= 'block'      ;
                                                document.getElementById('pending_msg_dialogs').value= tmp;
                                                document.getElementById('current_msg_dialogs').value= i_id;
+
                                }
                }
        }
index 1481915cc44dd099f1e3168ab897ad27046d59da..f95af8a5a5cadbc6fa57652cc15030dee7c128d1 100644 (file)
@@ -359,10 +359,12 @@ if (is_file("$plugin_dir/main.inc")){
 
 
 /* Print_out last ErrorMessage repeated string. */
-#msg_dialog::display("Error"   ,"Kann datei nicht schreiben, bla",ERROR_DIALOG);
-#msg_dialog::display("Warning" ,"Kann datei nicht schreiben, bla",WARNING_DIALOG);
-#msg_dialog::display("Info"    ,"Kann datei nicht schreiben, bla",INFO_DIALOG);
-#msg_dialog::display("Confirm" ,"Kann datei nicht schreiben, bla",CONFIRM_DIALOG);
+if(isset($_GET['add'])){
+msg_dialog::display("Error"   ,"Kann datei nicht schreiben, bla",ERROR_DIALOG);
+msg_dialog::display("Warning" ,"Kann datei nicht schreiben, bla",WARNING_DIALOG);
+msg_dialog::display("Info"    ,"Kann datei nicht schreiben, bla",INFO_DIALOG);
+msg_dialog::display("Confirm" ,"Kann datei nicht schreiben, bla",CONFIRM_DIALOG);
+}
 
 $smarty->assign("msg_dialogs", msg_dialog::get_dialogs());
 $smarty->assign("contents", $display);
@@ -384,6 +386,12 @@ if (isset($_SESSION['errors']) && $_SESSION['errors'] != ""){
   $focus.= 'document.forms[0].error_accept.focus();';
   $focus.= '</script>';
 }
+
+ $focus= '<script language="JavaScript" type="text/javascript">';
+  $focus.= 'next_msg_dialog();';
+  $focus.= '</script>';
+
+
 $smarty->assign("focus", $focus);
 
 $display= $header.$smarty->fetch(get_template_path('framework.tpl'));
index 57c1a7ff3282d654b7ef5a16ede761b24cc860aa..85246df893b2608eba427fe880d349d9b8b5bf11 100644 (file)
@@ -57,7 +57,7 @@
                                        <img src='images/error.png' alt='{t}Error{/t}'>
 {elseif $i_Type == WARNING_DIALOG}
                                        <img src='images/warning.png'  alt='{t}Warning{/t}'>
-{elseif $i_Type == INFO_DIALOG}
+{elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG}
                                        <img src='images/info.png' alt='{t}Information{/t}'>
 {/if}
                                </td>
index 08b536c087407109a927cfb6753adab0824db0d0..8561304962b674f39e64f6c6ded33c63bce4aaf9 100644 (file)
@@ -56,18 +56,30 @@ class msg_dialog
        public static function get_dialogs()
        {
                $return  ="";
-               $dialog_ids= "";        
+               $dialog_ids= "";
+
+               $seen = "";
+               if(isset($_POST['closed_msg_dialogs'])){
+                       $seen = $_POST['closed_msg_dialogs'];
+               }
+
                if(isset($_SESSION['msg_dialogs']) && is_array($_SESSION['msg_dialogs'])){
+
                        foreach($_SESSION['msg_dialogs'] as $key => $dialog){
-                               $return.= $dialog->execute();
-                               $dialog_ids= $dialog->get_ID().",".$dialog_ids;
+
+                               if(preg_match("/".$dialog->get_ID()."/",$seen)){
+                                       unset($_SESSION['msg_dialogs'][$key]);
+                               }else{
+                                       $return.= $dialog->execute();
+                                       $dialog_ids= $dialog->get_ID().",".$dialog_ids;
+                               }
                        }
                }
-               unset($_SESSION['msg_dialogs']);
                $dialog_ids = preg_replace("/,$/","",$dialog_ids);
                
-               $return .="<input type='text' style='width:400px;' name='pending_msg_dialogs' id='pending_msg_dialogs' value='".$dialog_ids."'>";
-               $return .="<input type='text' style='width:400px;' name='current_msg_dialogs' id='current_msg_dialogs' value=''>";
+               $return .="<input type='hidden' style='width:400px;' name='pending_msg_dialogs' id='pending_msg_dialogs' value='".$dialog_ids."'>";
+               $return .="<input type='hidden' style='width:400px;' name='closed_msg_dialogs' id='closed_msg_dialogs' value=''>";
+               $return .="<input type='hidden' style='width:400px;' name='current_msg_dialogs' id='current_msg_dialogs' value=''>";
                return($return);
        }
 }