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 {
$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'))));
$icon = get_parameter('icon', 0);
$icon = get_parameter('icon', 'os@svg.svg');
}
$icon_upload = get_parameter('icon_upload', null);
@ -246,7 +246,7 @@ $iconData[] = html_print_select(
'icon',
$icon,
'show_icon_OS();',
__('None'),
'',
0,
true
);
@ -356,6 +356,8 @@ function get_list_os_icons_dir()
}
}
$return['os@svg.svg'] = __('None');
return $return;
}

View File

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

View File

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