summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ded5554)
raw | patch | inline | side by side (parent: ded5554)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Jun 2005 06:58:33 +0000 (06:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Jun 2005 06:58:33 +0000 (06:58 +0000) |
plugins/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history |
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index dd7c7677729042962273b84e64a8e8eb1677357b..e9ec34749523bfd4a9152911a7e751fa069206ee 100644 (file)
$str.="</select>";
}
+
+
/* Display switch for true false*/
if($type == "bool"){
-
- $str="<select name='".$var."' ".chkacl($this->acl, "goFonMacro").">";
-
- if($choosen){
- $str.="\n<option name='".$var."' value='0'>"._("false")."</option>";
- $str.="\n<option name='".$var."' value='1' selected>"._("true")."</option>";
+ if(!$choosen){
+ $str="\n<input type='checkbox' name='".$var."' value='1'>";
}else{
- $str.="\n<option name='".$var."' value='0' selected>"._("false")."</option>";
- $str.="\n<option name='".$var."' value='1'>"._("true")."</option>";
+ $str="\n<input type='checkbox' name='".$var."' value='1' checked>";
}
- $str.="<select name='".$var."'>";
}
/* display simple textfield */
if(isset($_POST[$paras['var']])){
$this->macroarray[$this->macro][$key]['choosen'] = $_POST[$paras['var']];
}
+
+ /* Checkboxes are special, they are not Posted if they are not selected, so the won't be changed with the above code
+ We need this code below to read and save checkboxes correct
+ */
+ if($this->macroarray[$this->macro][$key]['type']=="bool"){
+ if(isset($_POST[$this->macroarray[$this->macro][$key]['var']])) {
+ $this->macroarray[$this->macro][$key]['choosen']=$_POST[$paras['var']];
+ }else{
+ $this->macroarray[$this->macro][$key]['choosen']=false;
+ }
+ }
}
}
}