mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
ui-lib conversion of misc options page
This commit is contained in:
@@ -463,9 +463,9 @@ elsif ($_[0]->{'type'} == 2) {
|
||||
# Returns a table row for a multi-value BIND option
|
||||
sub choice_input
|
||||
{
|
||||
local ($rv, $v, $i, @opts);
|
||||
$v = &find_value($_[1], $_[2]);
|
||||
for($i=3; $i<@_; $i+=2) {
|
||||
my $v = &find_value($_[1], $_[2]);
|
||||
my @opts;
|
||||
for(my $i=3; $i<@_; $i+=2) {
|
||||
push(@opts, [ $_[$i+1], $_[$i] ]);
|
||||
}
|
||||
return &ui_table_row($_[0], &ui_radio($_[1], $v, \@opts));
|
||||
@@ -637,20 +637,15 @@ local $dir = { 'name' => $_[0], 'type' => 1, 'members' => \@vals };
|
||||
}
|
||||
|
||||
# opt_input(text, name, &config, default, size, units)
|
||||
# Returns a table row with an optional text field
|
||||
sub opt_input
|
||||
{
|
||||
local($v, $rv, $n);
|
||||
$v = &find($_[1], $_[2]);
|
||||
my $v = &find($_[1], $_[2]);
|
||||
my $n;
|
||||
($n = $_[1]) =~ s/[^A-Za-z0-9_]/_/g;
|
||||
$rv = "<td valign=top><b>$_[0]</b></td> <td nowrap valign=top";
|
||||
$rv .= $_[4] > 30 ? " colspan=3>\n" : ">\n";
|
||||
$rv .= sprintf "<input type=radio name=${n}_def value=1 %s> $_[3]\n",
|
||||
$v ? "" : "checked";
|
||||
$rv .= sprintf "<input type=radio name=${n}_def value=0 %s> ",
|
||||
$v ? "checked" : "";
|
||||
$rv .= sprintf "<input name=$n size=$_[4] value=\"%s\"> $_[5]</td>\n",
|
||||
$v ? $v->{'value'} : "";
|
||||
return $rv;
|
||||
return &ui_table_row($_[0],
|
||||
&ui_opt_textbox($n, $v ? $v->{'value'} : "", $_[4], $_[3])." ".$_[5],
|
||||
$_[4] > 30 ? 3 : 1);
|
||||
}
|
||||
|
||||
sub save_opt
|
||||
|
||||
@@ -11,57 +11,44 @@ $conf = &get_config();
|
||||
$options = &find("options", $conf);
|
||||
$mems = $options->{'members'};
|
||||
|
||||
print "<form action=save_misc.cgi>\n";
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'misc_header'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table width=100%>\n";
|
||||
# Start of the form
|
||||
print &ui_form_start("save_misc.cgi");
|
||||
print &ui_table_start($text{'misc_header'}, "width=100%", 4);
|
||||
|
||||
print "<tr>\n";
|
||||
print &opt_input($text{'misc_core'}, 'coresize', $mems, $text{'default'}, 8);
|
||||
print &opt_input($text{'misc_data'}, 'datasize', $mems, $text{'default'}, 8);
|
||||
print "</tr>\n";
|
||||
|
||||
print "<tr>\n";
|
||||
print &opt_input($text{'misc_files'}, 'files', $mems, $text{'default'}, 8);
|
||||
print &opt_input($text{'misc_stack'}, 'stacksize', $mems, $text{'default'}, 8);
|
||||
print "</tr>\n";
|
||||
|
||||
print "<tr> <td colspan=4><hr></td> </tr>\n";
|
||||
print &ui_table_hr();
|
||||
|
||||
print "<tr>\n";
|
||||
print &opt_input($text{'misc_clean'}, 'cleaning-interval', $mems,
|
||||
$text{'default'}, 8, "$text{'misc_mins'}");
|
||||
print &opt_input($text{'misc_iface'}, 'interface-interval', $mems,
|
||||
$text{'default'}, 8, "$text{'misc_mins'}");
|
||||
print "</tr>\n";
|
||||
|
||||
print "<tr>\n";
|
||||
print &opt_input($text{'misc_stats'}, 'statistics-interval', $mems,
|
||||
$text{'default'}, 8, "$text{'misc_mins'}");
|
||||
print "</tr>\n";
|
||||
|
||||
print "<tr> <td colspan=4><hr></td> </tr>\n";
|
||||
print &ui_table_hr();
|
||||
|
||||
print "<tr>\n";
|
||||
print &choice_input($text{'misc_recursion'}, 'recursion', $mems,
|
||||
$text{'yes'}, 'yes', $text{'no'}, 'no',
|
||||
$text{'default'}, undef);
|
||||
print &choice_input($text{'misc_cnames'}, 'multiple-cnames', $mems,
|
||||
$text{'yes'}, 'yes', $text{'no'}, 'no',
|
||||
$text{'default'}, undef);
|
||||
print "</tr>\n";
|
||||
|
||||
print "<tr>\n";
|
||||
print &choice_input($text{'misc_glue'}, 'fetch-glue', $mems,
|
||||
$text{'yes'}, 'yes', $text{'no'}, 'no',
|
||||
$text{'default'}, undef);
|
||||
print &choice_input($text{'misc_nx'}, 'auth-nxdomain', $mems,
|
||||
$text{'yes'}, 'yes', $text{'no'}, 'no',
|
||||
$text{'default'}, undef);
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user