mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Convert to ui-lib
This commit is contained in:
@@ -22,52 +22,36 @@ foreach $c (@conf) {
|
||||
$poll = $c if ($c->{'defaults'});
|
||||
}
|
||||
|
||||
print "<form action=save_global.cgi>\n";
|
||||
print "<input type=hidden name=file value='$file'>\n";
|
||||
print "<input type=hidden name=user value='$in{'user'}'>\n";
|
||||
|
||||
# Show default server options
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'global_header'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table width=100%>\n";
|
||||
print &ui_form_start("save_global.cgi", "post");
|
||||
print &ui_hidden("file", $file);
|
||||
print &ui_hidden("user", $in{'user'});
|
||||
print &ui_table_start($text{'global_header'}, "width=100%", 2);
|
||||
|
||||
print "<tr> <td><b>$text{'poll_proto'}</b></td>\n";
|
||||
print "<td><select name=proto>\n";
|
||||
printf "<option value='' %s>%s</option>\n",
|
||||
$poll->{'proto'} ? '' : 'selected', $text{'default'};
|
||||
foreach $p ('pop3', 'pop2', 'imap', 'imap-k4', 'imap-gss', 'apop', 'kpop') {
|
||||
printf "<option value=%s %s>%s</option>\n",
|
||||
$p, lc($poll->{'proto'}) eq $p ? 'selected' : '', uc($p);
|
||||
$found++ if (lc($poll->{'proto'}) eq $p);
|
||||
}
|
||||
printf "<option value=%s selected>%s</option>\n", $poll->{'proto'}, uc($poll->{'proto'})
|
||||
if (!$found && $poll->{'proto'});
|
||||
print "</select></td>\n";
|
||||
# Protocol
|
||||
print &ui_table_row($text{'poll_proto'},
|
||||
&ui_select("proto", lc($poll->{'proto'}),
|
||||
[ [ '', $text{'default'} ],
|
||||
map { [ $_, uc($_) ] } ('pop3', 'pop2', 'imap', 'imap-k4', 'imap-gss', 'apop', 'kpop'),
|
||||
], 1, 0, 1));
|
||||
|
||||
print "<td><b>$text{'poll_port'}</b></td>\n";
|
||||
printf "<td><input type=radio name=port_def value=1 %s> %s\n",
|
||||
$poll->{'port'} ? '' : 'checked', $text{'default'};
|
||||
printf "<input type=radio name=port_def value=0 %s> %s\n",
|
||||
$poll->{'port'} ? 'checked' : '';
|
||||
printf "<input name=port size=8 value='%s'></td> </tr>\n",
|
||||
$poll->{'port'};
|
||||
# Port number
|
||||
print &ui_table_row($text{'poll_port'},
|
||||
&ui_opt_textbox("port", $poll->{'port'}, 8, $text{'default'}));
|
||||
|
||||
# Network interface to check
|
||||
@interface = split(/\//, $poll->{'interface'});
|
||||
print "<tr> <td valign=top><b>$text{'poll_interface'}</b></td><td colspan=3>\n";
|
||||
printf "<input type=radio name=interface_def value=1 %s> %s<br>\n",
|
||||
@interface ? '' : 'checked', $text{'poll_interface_def'};
|
||||
printf "<input type=radio name=interface_def value=0 %s> %s\n",
|
||||
@interface ? 'checked' : '', $text{'poll_interface_ifc'};
|
||||
print "<input name=interface size=8 value='$interface[0]'> ",
|
||||
"$text{'poll_interface_ip'}\n";
|
||||
print "<input name=interface_net size=15 value='$interface[1]'> /\n";
|
||||
print "<input name=interface_mask size=15 value='$interface[2]'></td> </tr>\n";
|
||||
print &ui_table_row($text{'poll_interface'},
|
||||
&ui_radio("interface_def", @interface ? 0 : 1,
|
||||
[ [ 1, $text{'poll_interface_def'} ],
|
||||
[ 0, $text{'poll_interface_ifc'} ] ])."\n".
|
||||
&ui_textbox("interface", $interface[0], 8)." ".
|
||||
$text{'poll_interface_ip'}." ".
|
||||
&ui_textbox("interface_net", $interface[1], 15)." / ".
|
||||
&ui_textbox("interface_mask", $interface[2], 15));
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
|
||||
print "<table width=100%><tr>\n";
|
||||
print "<td><input type=submit value='$text{'save'}'></td>\n";
|
||||
print "</tr></table>\n";
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'save'} ] ]);
|
||||
|
||||
if (!$fetchmail_config && $config{'view_mode'}) {
|
||||
&ui_print_footer("edit_user.cgi?user=$in{'user'}", $text{'user_return'},
|
||||
|
||||
Reference in New Issue
Block a user