From 0460a1f33319461589b0a9f5501710a53a3b7a4b Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 28 Sep 2007 07:48:19 +0000 Subject: [PATCH] Updated msg_dialog to support non js systems git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7433 594d385d-05f5-0310-b6e9-bd551577e9d8 --- ihtml/themes/default/msg_dialog.tpl | 149 ++++++++++++++++++---------- include/class_msg_dialog.inc | 20 ++-- 2 files changed, 111 insertions(+), 58 deletions(-) diff --git a/ihtml/themes/default/msg_dialog.tpl b/ihtml/themes/default/msg_dialog.tpl index 3d870e728..d7d9ac49b 100644 --- a/ihtml/themes/default/msg_dialog.tpl +++ b/ihtml/themes/default/msg_dialog.tpl @@ -45,57 +45,104 @@ {/if} {else} - {if $s_Trace != ""} - - + + {if !$JS} + +
+ + + + + + + + +
+ {if $i_Type == ERROR_DIALOG} + {t}Error{/t} + {elseif $i_Type == WARNING_DIALOG} + {t}Warning{/t} + {elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG} + {t}Information{/t} + {/if} + +

{$s_Title}

+ {$s_Message} +
+
+
+ {if $i_Type == ERROR_DIALOG || $i_Type == WARNING_DIALOG || $i_Type == INFO_DIALOG} + + {elseif $i_Type == CONFIRM_DIALOG} + + {/if} +
+
-
- - - - - {if $s_Trace} - - {/if} - - - - -
-{if $i_Type == ERROR_DIALOG} - {t}Error{/t} -{elseif $i_Type == WARNING_DIALOG} - {t}Warning{/t} -{elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG} - {t}Information{/t} -{/if} - -

{$s_Title}

- {$s_Message} -
-
-
-
Trace
-
-{if $i_Type == ERROR_DIALOG || $i_Type == WARNING_DIALOG || $i_Type == INFO_DIALOG} - -{elseif $i_Type == CONFIRM_DIALOG} - - -{/if} -
-
+ {else} + + {if $s_Trace != ""} + + + {/if} + +
+ + + + + {if $s_Trace} + + {/if} + + + + +
+ {if $i_Type == ERROR_DIALOG} + {t}Error{/t} + {elseif $i_Type == WARNING_DIALOG} + {t}Warning{/t} + {elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG} + {t}Information{/t} + {/if} + +

{$s_Title}

+ {$s_Message} +
+
+
+
Trace
+
+ {if $i_Type == ERROR_DIALOG || $i_Type == WARNING_DIALOG || $i_Type == INFO_DIALOG} + + {elseif $i_Type == CONFIRM_DIALOG} + + + {/if} +
+
+ {/if} {/if} diff --git a/include/class_msg_dialog.inc b/include/class_msg_dialog.inc index b72e61b4e..1d5a81d66 100644 --- a/include/class_msg_dialog.inc +++ b/include/class_msg_dialog.inc @@ -50,6 +50,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['js']); $smarty->assign("IE",preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT'])); return($smarty->fetch(get_template_path('msg_dialog.tpl'))); } @@ -75,7 +76,7 @@ class msg_dialog # $seen = $_POST['closed_msg_dialogs']; } - if(isset($_SESSION['msg_dialogs']) && is_array($_SESSION['msg_dialogs'])){ + if(isset($_SESSION['msg_dialogs']) && is_array($_SESSION['msg_dialogs']) && count($_SESSION['msg_dialogs'])){ /* Get frame one */ $smarty = get_smarty(); @@ -83,15 +84,20 @@ class msg_dialog $smarty->assign("IE",preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT'])); $return = $smarty->fetch(get_template_path('msg_dialog.tpl')); - foreach($_SESSION['msg_dialogs'] as $key => $dialog){ + if(!$_SESSION['js']){ + $dialog = array_pop($_SESSION['msg_dialogs']); + $return.= $dialog->execute(); + }else{ + foreach($_SESSION['msg_dialogs'] as $key => $dialog){ - if(preg_match("/".$dialog->get_ID()."/",$seen)){ + 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'][$key]); - }else{ - $return.= $dialog->execute(); - $dialog_ids= $dialog->get_ID().",".$dialog_ids; } - unset($_SESSION['msg_dialogs'][$key]); } $dialog_ids = preg_replace("/,$/","",$dialog_ids); -- 2.30.2