diff --git a/pandora_console/include/class/TipsWindow.class.php b/pandora_console/include/class/TipsWindow.class.php index ac1e4252de..4e8da71712 100644 --- a/pandora_console/include/class/TipsWindow.class.php +++ b/pandora_console/include/class/TipsWindow.class.php @@ -131,33 +131,36 @@ class TipsWindow ui_require_javascript_file('tipsWindow'); ui_require_javascript_file('jquery.bxslider.min'); echo '
'; - ?> + $this->totalTips = $this->getTotalTips(); + if ($this->totalTips > 0) { + ?> - - + + - { - $(".carousel .images").append(``); + $(".carousel .images").append( + `` + ); }); $(".carousel").removeClass("invisible"); } else { $(".carousel").addClass("invisible"); } + var limitRound = totalTips > 28 ? 28 : totalTips; + $(".count-round-tip").each(function(index) { + if ($(this).hasClass("active")) { + $(this).removeClass("active"); + if (index >= limitRound - 1) { + $($(".count-round-tip")[0]).addClass("active"); + } else { + $($(".count-round-tip")[index + 1]).addClass("active"); + } + return false; + } + }); +} + +function close_dialog() { + $("#tips_window_modal").dialog("close"); + $("#tips_window_modal").remove(); +} + +function render_counter() { + $(".counter-tips img:eq(0)").after( + "" + ); + if (totalTips > 1) { + for (let i = 1; i <= totalTips - 1; i++) { + $(".count-round-tip:eq(0)").after( + "" + ); + } + } } function next_tip() { @@ -134,7 +172,7 @@ function load_tips_modal(settings) { settings.onload(data); } settings.target.dialog({ - resizable: true, + resizable: false, draggable: true, modal: true, header: false, @@ -175,6 +213,7 @@ function load_tips_modal(settings) { $(".tips_header").remove(); $(".dialog_tips .ui-dialog-titlebar").addClass("tips_header"); $(".dialog_tips .ui-dialog-titlebar").removeClass("ui-helper-clearfix"); + render_counter(); }, error: function(data) { console.error(data); diff --git a/pandora_console/include/styles/tips_window.css b/pandora_console/include/styles/tips_window.css index f416e18e09..37e1003a0b 100644 --- a/pandora_console/include/styles/tips_window.css +++ b/pandora_console/include/styles/tips_window.css @@ -138,3 +138,22 @@ #url_tip .arrow_tips { font-size: 20px; } +span.count-round-tip { + width: 6px !important; + height: 6px !important; + background: #dbdfe6; + border-radius: 10px; + margin: 0px 2px; +} +span.count-round-tip.active { + background-color: #1d7874; +} +.counter-tips { + display: flex; + align-items: center; + margin-top: 10px; +} +.arrow-counter { + width: 7px; + margin: 0px 5px; +} diff --git a/pandora_console/views/dashboard/tipsWindow.php b/pandora_console/views/dashboard/tipsWindow.php index ec5cc694fc..1a8fa963c4 100644 --- a/pandora_console/views/dashboard/tipsWindow.php +++ b/pandora_console/views/dashboard/tipsWindow.php @@ -3,14 +3,14 @@ * Dashboards Modal for tips * * @category Console Class - * @package Pandora FMS + $output .= '* @packagePandora FMS'; * @subpackage Dashboards - * @version 1.0.0 - * @license See below + $output .= '* @version1.0.0'; + $output .= '* @licenseSee below'; * - * ______ ___ _______ _______ ________ - * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| - * | __/| _ | | _ || _ | _| _ | | ___| |__ | + $output .= '*______ __________ _______ ________'; + $output .= '* | __ \.-----.--.--.--| |.-----.----.-----. |___| | | __|'; + $output .= '* |__/| _ | | _ || _ | _| _ | |___| |__ |'; * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * * ============================================================================ @@ -25,34 +25,45 @@ * GNU General Public License for more details. * ============================================================================ */ -?> -
-
-

-

Ver típs al iniciar

-
- +$output = ''; -
-

-

- -

- - - -
+$output .= '
'; +$output .= '
'; +$output .= '

'.__('¡Hola! estos son los tips del día.').'

'; +$output .= '

'.html_print_checkbox('tips_in_start', true, true, true).__('Ver típs al iniciar').'

'; +$output .= '
'; +$output .= '
'; +$output .= '
'; -
- - -
-
\ No newline at end of file +if ($files !== false) { + foreach ($files as $key => $file) { + $output .= html_print_image($file['path'].$file['filename'], true); + } +} + +$output .= '
'; +$output .= '
'; + +$output .= '
'; +$output .= '

'.$title.'

'; +$output .= '

'; +$output .= $text; +$output .= '

'; + +if (empty($url) === false && $url !== '') { + $output .= ''.__('Ver más info').''; +} + +$output .= '
'; + +$output .= '
'; +// TODO Delete this buttons and use html_print_button when merge new design +$output .= ''; +$output .= '
'; +$output .= html_print_image('images/arrow-left-grey.png', true, ['class' => 'arrow-counter']); +$output .= html_print_image('images/arrow-right-grey.png', true, ['class' => 'arrow-counter']); +$output .= '
'; +$output .= ''; +$output .= '
'; +$output .= '
'; +echo $output;