$sth->finish;
}
if ($searchfield) {
- $template->param(action => "Modify pref");
- } else {
- $template->param(action => "Add pref");
+ $template->param(modify => 1);
}
+
$template->param(explanation => $data->{'explanation'},
- value => $data->{'value'},
- );
- if ($searchfield) {
- $template->param(searchfield => "<input type=hidden name=variable value='$searchfield'>$searchfield");
- } else {
- $template->param(searchfield => "<input type=text name=variable size=80 maxlength=80>");
- }
+ value => $data->{'value'},
+ searchfield => $searchfield);
+
################## ADD_VALIDATE ##################################
# called by add_form, used to insert/modify data in DB
} elsif ($op eq 'add_validate') {
<TMPL_IF name="add_form">
<!-------------------------------------------------------------------------------------------------->
- <H1><TMPL_VAR NAME=action></H1>
+ <TMPL_IF NAME=modify>
+ <h1>Modify a system preference</h1>
+ <TMPL_ELSE>
+ <H1>Add a system preference</H1>
+ </TMPL_IF>
<form action='<TMPL_VAR name="script_name">' name=Aform method=post>
<input type=hidden name=op value='add_validate'>
- <input type=hidden name=explanation value='<TMPL_VAR name="explanation">'>
<table>
- <tr><td>Variable</td><td><TMPL_VAR name="searchfield"></td></tr>
+ <TMPL_IF NAME=searchfield>
+ <tr><td>Variable</td><td><TMPL_VAR name="searchfield"><input type=hidden name=variable value='<TMPL_VAR NAME=searchfield>'></td></tr>
+ <TMPL_ELSE>
+ <tr><td>Variable</td><td><input type=text name=variable></td></tr>
+ </TMPL_IF>
<tr><td>Value</td><td><input type=text name=value value='<TMPL_VAR name="value">'></td></tr>
+ <tr><td>Explanation</td><td><input type=text name=explanation size=80 value='<TMPL_VAR name="explanation">'></td></tr>
<tr><td> </td><td><INPUT type=button value='OK' onClick='Check(this.form)'></td></tr>
</table>
</form>