3 # Display the form for one custom command on a page
5 require './custom-lib.pl';
7 $cmd = &get_command($in{'id'}, $in{'idx'});
8 &can_run_command($cmd) || &error($text{'form_ecannot'});
10 # Display form for command parameters
11 &ui_print_header(undef, $text{'form_title'}, "");
12 @a = @{$cmd->{'args'}};
13 @up = grep { $_->{'type'} == 10 } @a;
15 print &ui_form_start("view.cgi");
19 @ufn = map { $_->{'name'} } @up;
21 print &ui_form_start("run.cgi?id=$upid",
23 &read_parse_mime_javascript($upid, \@ufn));
26 print &ui_form_start("run.cgi", "post");
29 print &ui_form_start("run.cgi");
31 print &ui_hidden("id", $cmd->{'id'});
32 print &ui_table_start(&html_escape($cmd->{'desc'}), "width=100%", 4,
33 [ "width=20%", "width=30%", "width=20%", "width=30%" ]);
34 print &ui_table_row(undef, $cmd->{'html'}, 4) if ($cmd->{'html'});
36 foreach $a (@{$cmd->{'args'}}) {
37 print &ui_table_row(&html_escape($a->{'desc'}),
38 &show_parameter_input($a, 0));
41 $txt = $cmd->{'edit'} ? $text{'form_edit'} : $text{'form_exec'};
42 print &ui_table_end();
43 print &ui_form_end([ [ undef, $txt ] ]);
45 &ui_print_footer("", $text{'index_return'});