This commit is contained in:
Jonathan 2024-01-22 16:21:51 +01:00
parent 23c33a73f6
commit a747308b26
3 changed files with 33 additions and 11 deletions

View File

@ -48,7 +48,7 @@ if ($idOS > 0) {
} else { } else {
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name'))))); $name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description')))); $description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0); $icon = get_parameter('icon', 'os@svg.svg');
} }
$icon_upload = get_parameter('icon_upload', null); $icon_upload = get_parameter('icon_upload', null);
@ -246,7 +246,7 @@ $iconData[] = html_print_select(
'icon', 'icon',
$icon, $icon,
'show_icon_OS();', 'show_icon_OS();',
__('None'), '',
0, 0,
true true
); );
@ -356,6 +356,8 @@ function get_list_os_icons_dir()
} }
} }
$return['os@svg.svg'] = __('None');
return $return; return $return;
} }

View File

@ -88,6 +88,14 @@ switch ($tab) {
break; break;
case 'manage_os': case 'manage_os':
$id_os = get_parameter('id_os', '');
if ($id_os !== '') {
$headerTitle = __('Edit OS');
} else {
$headerTitle = __('Create OS');
}
break;
case 'list': case 'list':
if ($action === 'edit') { if ($action === 'edit') {
$headerTitle = __('Edit OS'); $headerTitle = __('Edit OS');

View File

@ -969,15 +969,27 @@ function ui_print_os_icon(
$options['title'] = $os_name; $options['title'] = $os_name;
} }
$output = html_print_image( if ($icon === '.png') {
'images/'.$subfolder.'/'.$icon, $output = html_print_image(
true, 'images/os@svg.svg',
$options, true,
false, $options,
$relative, false,
$no_in_meta, $relative,
true $no_in_meta,
); true
);
} else {
$output = html_print_image(
'images/'.$subfolder.'/'.$icon,
true,
$options,
false,
$relative,
$no_in_meta,
true
);
}
} }
} else { } else {
// $output = "<img src='images/os_icons/" . $icon . "' alt='" . $os_name . "' title='" . $os_name . "'>"; // $output = "<img src='images/os_icons/" . $icon . "' alt='" . $os_name . "' title='" . $os_name . "'>";