diff --git a/plugins/gofon/macro/class_gofonMacroParameters.inc b/plugins/gofon/macro/class_gofonMacroParameters.inc
index f8f93a19ab9de8848c48de1d609dea0334b2b65b..67f8bce0619930c125b59a7a399f2d4233a7711f 100755 (executable)
foreach($this->goFonMacroParameter as $para){
$tmp = split("!",$para);
$num = preg_replace("/[^0-9]/","",$tmp[1]);
- $tmp2[$num]['name'] = $tmp[1];
- $tmp2[$num]['type'] = $tmp[2];
- $tmp2[$num]['default'] = $tmp[3];
+ $tmp2[$num]['var'] = $tmp[1];
+ $tmp2[$num]['name'] = $tmp[2];
+ $tmp2[$num]['type'] = $tmp[3];
+ $tmp2[$num]['default'] = $tmp[4];
}
/* Assign this array */
}
}
foreach($new as $key => $val){
+ $goFonMacroParameter[$key]['var']="\${ARG".$key."}";
$goFonMacroParameter[$key]['check']= true;
if((!isset($goFonMacroParameter[$key]['name']))||(empty($goFonMacroParameter[$key]['name']))){
$goFonMacroParameter[$key]['name']="\${ARG".$key."}";
}
$number= count($this->goFonMacroParameter);
$number++;
- $this->goFonMacroParameter[]=array("name"=>"new","type"=>"string","default"=>"test");
+ $this->goFonMacroParameter[]=array("var"=>"var","name"=>"new","type"=>"string","default"=>"test");
}
-
- #FIXME: Der Transfer der momentanen Variablen muss nach save_object(),
- # damit kann in save() auf den execute() Aufruf verzichtet werden!
-
- /* read out post data, and assign it to the parameters */
- /* And or delete */
- foreach($_POST as $name=>$value){
-
- /* Test if there is a variable begining with "del" */
- if(preg_match("/del/",$name)){
-
- /* Extract entry id to delete */
- $nr = str_replace("del","",$name) ;
-
- /* unset entry */
- unset($this->goFonMacroParameter[$nr]);
-
- }elseif(preg_match("/number/",$name)){
-
- /* Set Post vars */
- $key = $_POST[$name];
- $this->goFonMacroParameter[$key]['name'] = $_POST["varname".$key];
- $this->goFonMacroParameter[$key]['type'] = $_POST["vartype".$key];
- $this->goFonMacroParameter[$key]['default']= $_POST["default".$key];
- }
- }
-
/*generate Table which shows als parameters */
$FonParas = $this->check_paras($content,$this->goFonMacroParameter);
list($sel1, $sel2, $sel3)= array("", "", "");
}
- #FIXME: Der Name des Parameters ist nicht gesetzt
- # -> Argument (ARG#) Name [....] Typ [...^] Default [....]
-
/* Assemble output table */
$vars .="<tr>
- <td><input name=\"number".$key."\" value='".$key."' type='hidden'> </td>
- <td><input name='varname".$key."' type='hidden' value='".$para['name']."'>".$para['name']."</td>
+ <input name=\"number".$key."\" value='".$key."' type='hidden'>
+ <td><input name='var".$key."' type='hidden' value='".$para['var']."'>".$para['var']."</td>
+ <td><input name='varname".$key."' value='".$para['name']."'></td>
<td>
<select name='vartype".$key."'>
<option name='vartype".$key."' value='string' ".$sel1.">"._("String")."</option>
<td><input name='default".$key."' value='".$para['default']."'></td>
<td>";
if($para['check']==true) {
- $vars.=_("Ok");
- $vars.=" <td></td>";
+ $vars.="</td><td></td>";
}else{
- $vars.="<b>"._("Unused")."</b>";
+ $vars.="<b>"._("Unused")."</b></td>";
$vars.=" <td><input name='del".$key."' value='delete' type='submit'></td>";
}
if (isset($_POST['phoneparameters'])){
plugin::save_object();
}
+ /* read out post data, and assign it to the parameters */
+ /* And or delete */
+ foreach($_POST as $name=>$value){
+
+ /* Test if there is a variable begining with "del" */
+ if(preg_match("/del/",$name)){
+
+ /* Extract entry id to delete */
+ $nr = str_replace("del","",$name) ;
+
+ /* unset entry */
+ unset($this->goFonMacroParameter[$nr]);
+
+ }elseif(preg_match("/number/",$name)){
+
+ /* Set Post vars */
+ $key = $_POST[$name];
+
+ $this->goFonMacroParameter[$key]['var'] = $_POST["var".$key];
+ $this->goFonMacroParameter[$key]['name'] = $_POST["varname".$key];
+ $this->goFonMacroParameter[$key]['type'] = $_POST["vartype".$key];
+ $this->goFonMacroParameter[$key]['default']= $_POST["default".$key];
+ }
+ }
+
}
{
/* Post checks */
- # FIXME: das hat hier nix zu suchen...
- $this->execute();
-
plugin::save();
$this->attrs['goFonMacroParameter']=array();
foreach($this->goFonMacroParameter as $key=>$fonpara){
- $this->attrs['goFonMacroParameter'][]=$key."!".$fonpara['name']."!".$fonpara['type']."!".$fonpara['default'];
+ $this->attrs['goFonMacroParameter'][]=$key."!".$fonpara['var']."!".$fonpara['name']."!".$fonpara['type']."!".$fonpara['default'];
}
unset($this->attrs['base']);