2023-02-13 13:26:49 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2023-02-17 12:53:35 +01:00
|
|
|
* Dashboards View tips in modal
|
2023-02-13 13:26:49 +01:00
|
|
|
*
|
|
|
|
* @category Console Class
|
2023-02-17 12:53:35 +01:00
|
|
|
* @package Pandora FMS
|
2023-02-13 13:26:49 +01:00
|
|
|
* @subpackage Dashboards
|
2023-02-17 12:53:35 +01:00
|
|
|
* @version 1.0.0
|
|
|
|
* @license See below
|
2023-02-13 13:26:49 +01:00
|
|
|
*
|
2023-02-17 12:53:35 +01:00
|
|
|
* ______ ___ _______ _______ ________
|
|
|
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
|
|
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
2023-02-13 13:26:49 +01:00
|
|
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
|
|
|
*
|
|
|
|
* ============================================================================
|
2023-06-08 11:53:13 +02:00
|
|
|
* Copyright (c) 2005-2023 Pandora FMS
|
2023-02-13 13:26:49 +01:00
|
|
|
* Please see http://pandorafms.org for full contribution list
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation for version 2.
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
2023-02-17 12:53:35 +01:00
|
|
|
|
2023-02-13 16:21:37 +01:00
|
|
|
$output = '';
|
2023-02-14 10:55:01 +01:00
|
|
|
$output .= '<script>var idTips = ['.$id.'];</script>';
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '<div class="window">';
|
|
|
|
$output .= '<div class="tips_header">';
|
2023-02-14 10:34:08 +01:00
|
|
|
$output .= '<p class="title">'.__('Hello! These are the tips of the day.').'</p>';
|
|
|
|
$output .= '<p>'.html_print_checkbox(
|
|
|
|
'show_tips_startup',
|
|
|
|
true,
|
|
|
|
true,
|
|
|
|
true,
|
|
|
|
false,
|
2023-03-07 17:57:09 +01:00
|
|
|
'show_tips_startup(this)',
|
2023-02-14 10:34:08 +01:00
|
|
|
false,
|
|
|
|
'',
|
2023-02-16 18:13:34 +01:00
|
|
|
($preview === true) ? '' : 'checkbox_tips_startup'
|
2023-02-14 10:34:08 +01:00
|
|
|
).__('Show usage tips at startup').'</p>';
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '</div>';
|
2023-02-17 14:15:16 +01:00
|
|
|
$output .= '<div class="carousel '.((empty($files) === true && empty($files64) === true) ? 'invisible' : '').'">';
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '<div class="images">';
|
2023-02-13 13:26:49 +01:00
|
|
|
|
2023-02-13 16:21:37 +01:00
|
|
|
if ($files !== false) {
|
2023-02-16 18:13:34 +01:00
|
|
|
if ($preview === true) {
|
|
|
|
foreach ($files as $key => $file) {
|
2023-03-16 13:31:16 +01:00
|
|
|
$output .= html_print_image($file, true, ['class' => 'main_menu_icon']);
|
2023-02-16 18:13:34 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
foreach ($files as $key => $file) {
|
2023-03-16 13:31:16 +01:00
|
|
|
$output .= html_print_image($file['path'].$file['filename'], true, ['class' => 'main_menu_icon']);
|
2023-02-16 18:13:34 +01:00
|
|
|
}
|
2023-02-13 16:21:37 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-17 11:07:28 +01:00
|
|
|
if ($files64 !== false) {
|
|
|
|
foreach ($files64 as $key => $file) {
|
|
|
|
$output .= '<img src="'.$file.'" />';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '</div>';
|
|
|
|
$output .= '</div>';
|
|
|
|
|
|
|
|
$output .= '<div class="description">';
|
|
|
|
$output .= '<h2 id="title_tip">'.$title.'</h2>';
|
|
|
|
$output .= '<p id="text_tip">';
|
|
|
|
$output .= $text;
|
|
|
|
$output .= '</p>';
|
|
|
|
|
2023-03-15 12:41:10 +01:00
|
|
|
$link_class = 'invisible';
|
2023-02-13 16:21:37 +01:00
|
|
|
if (empty($url) === false && $url !== '') {
|
2023-03-15 12:41:10 +01:00
|
|
|
$link_class = '';
|
2023-02-13 16:21:37 +01:00
|
|
|
}
|
|
|
|
|
2023-03-15 12:41:10 +01:00
|
|
|
$output .= '<a href="'.$url.'" class="'.$link_class.'" target="_blank" id="url_tip">'.__('See more info').'</a>';
|
|
|
|
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '</div>';
|
|
|
|
|
|
|
|
$output .= '<div class="ui-dialog-buttonset">';
|
2023-03-16 17:22:53 +01:00
|
|
|
|
2023-03-07 17:57:09 +01:00
|
|
|
$output .= html_print_button(
|
|
|
|
__('Maybe later'),
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
'',
|
|
|
|
[
|
|
|
|
'onclick' => 'close_dialog()',
|
|
|
|
'class' => 'secondary mini',
|
|
|
|
],
|
|
|
|
true
|
|
|
|
);
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '<div class="counter-tips">';
|
2023-02-16 16:14:50 +01:00
|
|
|
$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']);
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '</div>';
|
2023-02-16 18:13:34 +01:00
|
|
|
if ($preview === true) {
|
2023-03-07 17:57:09 +01:00
|
|
|
$output .= html_print_button(
|
|
|
|
__('Ok'),
|
|
|
|
'next_tip',
|
|
|
|
false,
|
|
|
|
'',
|
|
|
|
[
|
|
|
|
'onclick' => 'close_dialog()',
|
|
|
|
'class' => 'mini',
|
|
|
|
],
|
|
|
|
true
|
|
|
|
);
|
2023-02-16 18:13:34 +01:00
|
|
|
} else {
|
2023-03-07 17:57:09 +01:00
|
|
|
$output .= html_print_button(
|
|
|
|
__('Ok'),
|
|
|
|
'next_tip',
|
|
|
|
false,
|
|
|
|
'',
|
|
|
|
[
|
|
|
|
'onclick' => 'next_tip()',
|
2023-03-15 12:41:10 +01:00
|
|
|
'class' => ($totalTips === '1') ? 'mini hide-button' : 'mini',
|
2023-03-07 17:57:09 +01:00
|
|
|
],
|
|
|
|
true
|
|
|
|
);
|
2023-02-16 18:13:34 +01:00
|
|
|
}
|
|
|
|
|
2023-02-13 16:21:37 +01:00
|
|
|
$output .= '</div>';
|
|
|
|
$output .= '</div>';
|
|
|
|
echo $output;
|