mirror of
https://github.com/webmin/webmin.git
synced 2025-08-17 19:06:28 +00:00
Multi-menu parameter type
This commit is contained in:
@ -29,3 +29,4 @@ Added a button to clone an existing command when editing.
|
||||
The sort order of commands can now be set on the Module Config page, and is respected in the Webmin Users module.
|
||||
---- Changes since 1.510 ----
|
||||
Fixed a bug that broke remote command execution with parameters.
|
||||
Added a new parameter type for selecting multiple items from a menu.
|
||||
|
@ -431,6 +431,18 @@ foreach my $a (@{$cmd->{'args'}}) {
|
||||
chown($uinfo->[2], $uinfo->[3], $rv);
|
||||
push(@unlink, $rv);
|
||||
}
|
||||
elsif ($a->{'type'} == 12) {
|
||||
local @vals = split(/\0/, $setin->{$n});
|
||||
local @opts = &read_opts_file($a->{'opts'});
|
||||
foreach my $v (@vals) {
|
||||
local $found;
|
||||
foreach my $l (@opts) {
|
||||
$found++ if ($l->[0] eq $v);
|
||||
}
|
||||
$found || &error($text{'run_eopt'});
|
||||
}
|
||||
$rv = join(" ", @vals);
|
||||
}
|
||||
if ($rv eq '' && $a->{'must'} && $a->{'type'} != 7) {
|
||||
&error(&text('run_emust', $a->{'desc'}));
|
||||
}
|
||||
@ -552,6 +564,10 @@ elsif ($a->{'type'} == 10) {
|
||||
elsif ($a->{'type'} == 11) {
|
||||
return &ui_textarea($n, undef, 4, 30);
|
||||
}
|
||||
elsif ($a->{'type'} == 12) {
|
||||
return &ui_select($n, undef, [ &read_opts_file($a->{'opts'}) ],
|
||||
5, 1);
|
||||
}
|
||||
else {
|
||||
return "Unknown parameter type $a->{'type'}";
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ edit_type8=Password
|
||||
edit_type9=Menu..
|
||||
edit_type10=Upload
|
||||
edit_type11=Text box
|
||||
edit_type12=Multi menu..
|
||||
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