00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 define ("DIALOG_DEFAULT_SIZE", 75);
00044
00045 define ("DIALOG_DEFAULT_OK_TEXT", " Aceptar ");
00046 define ("DIALOG_DEFAULT_OK_NAME", "ok");
00047 define ("DIALOG_DEFAULT_OK_TYPE", "submit");
00048 define ("DIALOG_DEFAULT_OK_ONCLICK", "");
00049
00050 define ("DIALOG_DEFAULT_CANCEL_TEXT", "Cancelar");
00051 define ("DIALOG_DEFAULT_CANCEL_NAME", "cancel");
00052 define ("DIALOG_DEFAULT_CANCEL_TYPE", "submit");
00053 define ("DIALOG_DEFAULT_CANCEL_ONCLICK", "");
00054
00055 class DialogJames
00056 {
00057
00058
00059 var $title;
00060
00061
00062 var $size;
00063
00064
00065 var $okButton;
00066 var $cancelButton;
00067
00068
00069
00070 function DialogJames($title)
00071 {
00072 $this->title = $title;
00073
00074
00075 if (func_num_args() == 2)
00076 $this->size = func_get_arg(1);
00077 else
00078 $this->size = DIALOG_DEFAULT_SIZE;
00079
00080
00081 $this->okButton["show"] = false;
00082 $this->cancelButton["show"] = false;
00083 }
00084
00085
00086
00087 function SetOK($text)
00088 {
00089 $this->okButton["show"] = true;
00090 $this->okButton["text"] = $text;
00091
00092
00093 $this->okButton["name"] = DIALOG_DEFAULT_OK_NAME;
00094 $this->okButton["type"] = DIALOG_DEFAULT_OK_TYPE;
00095 $this->okButton["onClick"] = DIALOG_DEFAULT_OK_ONCLICK;
00096
00097 switch(func_num_args())
00098 {
00099 case 4:
00100 $this->okButton["onClick"] = func_get_arg(3);
00101 case 3:
00102 $this->okButton["type"] = func_get_arg(2);
00103 case 2:
00104 $this->okButton["name"] = func_get_arg(1);
00105 }
00106 }
00107
00108
00109
00110 function SetCancel($text)
00111 {
00112 $this->cancelButton["show"] = true;
00113 $this->cancelButton["text"] = $text;
00114
00115
00116 $this->cancelButton["name"] = DIALOG_DEFAULT_CANCEL_NAME;
00117 $this->cancelButton["type"] = DIALOG_DEFAULT_CANCEL_TYPE;
00118 $this->cancelButton["onClick"] = DIALOG_DEFAULT_CANCEL_ONCLICK;
00119
00120 switch(func_num_args())
00121 {
00122 case 4:
00123 $this->cancelButton["onClick"] = func_get_arg(3);
00124 case 3:
00125 $this->cancelButton["type"] = func_get_arg(2);
00126 case 2:
00127 $this->cancelButton["name"] = func_get_arg(1);
00128 }
00129 }
00130
00131
00132
00133 function PrintHeader()
00134 {
00135 if (func_num_args() == 1)
00136 $this->title = func_get_arg(0);
00137 ?>
00138 <table class="dialog" cellpadding="3" align="center" cellspacing="3" width="<?echo $this->size;?>%">
00139 <tr class="dialog-header">
00140 <td class="dialog-header"><? echo $this->title; ?></td>
00141 </tr>
00142 <tr>
00143 <td> </td>
00144 </tr>
00145 <tr>
00146 <td>
00147 <?
00148 }
00149
00150
00151 function PrintFoot()
00152 {
00153
00154 if ($this->okButton["show"])
00155 {
00156 $okLine = " type='".$this->okButton["type"]."' ";
00157 $okLine .= " name='".$this->okButton["name"]."' ";
00158 $okLine .= " value='".$this->okButton["text"]."' ";
00159 $okLine .= " onClick='".$this->okButton["onClick"]."' ";
00160 }
00161
00162 if ($this->cancelButton["show"])
00163 {
00164 $cancelLine = " type='".$this->cancelButton["type"]."' ";
00165 $cancelLine .= " name='".$this->cancelButton["name"]."' ";
00166 $cancelLine .= " value='".$this->cancelButton["text"]."' ";
00167 $cancelLine .= " onClick='".$this->cancelButton["onClick"]."' ";
00168 }
00169
00170
00171
00172 ?>
00173
00174 </td>
00175 </tr>
00176 <tr>
00177 <td align="center">
00178 <?
00179 if ($this->okButton["show"])
00180 echo "<input class='Button' ".$okLine." >";
00181
00182 if ($this->cancelButton["show"])
00183 {
00184 echo " ";
00185 echo "<input class='Button' ".$cancelLine." >";
00186 }
00187 echo "</td>\n";
00188 ?>
00189 </td>
00190 </tr>
00191 <tr>
00192 <td> </td>
00193 </tr>
00194 </table>
00195 <?
00196 }
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214 }
00215
00216
00217
00218
00219