mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
More UI conversion
This commit is contained in:
@@ -22,7 +22,7 @@ else {
|
||||
|
||||
print &ui_form_start("save_fmisc.cgi", "post");
|
||||
print &ui_hidden("old_name", $s);
|
||||
print &ui_table_start($text{'misc_title'}, undef, 4);
|
||||
print &ui_table_start($text{'misc_title'}, undef, 2);
|
||||
|
||||
print &ui_table_row($text{'fmisc_lockfile'},
|
||||
&yesno_input("locking"));
|
||||
|
||||
@@ -22,7 +22,7 @@ else {
|
||||
|
||||
print &ui_form_start("save_fname.cgi", "post");
|
||||
print &ui_hidden("old_name", $s);
|
||||
print &ui_table_start($text{'fname_option'}, undef, 4);
|
||||
print &ui_table_start($text{'fname_option'}, undef, 2);
|
||||
|
||||
print &ui_table_row($text{'fname_manglecase'},
|
||||
&yesno_input("mangle case"));
|
||||
|
||||
@@ -19,79 +19,47 @@ else {
|
||||
}
|
||||
&get_share($s);
|
||||
|
||||
print "<form action=save_popts.cgi>\n";
|
||||
print "<input type=hidden name=old_name value=\"$s\">\n";
|
||||
print &ui_form_start("save_popts.cgi", "post");
|
||||
print &ui_hidden("old_name", $s);
|
||||
print &ui_table_start($text{'print_option'}, undef, 2);
|
||||
|
||||
# Printer options
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'print_option'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table>\n";
|
||||
print &ui_table_row($text{'print_minspace'},
|
||||
&ui_textbox("min_print_space", &getval("min print space"), 6)." kB");
|
||||
|
||||
print "<tr> <td><b>$text{'print_minspace'}</b></td>\n";
|
||||
printf "<td><input name=min_print_space size=5 value=\"%d\"></td>\n",
|
||||
&getval("min print space");
|
||||
print &ui_table_row($text{'print_postscript'},
|
||||
&yesno_input("postscript"));
|
||||
|
||||
print "<td><b>$text{'print_postscript'}</b></td>\n";
|
||||
print "<td>",&yesno_input("postscript"),"</td> </tr>\n";
|
||||
print &ui_table_row($text{'print_command'},
|
||||
&ui_opt_textbox("print_command", &getval("print command"), 40,
|
||||
$text{'default'}));
|
||||
|
||||
print "<tr> <td><b>$text{'print_command'}</b></td>\n";
|
||||
printf "<td colspan=3>\n";
|
||||
printf "<input type=radio name=print_command_def value=1 %s> $text{'default'}\n",
|
||||
&getval("print command") eq "" ? "checked" : "";
|
||||
printf " <input type=radio name=print_command_def value=0 %s>\n",
|
||||
&getval("print command") ne "" ? "checked" : "";
|
||||
printf "<input name=print_command size=30 value=\"%s\"></td> </tr>\n",
|
||||
&getval("print command");
|
||||
print &ui_table_row($text{'print_queue'},
|
||||
&ui_opt_textbox("lpq_command", &getval("lpq command"), 40,
|
||||
$text{'default'}));
|
||||
|
||||
print "<tr> <td><b>$text{'print_queue'}</b></td>\n";
|
||||
printf "<td colspan=3>\n";
|
||||
printf "<input type=radio name=lpq_command_def value=1 %s> $text{'default'}\n",
|
||||
&getval("lpq command") eq "" ? "checked" : "";
|
||||
printf " <input type=radio name=lpq_command_def value=0 %s>\n",
|
||||
&getval("lpq command") ne "" ? "checked" : "";
|
||||
printf "<input name=lpq_command size=30 value=\"%s\"></td> </tr>\n",
|
||||
&getval("lpq command");
|
||||
print &ui_table_row($text{'print_delete'},
|
||||
&ui_opt_textbox("lprm_command", &getval("lprm command"), 40,
|
||||
$text{'default'}));
|
||||
|
||||
print "<tr> <td><b>$text{'print_delete'}</b></td>\n";
|
||||
printf "<td colspan=3>\n";
|
||||
printf "<input type=radio name=lprm_command_def value=1 %s> $text{'default'}\n",
|
||||
&getval("lprm command") eq "" ? "checked" : "";
|
||||
printf " <input type=radio name=lprm_command_def value=0 %s>\n",
|
||||
&getval("lprm command") ne "" ? "checked" : "";
|
||||
printf "<input name=lprm_command size=30 value=\"%s\"></td> </tr>\n",
|
||||
&getval("lprm command");
|
||||
print &ui_table_row($text{'print_pause'},
|
||||
&ui_opt_textbox("lppause_command", &getval("lppause command"), 40,
|
||||
$text{'default'}));
|
||||
|
||||
print "<tr> <td><b>$text{'print_pause'}</b></td>\n";
|
||||
printf "<td colspan=3>\n";
|
||||
printf "<input type=radio name=lppause_command_def value=1 %s> $text{'config_none'}\n",
|
||||
&getval("lppause command") eq "" ? "checked" : "";
|
||||
printf " <input type=radio name=lppause_command_def value=0 %s>\n",
|
||||
&getval("lppause command") ne "" ? "checked" : "";
|
||||
printf "<input name=lppause_command size=30 value=\"%s\"></td> </tr>\n",
|
||||
&getval("lppause command");
|
||||
print &ui_table_row($text{'print_unresume'},
|
||||
&ui_opt_textbox("lpresume_command", &getval("lpresume command"), 40,
|
||||
$text{'default'}));
|
||||
|
||||
print "<tr> <td><b>$text{'print_unresume'}</b></td>\n";
|
||||
printf "<td colspan=3>\n";
|
||||
printf "<input type=radio name=lpresume_command_def value=1 %s> $text{'config_none'}\n",
|
||||
&getval("lpresume command") eq "" ? "checked" : "";
|
||||
printf " <input type=radio name=lpresume_command_def value=0 %s>\n",
|
||||
&getval("lpresume command") ne "" ? "checked" : "";
|
||||
printf "<input name=lpresume_command size=30 value=\"%s\"></td> </tr>\n",
|
||||
&getval("lpresume command");
|
||||
print &ui_table_row($text{'print_driver'},
|
||||
&ui_opt_textbox("printer_driver", &getval("printer driver"), 40,
|
||||
$text{'config_none'}));
|
||||
|
||||
print "<tr> <td><b>$text{'print_driver'}</b></td>\n";
|
||||
print "<td colspan=3>\n";
|
||||
printf "<input type=radio name=printer_driver_def value=1 %s> $text{'config_none'}\n",
|
||||
&getval("printer driver") eq "" ? "checked" : "";
|
||||
printf " <input type=radio name=printer_driver_def value=0 %s>\n",
|
||||
&getval("printer driver") ne "" ? "checked" : "";
|
||||
printf "<input name=printer_driver size=30 value=\"%s\"></td> </tr>\n",
|
||||
&getval("printer driver");
|
||||
|
||||
print "</table> </td></tr></table><p>\n";
|
||||
print "<input type=submit value=$text{'save'}>"
|
||||
if &can('wO', \%access, $in{'share'});
|
||||
print "</form><p>\n";
|
||||
print &ui_table_end();
|
||||
if (&can('wO', \%access, $in{'share'})) {
|
||||
print &ui_form_end([ [ undef, $text{'save'} ] ]);
|
||||
}
|
||||
else {
|
||||
print &ui_form_end();
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_pshare.cgi?share=".&urlize($s), $text{'index_printershare'},
|
||||
"", $text{'index_sharelist'});
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
# edit_pshare.cgi
|
||||
# Display a form for editing or creating a new printer share
|
||||
|
||||
require './samba-lib.pl';
|
||||
&ReadParse();
|
||||
$s = $in{'share'};
|
||||
# check acls
|
||||
%access = &get_module_acl();
|
||||
&error_setup("<blink><font color=red>$text{'eacl_aviol'}</font></blink>");
|
||||
if(!$s) {
|
||||
&error("$text{'eacl_np'} $text{'eacl_pcps'}")
|
||||
unless $access{'c_ps'};
|
||||
}
|
||||
else {
|
||||
&error("$text{'eacl_np'} $text{'eacl_paps'}")
|
||||
unless &can('r', \%access, $in{'share'});
|
||||
}
|
||||
# display
|
||||
if ($s) {
|
||||
&header($s eq 'global' ? $text{'pshare_title1'} : $text{'pshare_title2'}, "");
|
||||
&get_share($s);
|
||||
}
|
||||
else {
|
||||
&header($text{'pshare_title3'}, "");
|
||||
}
|
||||
print "<hr>\n";
|
||||
|
||||
print "<form action=save_pshare.cgi>\n";
|
||||
if ($s) { print "<input type=hidden name=old_name value=\"$s\">\n"; }
|
||||
|
||||
# Vital share options..
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'pshare_info'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table>\n";
|
||||
if ($s ne "global") {
|
||||
if ($copy = &getval("copy")) {
|
||||
print "<tr> <td colspan=4><b>", &text('share_copy',$copy),"</b></td> </tr>\n";
|
||||
}
|
||||
print "<tr> <td><b>$text{'pshare_name'}</b></td>\n";
|
||||
printf "<td colspan=3><input type=radio name=printers value=0 %s>\n",
|
||||
$s eq "printers" ? "" : "checked";
|
||||
printf "<input size=10 name=share value=\"%s\"> \n",
|
||||
$s eq "printers" ? "" : $s;
|
||||
printf "<input type=radio name=printers value=1 %s> $text{'pshare_all'}\n",
|
||||
$s eq "printers" ? "checked" : "";
|
||||
print "</td> </tr>\n";
|
||||
}
|
||||
|
||||
print "<tr> <td><b>$text{'pshare_unixprn'}</b></td>\n";
|
||||
if (&foreign_check("lpadmin")) {
|
||||
&foreign_require("lpadmin", "lpadmin-lib.pl");
|
||||
@plist = &foreign_call("lpadmin", "list_printers");
|
||||
}
|
||||
elsif ($config{'list_printers_command'}) {
|
||||
@plist = split(/\s+/ , `$config{'list_printers_command'}`);
|
||||
}
|
||||
if (@plist) {
|
||||
print "<td><select name=printer>\n";
|
||||
printf "<option value=\"\" %s> %s\n",
|
||||
&getval("printer") eq "" ? "checked" : "",
|
||||
$s eq "global" ? $text{'config_none'} : $text{'default'};
|
||||
foreach $p (@plist) {
|
||||
printf "<option value=\"$p\" %s> $p\n",
|
||||
$p eq &getval("printer") ? "selected" : "";
|
||||
}
|
||||
print "</select></td>\n";
|
||||
}
|
||||
else {
|
||||
print "<td><input name=printer size=8></td>\n";
|
||||
}
|
||||
|
||||
print "<td><b>$text{'pshare_spool'}</b></td>\n";
|
||||
printf "<td><input name=path size=35 value=\"%s\">\n",
|
||||
&getval("path");
|
||||
print &file_chooser_button("path", 1);
|
||||
print "</td> </tr>\n";
|
||||
|
||||
print "<tr> <td><b>$text{'share_available'}</b></td>\n";
|
||||
print "<td>",&yesno_input("available"),"</td>\n";
|
||||
|
||||
print "<td><b>$text{'share_browseable'}</b></td>\n";
|
||||
print "<td>",&yesno_input("browseable"),"</td> </tr>\n";
|
||||
|
||||
print "<td align=right><b>$text{'share_comment'}</b></td>\n";
|
||||
printf "<td colspan=3 align=left>\n";
|
||||
printf "<input size=40 name=comment value=\"%s\"></td> </tr>\n",
|
||||
&getval("comment");
|
||||
|
||||
print "<tr> <td colspan=4 align=center>$text{'share_samedesc1'}</td> </tr>\n"
|
||||
if ($s eq "global");
|
||||
|
||||
print "</table> </td></tr></table><p>\n";
|
||||
|
||||
if ($s eq "global") {
|
||||
print "<input type=submit value=$text{'save'}> </form><p>\n";
|
||||
}
|
||||
elsif ($s) {
|
||||
print "<table width=100%> <tr>\n";
|
||||
print "<td align=left><input type=submit value=$text{'save'}></td>\n"
|
||||
if &can('rw', \%access, $s);
|
||||
print "</form><form action=view_users.cgi>\n";
|
||||
print "<input type=hidden name=share value=\"$s\">\n";
|
||||
print "<input type=hidden name=printer value=1>\n";
|
||||
print "<td align=center><input type=submit value=\"$text{'index_view'}\"></td>\n"
|
||||
if &can('rv', \%access, $s);
|
||||
print "</form><form action=delete_share.cgi>\n";
|
||||
print "<input type=hidden name=share value=\"$s\">\n";
|
||||
print "<input type=hidden name=type value=pshare>\n";
|
||||
print "<td align=right><input type=submit value=$text{'delete'}></td>\n"
|
||||
if &can('rw', \%access, $s);
|
||||
print "</form> </tr> </table> <p>\n";
|
||||
}
|
||||
else {
|
||||
print "<input type=submit value=$text{'create'}> </form><p>\n";
|
||||
}
|
||||
|
||||
if ($s) {
|
||||
# Icons for other share options
|
||||
$us = "share=".&urlize($s)."&printer=1";
|
||||
local (@url, @text, @icon, $disp);
|
||||
if (&can('rs',\%access, $s)) {
|
||||
push(@url, "edit_sec.cgi?$us");
|
||||
push(@text, $text{'share_security'});
|
||||
push(@icon, "images/icon_2.gif");
|
||||
$disp++;
|
||||
}
|
||||
if (&can('ro',\%access, $s)) {
|
||||
push(@url, "edit_popts.cgi?$us");
|
||||
push(@text, $text{'print_option'});
|
||||
push(@icon, "images/icon_3.gif");
|
||||
$disp++;
|
||||
}
|
||||
if ($disp) {
|
||||
print "<hr>\n";
|
||||
print "<h3>$text{'share_option'}</h3>\n";
|
||||
&icons_table(\@url, \@text, \@icon);
|
||||
}
|
||||
}
|
||||
|
||||
print "<hr>\n";
|
||||
&footer("", $text{'index_sharelist'});
|
||||
@@ -282,7 +282,7 @@ print_queue=Display queue command
|
||||
print_delete=Delete job command
|
||||
print_pause=Pause job command
|
||||
print_unresume=Unresume job command
|
||||
print_driver=Printer Driver
|
||||
print_driver=Printer driver
|
||||
|
||||
pshare_title1=Printer Share Defaults
|
||||
pshare_title2=Edit Printer Share
|
||||
|
||||
Reference in New Issue
Block a user