change way to print discovery simple multiple inputs

Former-commit-id: 845171053b2002d036f0f8992a2aacad4ec0a561
This commit is contained in:
alejandro-campos 2019-04-24 12:32:33 +02:00
parent 92da84c47f
commit 7433d52130
3 changed files with 34 additions and 16 deletions

View File

@ -685,6 +685,7 @@ class HostDevices extends Wizard
'return' => true,
'class' => 'discovery_list_input',
'size' => 9,
'simple_multiple_options' => true,
]);
if (isset($this->task['id_rt']) === true) {

View File

@ -480,7 +480,8 @@ class Wizard
((isset($data['strict_user']) === true) ? $data['strict_user'] : false),
((isset($data['delete_groups']) === true) ? $data['delete_groups'] : false),
((isset($data['include_groups']) === true) ? $data['include_groups'] : false),
((isset($data['size']) === true) ? $data['size'] : false)
((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['simple_multiple_options']) === true) ? $data['simple_multiple_options'] : false)
);
case 'submit':

View File

@ -437,7 +437,8 @@ function html_print_select_groups(
$strict_user=false,
$delete_groups=false,
$include_groups=false,
$size=false
$size=false,
$simple_multiple_options=false
) {
global $config;
@ -483,7 +484,11 @@ function html_print_select_groups(
$disabled,
$style,
$option_style,
$size
$size,
false,
'',
false,
$simple_multiple_options
);
if ($return) {
@ -531,7 +536,8 @@ function html_print_select(
$size=false,
$modal=false,
$message='',
$select_all=false
$select_all=false,
$simple_multiple_options=false
) {
$output = "\n";
@ -551,11 +557,21 @@ function html_print_select(
$attributes .= ' onchange="'.$script.'"';
}
if ($size !== false)
$attributes .= ' size="'.$size.'"';
if (!empty($multiple)) {
if ($size !== false) {
$attributes .= ' multiple="multiple" size="'.$size.'"';
} else {
$attributes .= ' multiple="multiple" size="10"';
}
}
if (!empty($multiple))
$attributes .= ' multiple="multiple"';
if ($simple_multiple_options === true) {
if ($size !== false) {
$attributes .= ' size="'.$size.'"';
} else {
$attributes .= ' size="10"';
}
}
if (!empty($class)) {
$attributes .= ' class="'.$class.'"';