mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
ui-lib
This commit is contained in:
@@ -17,10 +17,10 @@ $in{'feedbackhost_def'} || $in{'feedbackhost'} =~ /^\S+$/ ||
|
||||
for($i=0; $i<@webmin::cs_names; $i++) {
|
||||
$cd = $webmin::cs_codes[$i];
|
||||
if ($in{"${cd}_def"}) { delete($uconfig{$cd}); }
|
||||
elsif ($in{"${cd}_rgb"} !~ /^[0-9a-fA-F]{6}$/) {
|
||||
&error(&webmin::text('ui_ergb', $webmin::cs_names[$i]));
|
||||
elsif ($in{"${cd}"} !~ /^[0-9a-fA-F]{6}$/) {
|
||||
&error(&webmin::text('ui_ergb', $webmin::cs_names[$i] . $in{"${cd}_rgb"}));
|
||||
}
|
||||
else { $uconfig{$cd} = $in{"${cd}_rgb"}; }
|
||||
else { $uconfig{$cd} = $in{"${cd}"}; }
|
||||
}
|
||||
$uconfig{'texttitles'} = $in{'texttitles'};
|
||||
$uconfig{'sysinfo'} = $in{'sysinfo'};
|
||||
|
||||
@@ -8,98 +8,56 @@ $access{'ui'} || &error($text{'acl_ecannot'});
|
||||
|
||||
&get_usermin_config(\%uconfig);
|
||||
print $text{'ui_desc'},"<p>\n";
|
||||
print "<form action=change_ui.cgi>\n";
|
||||
print "<table border>\n";
|
||||
print "<tr $tb> <td><b>$text{'ui_header'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table>\n";
|
||||
|
||||
print &ui_form_start("change_ui.cgi", "post");
|
||||
print &ui_table_start($text{'ui_header'}, undef, 2, [ "width=30%" ]);
|
||||
|
||||
|
||||
for($i=0; $i<@webmin::cs_names; $i++) {
|
||||
$cd = $webmin::cs_codes[$i];
|
||||
print "<tr> <td><b>$webmin::cs_names[$i]</b></td>\n";
|
||||
printf "<td><input type=radio name=${cd}_def value=1 %s> %s\n",
|
||||
defined($uconfig{$cd}) ? "" : "checked",
|
||||
$webmin::text{'ui_default'};
|
||||
printf " <input type=radio name=${cd}_def value=0 %s> %s\n",
|
||||
defined($gconfig{$cd}) ? "checked" : "",
|
||||
$webmin::text{'ui_rgb'};
|
||||
print "<input name=${cd}_rgb size=8 value='$uconfig{$cd}'>\n";
|
||||
print "</td> </tr>\n";
|
||||
print &ui_table_row($webmin::cs_names[$i],
|
||||
&ui_opt_textbox($cd, $uconfig{$cd}, 8, $webmin::text{'ui_default'},
|
||||
$webmin::text{'ui_rgb'}));
|
||||
}
|
||||
|
||||
print "<tr> <td><b>$text{'ui_texttitles'}</b></td>\n";
|
||||
printf "<td><input type=radio name=texttitles value=1 %s> %s\n",
|
||||
$uconfig{'texttitles'} ? 'checked' : '', $text{'yes'};
|
||||
printf "<input type=radio name=texttitles value=0 %s> %s</td> </tr>\n",
|
||||
$uconfig{'texttitles'} ? '' : 'checked', $text{'no'};
|
||||
print &ui_table_row($webmin::text{'ui_texttitles'},
|
||||
&ui_yesno_radio("texttitles", int($uconfig{'texttitles'})));
|
||||
|
||||
print "<tr> <td><b>$text{'ui_sysinfo'}</b></td>\n";
|
||||
print "<td><select name=sysinfo>\n";
|
||||
foreach $m (0, 1, 4, 2, 3) {
|
||||
printf "<option value=%s %s> %s\n",
|
||||
$m, $uconfig{'sysinfo'} == $m ? 'selected' : '',
|
||||
$webmin::text{'ui_sysinfo'.$m};
|
||||
}
|
||||
print "</select></td> </tr>\n";
|
||||
print &ui_table_row($webmin::text{'ui_sysinfo'},
|
||||
&ui_select("sysinfo", int($uconfig{'sysinfo'}),
|
||||
[ map { [ $_, $webmin::text{'ui_sysinfo'.$_} ] } (0, 1, 4, 2, 3) ]));
|
||||
|
||||
print "<tr> <td><b>$text{'ui_nohost'}</b></td> <td>\n";
|
||||
printf "<input name=nohostname type=radio value=0 %s> %s\n",
|
||||
$uconfig{'nohostname'} ? '' : 'checked', $text{'yes'};
|
||||
printf "<input name=nohostname type=radio value=1 %s> %s</td> </tr>\n",
|
||||
$uconfig{'nohostname'} ? 'checked' : '', $text{'no'};
|
||||
print &ui_table_row($text{'ui_hostnamemode'},
|
||||
&ui_select("hostnamemode", int($uconfig{'hostnamemode'}),
|
||||
[ map { [ $_, $text{'ui_hnm'.$_} ] } (0 .. 3) ]).
|
||||
" ".&ui_textbox("hostnamedisplay", $uconfig{'hostnamedisplay'}, 20));
|
||||
|
||||
print "<tr> <td><b>$text{'ui_hostnamemode'}</b></td>\n";
|
||||
print "<td><select name=hostnamemode>\n";
|
||||
foreach $m (0 .. 3) {
|
||||
printf "<option value=%s %s>%s\n",
|
||||
$m, $uconfig{'hostnamemode'} == $m ? "selected" : "",
|
||||
$webmin::text{'ui_hnm'.$m};
|
||||
}
|
||||
print "</select>\n";
|
||||
printf "<input name=hostnamedisplay size=20 value='%s'>\n",
|
||||
$uconfig{'hostnamedisplay'};
|
||||
print "</td> </tr>\n";
|
||||
print &ui_table_row($webmin::text{'ui_showlogin'},
|
||||
&ui_yesno_radio("showlogin", int($uconfig{'showlogin'})));
|
||||
|
||||
print "<tr> <td><b>$webmin::text{'ui_showlogin'}</b></td> <td>\n";
|
||||
printf "<input name=showlogin type=radio value=1 %s> %s\n",
|
||||
$uconfig{'showlogin'} ? 'checked' : '', $text{'yes'};
|
||||
printf "<input name=showlogin type=radio value=0 %s> %s</td> </tr>\n",
|
||||
$uconfig{'showlogin'} ? '' : 'checked', $text{'no'};
|
||||
print &ui_table_row($webmin::text{'startpage_gotoone'},
|
||||
&ui_yesno_radio("gotoone", int($uconfig{'gotoone'})));
|
||||
|
||||
print "<tr> <td><b>$webmin::text{'startpage_gotoone'}</b></td> <td>\n";
|
||||
printf "<input name=gotoone type=radio value=1 %s> %s\n",
|
||||
$uconfig{'gotoone'} ? 'checked' : '', $text{'yes'};
|
||||
printf "<input name=gotoone type=radio value=0 %s> %s</td> </tr>\n",
|
||||
$uconfig{'gotoone'} ? '' : 'checked', $text{'no'};
|
||||
@modules = &list_modules();
|
||||
print &ui_table_row($webmin::text{'startpage_gotomodule'},
|
||||
&ui_select("gotomodule", $uconfig{'gotomodule'},
|
||||
[ [ "", $webmin::text{'startpage_gotonone'} ],
|
||||
map { [ $_->{'dir'}, $_->{'desc'} ] }
|
||||
sort { $a->{'desc'} cmp $b->{'desc'} } @modules ]));
|
||||
|
||||
print "<tr> <td><b>$webmin::text{'startpage_gotomodule'}</b></td>\n";
|
||||
print "<td><select name=gotomodule>\n";
|
||||
printf "<option value='' %s>%s\n",
|
||||
$uconfig{'gotomodule'} ? "" : "selected",
|
||||
$webmin::text{'startpage_gotonone'};
|
||||
foreach $m (&list_modules()) {
|
||||
printf "<option value=%s %s>%s\n",
|
||||
$m->{'dir'}, $uconfig{'gotomodule'} eq $m->{'dir'} ?
|
||||
'selected' : '', $m->{'desc'};
|
||||
}
|
||||
print "</select></td> </tr>\n";
|
||||
print &ui_table_row($text{'ui_feedbackmode'},
|
||||
&ui_radio('feedback_def',
|
||||
$uconfig{'feedback'} ? 0 : 1,
|
||||
[ [ 0, $text{'ui_feedbackyes'} . ' '
|
||||
. &ui_textbox('feedback', $uconfig{'feedback'}) ]
|
||||
, [ 1, $text{'no'} ] ]));
|
||||
|
||||
print "<tr> <td><b>$text{'ui_feedbackmode'}</b></td>\n";
|
||||
printf "<td><input type=radio name=feedback_def value=1 %s> %s\n",
|
||||
$uconfig{'feedback'} ? "" : "checked", $text{'no'};
|
||||
printf "<input type=radio name=feedback_def value=0 %s> %s\n",
|
||||
$uconfig{'feedback'} ? "checked" : "", $text{'ui_feedbackyes'};
|
||||
printf "<input name=feedback size=30 value='%s'></td> </tr>\n",
|
||||
$uconfig{'feedback'};
|
||||
|
||||
print "<tr> <td><b>$text{'ui_feedbackmail'}</b></td>\n";
|
||||
printf "<td nowrap><input type=radio name=feedbackmail_def value=1 %s> %s\n",
|
||||
$uconfig{'feedbackmail'} ? "" : "checked",
|
||||
$text{'ui_feedbackmail1'};
|
||||
printf "<input type=radio name=feedbackmail_def value=0 %s> %s\n",
|
||||
$uconfig{'feedbackmail'} ? "checked" : "",
|
||||
$text{'ui_feedbackmail0'};
|
||||
printf "<input name=feedbackmail size=30 value='%s'></td> </tr>\n",
|
||||
$uconfig{'feedbackmail'};
|
||||
print &ui_table_row($text{'ui_feedbackmail'},
|
||||
&ui_radio('feedbackmail_def',
|
||||
$uconfig{'feedbackmail'} ? 0 : 1,
|
||||
[ [ 1, $text{'ui_feedbackmail1'} ]
|
||||
, [ 0, $text{'ui_feedbackmail0'} . ' '
|
||||
. &ui_textbox('feedbackmail', $uconfig{'feedbackmail'}) ] ]));
|
||||
|
||||
print "<tr> <td><b>$text{'ui_feedbackhost'}</b></td>\n";
|
||||
printf "<td><input type=radio name=feedbackhost_def value=1 %s> %s\n",
|
||||
@@ -110,20 +68,17 @@ printf "<input type=radio name=feedbackhost_def value=0 %s>\n",
|
||||
printf "<input name=feedbackhost size=30 value='%s'></td> </tr>\n",
|
||||
$uconfig{'feedbackhost'};
|
||||
|
||||
print "<tr> <td><b>$text{'ui_tabs'}</b></td> <td>\n";
|
||||
printf "<input name=notabs type=radio value=0 %s> %s\n",
|
||||
$uconfig{'notabs'} ? '' : 'checked', $text{'yes'};
|
||||
printf "<input name=notabs type=radio value=1 %s> %s</td> </tr>\n",
|
||||
$uconfig{'notabs'} ? 'checked' : '', $text{'no'};
|
||||
print &ui_table_row($text{'ui_tabs'},
|
||||
&ui_radio("notabs", $uconfig{'notabs'} ? 1 : 0,
|
||||
[ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]));
|
||||
|
||||
print "<tr> <td><b>$webmin::text{'ui_dateformat'}</b></td> <td>\n";
|
||||
print &ui_select("dateformat", $uconfig{'dateformat'} || "dd/mon/yyyy",
|
||||
[ map { [ $_, $webmin::text{'ui_dateformat_'.$_} ] }
|
||||
@webmin::webmin_date_formats ]);
|
||||
print "</td> </tr>\n";
|
||||
print &ui_table_row($webmin::text{'ui_dateformat'},
|
||||
&ui_select("dateformat", $uconfig{'dateformat'} || "dd/mon/yyyy",
|
||||
[ map { [ $_, $text{'ui_dateformat_'.$_} ] }
|
||||
@webmin::webmin_date_formats ]));
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ "save", $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user