From 1e51197afb80b2b96c1f8347e2a2292ba8d023ef Mon Sep 17 00:00:00 2001 From: Calvo Date: Wed, 27 Oct 2021 19:39:18 +0200 Subject: [PATCH] Fix menu favourite GIS maps. services and dashboards large title --- pandora_console/include/constants.php | 1 + pandora_console/include/functions_menu.php | 4 ++-- pandora_console/operation/menu.php | 8 ++++---- pandora_console/views/dashboard/formDashboard.php | 9 +++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index a1d09d9148..b5557c7139 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -173,6 +173,7 @@ define('COL_GRAPH13', '#E83128'); // Styles. // Size of text in characters for truncate. define('GENERIC_SIZE_TEXT', 50); +define('MENU_SIZE_TEXT', 28); diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 482883f9e1..d16af2e5bb 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -376,11 +376,11 @@ function menu_print_menu(&$menu) if (isset($sub2['title'])) { $sub_title = $sub2['title']; } else { - $sub_title = ''; + $sub_title = $sub2['text']; } $submenu2_list .= '
  • '; - $submenu2_list .= '
    '.$sub2['text'].'
  • '; + $submenu2_list .= '
    '.$sub2['text'].'
    '; $sub_title = ''; } diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 1d8178f1af..6c552d6e3c 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -220,7 +220,7 @@ if (check_acl($config['id_user'], 0, 'VR') || check_acl($config['id_user'], 0, ' $name = io_safe_output($layout['name']); - $sub2['operation/visual_console/render_view&id='.$layout['id']]['text'] = mb_substr($name, 0, 19); + $sub2['operation/visual_console/render_view&id='.$layout['id']]['text'] = ui_print_truncate_text($name, MENU_SIZE_TEXT, false, true, false); $sub2['operation/visual_console/render_view&id='.$layout['id']]['id'] = mb_substr($name, 0, 19); $sub2['operation/visual_console/render_view&id='.$layout['id']]['title'] = $name; if (!empty($config['vc_refr'])) { @@ -235,7 +235,7 @@ if (check_acl($config['id_user'], 0, 'VR') || check_acl($config['id_user'], 0, ' if ($break_max_console) { $sub2['godmode/reporting/visual_console_favorite']['text'] = __('Show more').' >'; $sub2['godmode/reporting/visual_console_favorite']['id'] = 'visual_favourite_console'; - $sub2['godmode/reporting/visual_console_favorite']['title'] = 'show_more'; + $sub2['godmode/reporting/visual_console_favorite']['title'] = __('Show more'); $sub2['godmode/reporting/visual_console_favorite']['refr'] = 0; } @@ -281,7 +281,7 @@ if (check_acl($config['id_user'], 0, 'MR') || check_acl($config['id_user'], 0, ' continue; } - $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['text'] = mb_substr(io_safe_output($gisMap['map_name']), 0, 15); + $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['text'] = ui_print_truncate_text(io_safe_output($gisMap['map_name']), MENU_SIZE_TEXT, false, true, false); $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['id'] = mb_substr(io_safe_output($gisMap['map_name']), 0, 15); $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['title'] = io_safe_output($gisMap['map_name']); $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['refr'] = 0; @@ -345,7 +345,7 @@ if (check_acl($config['id_user'], 0, 'RR') || check_acl($config['id_user'], 0, ' $name = io_safe_output($dashboard['name']); $sub2['operation/dashboard/dashboard&dashboardId='.$dashboard['id']] = [ - 'text' => mb_substr($name, 0, 19), + 'text' => ui_print_truncate_text($name, MENU_SIZE_TEXT, false, true, false), 'title' => $name, ]; } diff --git a/pandora_console/views/dashboard/formDashboard.php b/pandora_console/views/dashboard/formDashboard.php index 05164f7b00..71b4ce906d 100644 --- a/pandora_console/views/dashboard/formDashboard.php +++ b/pandora_console/views/dashboard/formDashboard.php @@ -76,10 +76,11 @@ $inputs = [ [ 'label' => __('Name'), 'arguments' => [ - 'type' => 'text', - 'name' => 'name', - 'value' => $arrayDashboard['name'], - 'size' => '', + 'type' => 'text', + 'name' => 'name', + 'value' => $arrayDashboard['name'], + 'size' => '', + 'maxlength' => 35, ], ], [