From 64ed03784b47591d88a1fb96bb2e1339c3c801b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= Date: Thu, 24 Feb 2022 11:04:18 +0100 Subject: [PATCH] Fix several issues with mobile view --- pandora_console/include/functions_ui.php | 27 +++++++------- pandora_console/mobile/include/ui.class.php | 5 ++- pandora_console/mobile/operation/alerts.php | 40 +++++++++++++++------ 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index b3b66a4a9b..c146bf5e69 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2713,16 +2713,15 @@ function ui_print_status_image( $imagepath = $path; } - if ($imagepath == 'images/status_sets/default') { + if ($imagepath === 'images/status_sets/default') { $image_with_css = true; } - $imagepath .= '/'.$type; - if ($image_with_css === true) { $shape_status = get_shape_status_set($type); return ui_print_status_sets($type, $title, $return, $shape_status, $extra_info); } else { + $imagepath .= '/'.$type; if ($options === false) { $options = []; } @@ -2869,7 +2868,7 @@ function ui_print_status_sets( $options = []; } - if (isset($options['style'])) { + if (isset($options['style']) === true) { $options['style'] .= ' display: inline-block;'; } else { $options['style'] = 'display: inline-block;'; @@ -2879,15 +2878,17 @@ function ui_print_status_sets( $options['style'] .= ' background: '.modules_get_color_status($status).';'; } - if (isset($options['class'])) { + $options['style'] .= 'width: 100%;'; + + if (isset($options['class']) === true) { $options['class'] = $options['class']; } - if ($title != '') { - $options['title'] = empty($extra_info) ? $title : $title.' '.$extra_info; - $options['data-title'] = empty($extra_info) ? $title : $title.'
'.$extra_info; + if (empty($title) === false) { + $options['title'] = (empty($extra_info) === true) ? $title : $title.' '.$extra_info; + $options['data-title'] = (empty($extra_info) === true) ? $title : $title.'
'.$extra_info; $options['data-use_title_for_force_title'] = 1; - if (isset($options['class'])) { + if (isset($options['class']) === true) { $options['class'] .= ' forced_title'; } else { $options['class'] = 'forced_title'; @@ -2899,15 +2900,13 @@ function ui_print_status_sets( $output .= $k.'="'.$v.'"'; } - $output .= '>'; - $output .= ''; + $output .= '> '; if ($return === false) { echo $output; + } else { + return $output; } - - return $output; - } diff --git a/pandora_console/mobile/include/ui.class.php b/pandora_console/mobile/include/ui.class.php index 023ee35ed7..4bfeae3fee 100755 --- a/pandora_console/mobile/include/ui.class.php +++ b/pandora_console/mobile/include/ui.class.php @@ -790,12 +790,11 @@ class Ui echo ' '.$this->title."\n"; echo " \n"; echo " \n"; + echo ' '."\n"; + echo ' '."\n"; echo " \n"; - // echo " \n"; echo " \n"; - // echo " \n"; echo " \n"; - // echo " \n"; echo " \n"; echo " \n"; echo " \n"; diff --git a/pandora_console/mobile/operation/alerts.php b/pandora_console/mobile/operation/alerts.php index d898b7584b..c1857f44f5 100644 --- a/pandora_console/mobile/operation/alerts.php +++ b/pandora_console/mobile/operation/alerts.php @@ -1,15 +1,33 @@