---- Changes since 1.390 ----
Re-designed the user interface somewhat, and converted all code to use the new Webmin UI library.
When commands are shown in a table and no parameters are needed, the names now link directly to run the command.
+---- Changes since 1.400 ----
+Added a popup progress tracker to commands with file upload fields.
# Display form for command parameters
&ui_print_header(undef, $text{'form_title'}, "");
@a = @{$cmd->{'args'}};
-($up) = grep { $_->{'type'} == 10 } @a;
+@up = grep { $_->{'type'} == 10 } @a;
if ($cmd->{'edit'}) {
print &ui_form_start("view.cgi");
}
-elsif ($up) {
- print &ui_form_start("run.cgi", "form-data");
+elsif (@up) {
+ # Has upload fields
+ @ufn = map { $_->{'name'} } @up;
+ $upid = time().$$;
+ $html .= &ui_form_start("run.cgi?id=$upid",
+ "form-data", undef,
+ &read_parse_mime_javascript($upid, \@ufn));
}
elsif (@a) {
print &ui_form_start("run.cgi", "post");
$html .= &ui_form_start("sql.cgi");
}
else {
- local ($up) = grep { $_->{'type'} == 10 } @a;
- if ($up) {
- $html .= &ui_form_start("run.cgi", "form-data");
+ local @up = grep { $_->{'type'} == 10 } @a;
+ if (@up) {
+ # Has upload fields
+ @ufn = map { $_->{'name'} } @up;
+ $upid = time().$$;
+ $html .= &ui_form_start("run.cgi?id=$upid",
+ "form-data", undef,
+ &read_parse_mime_javascript($upid, \@ufn));
}
elsif (@a) {
$html .= &ui_form_start("run.cgi", "post");
run_noout=No output generated
run_ecmduser=User '$1' to run command as does not exist
run_eopt=Invalid option selected
+run_eupload=No file to upload selected
run_timeout=Command terminated after $1 second timeout.
log_modify=Modified command $1
require './custom-lib.pl';
$theme_no_table = 1;
if ($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data/i) {
- &ReadParseMime();
+ &ReadParse(\%getin, "GET");
+ &ReadParseMime(undef, \&read_parse_mime_callback, [ $getin{'id'} ]);
}
else {
&ReadParse();