Code

Updated msgdialog to supprt OK/CANCEL DIALOG
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 5 Jun 2008 07:31:40 +0000 (07:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 5 Jun 2008 07:31:40 +0000 (07:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11224 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/ihtml/themes/default/msg_dialog.tpl
gosa-core/include/class_msg_dialog.inc

index add23337c4d054feee7a2707e371b845b6dc49ac..72dec71228bdad1a3e7bed9b189c21f851ae37b2 100644 (file)
@@ -55,7 +55,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 || $i_Type == CONFIRM_DIALOG}
+       {elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG || $i_Type == OK_CANCEL_DIALOG}
                                                <img src='images/info.png' alt='{t}Information{/t}'>
        {/if}
                        </td><td style='font-size: 1.1em; font-weight:bold;'>{$s_Title}</td></tr>
@@ -74,7 +74,7 @@
                                                <div style="errorMsgSeperator"></div>
        {if $i_Type == ERROR_DIALOG || $i_Type == WARNING_DIALOG || $i_Type == INFO_DIALOG}
                                                <button type='submit' name='MSG_OK{$i_ID}'>{t}Ok{/t}</button>
-       {elseif $i_Type == CONFIRM_DIALOG}
+       {elseif $i_Type == CONFIRM_DIALOG || $i_Type == OK_CANCEL_DIALOG}
                                                <button type='submit' name='MSG_OK{$i_ID}'>{t}Ok{/t}</button>
                                                <button type='submit' name='MSG_CANCEL{$i_ID}'>{t}Cancel{/t}</button>
        {/if}
                                                <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 || $i_Type == CONFIRM_DIALOG}
+       {elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG || $i_Type == OK_CANCEL_DIALOG}
                                                <img src='images/info.png' alt='{t}Information{/t}'>
        {/if}
                        </td><td style='font-size: 1.1em; font-weight:bold;'>{$s_Title}</td></tr>
        {elseif $i_Type == CONFIRM_DIALOG}
                                                <button type='submit' name='MSG_OK{$i_ID}' onClick='next_msg_dialog();'>{t}Ok{/t}</button>
                                                <button type='button' name='MSG_CANCEL{$i_ID}' onClick='next_msg_dialog();'>{t}Cancel{/t}</button>
+       {elseif $i_Type == OK_CANCEL_DIALOG}
+                                               <button type='submit' name='MSG_OK{$i_ID}' onClick='next_msg_dialog();'>{t}Ok{/t}</button>
+                                               <button type='submit' name='MSG_CANCEL{$i_ID}' onClick='next_msg_dialog();'>{t}Cancel{/t}</button>
        {/if}
                                        </td>
                                </tr>
index 1ba29747e639cb4c9d68043368e6c10a880e47a3..e6de1acf1aaa9fd1bc928391f2e32f11dffa4a7b 100644 (file)
@@ -24,7 +24,8 @@ define("INFO_DIALOG"          , 10001);
 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
 {
@@ -40,7 +41,7 @@ class msg_dialog
 
                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;
                }