mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
Add new parameter type which is actually a submit button
This commit is contained in:
@ -38,3 +38,5 @@ A command can now be configured to not display any output at all, and instead re
|
||||
---- Changes since 1.560 ----
|
||||
Added an option to the file editor to run a command before the file is displayed, thanks to a suggestion from Sart Cole.
|
||||
Added new date and left-right menu parameter types.
|
||||
---- Changes since 1.570 ----
|
||||
Added a new parameter type which is a submit button.
|
||||
|
@ -1,4 +1,3 @@
|
||||
line1=Configurable options,11
|
||||
display_mode=Main page shows,1,0-All commands and parameters,1-Links to commands
|
||||
width=Width of file editor window,3,Default (80 chars)
|
||||
height=Height of file editor window,3,Default (20 chars)
|
||||
|
@ -459,6 +459,9 @@ foreach my $a (@{$cmd->{'args'}}) {
|
||||
$setin->{$n."_month"}."-".
|
||||
$setin->{$n."_day"};
|
||||
}
|
||||
elsif ($a->{'type'} == 16) {
|
||||
$rv = $setin->{$n} ? 1 : 0;
|
||||
}
|
||||
if ($rv eq '' && $a->{'must'} && $a->{'type'} != 7) {
|
||||
&error(&text('run_emust', $a->{'desc'}));
|
||||
}
|
||||
@ -620,6 +623,9 @@ elsif ($a->{'type'} == 15) {
|
||||
$n."_day", $n."_month", $n."_year")." ".
|
||||
&date_chooser_button($n."_day", $n."_month", $n."_year");
|
||||
}
|
||||
elsif ($a->{'type'} == 16) {
|
||||
return &ui_submit($v || $a->{'name'}, $a->{'name'});
|
||||
}
|
||||
else {
|
||||
return "Unknown parameter type $a->{'type'}";
|
||||
}
|
||||
|
@ -35,12 +35,14 @@ print &ui_table_row(undef, $cmd->{'html'}, 4) if ($cmd->{'html'});
|
||||
|
||||
foreach $a (@{$cmd->{'args'}}) {
|
||||
print &ui_table_row(&html_escape($a->{'desc'}),
|
||||
&show_parameter_input($a, 0));
|
||||
&show_parameter_input($a, 0), 1,
|
||||
[ "valign=top", "valign=top" ]);
|
||||
$got_submit++ if ($a->{'type'} == 16);
|
||||
}
|
||||
|
||||
$txt = $cmd->{'edit'} ? $text{'form_edit'} : $text{'form_exec'};
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $txt ] ]);
|
||||
print &ui_form_end($got_submit ? [ ] : [ [ undef, $txt ] ]);
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
|
@ -56,7 +56,11 @@ elsif ($config{'display_mode'} == 0) {
|
||||
$html .= &ui_table_start(undef, undef, $w,
|
||||
$config{'columns'} == 1 ? [ "width=20%", "width=30%" ]
|
||||
: [ "width=30%" ]);
|
||||
$html .= &ui_table_row(undef, &ui_submit($c->{'desc'}), $w, []);
|
||||
($got_submit) = grep { $_->{'type'} == 16 } @a;
|
||||
if (!$got_submit) {
|
||||
$html .= &ui_table_row(undef,
|
||||
&ui_submit($c->{'desc'}), $w, []);
|
||||
}
|
||||
if ($c->{'html'}) {
|
||||
$html .= &ui_table_row(undef,
|
||||
&filter_javascript($c->{'html'}), $w, []);
|
||||
|
@ -51,6 +51,7 @@ edit_type12=Multi menu..
|
||||
edit_type13=Large multi menu..
|
||||
edit_type14=Left-right menu..
|
||||
edit_type15=Date
|
||||
edit_type16=Submit button..
|
||||
edit_noshow=Hide command when executing?
|
||||
edit_usermin=Available in Usermin?
|
||||
edit_timeout=Maximum time to wait for command?
|
||||
|
Reference in New Issue
Block a user