From 914ac2815125e0647ade5a3db83ef868f95ebca8 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 3 Sep 2019 12:59:24 +0200 Subject: [PATCH] Changed checkboxes for combo multiselect in File repository manager --- .../extensions/files_repo/files_repo_form.php | 16 ++++------------ .../files_repo/functions_files_repo.php | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/pandora_console/extensions/files_repo/files_repo_form.php b/pandora_console/extensions/files_repo/files_repo_form.php index 2035cfbd1a..b8e6a084b9 100644 --- a/pandora_console/extensions/files_repo/files_repo_form.php +++ b/pandora_console/extensions/files_repo/files_repo_form.php @@ -44,24 +44,16 @@ $groups = groups_get_all(); // Add the All group to the beginning to be always the first // Use this instead array_unshift to keep the array keys $groups = ([0 => __('All')] + $groups); -$html = ''; -$style = 'style="padding: 2px 10px; display: inline-block;"'; +$groups_selected = []; foreach ($groups as $id => $name) { - $checked = in_array($id, $file['groups']); - $all_checked = false; - if ($id === 0) { - $checkbox = html_print_checkbox_extended('groups[]', $id, $checked, false, '', 'class="chkb_all"', true); - $all_checked = $checked; - } else { - $checkbox = html_print_checkbox_extended('groups[]', $id, $checked, $all_checked, '', 'class="chkb_group"', true); + if (in_array($id, $file['groups'])) { + $groups_selected[] = $id; } - - $html .= "
$name $checkbox
"; } $row = []; $row[0] = __('Groups'); -$row[1] = $html; +$row[1] = html_print_select($groups, 'groups[]', $groups_selected, '', '', '', true, true, '', '', ''); $table->data[] = $row; $table->colspan[][1] = 3; diff --git a/pandora_console/extensions/files_repo/functions_files_repo.php b/pandora_console/extensions/files_repo/functions_files_repo.php index 3d9bdccd38..32ce4c216c 100644 --- a/pandora_console/extensions/files_repo/functions_files_repo.php +++ b/pandora_console/extensions/files_repo/functions_files_repo.php @@ -193,7 +193,7 @@ function files_repo_add_file($file_input_name='upfile', $description='', $groups global $config; $attachment_path = io_safe_output($config['attachment_store']); - $files_repo_path = $attachment_path.'/'.'files_repo'; + $files_repo_path = $attachment_path.'/files_repo'; $result = []; $result['status'] = false;