2014-08-08 Miguel de Dios <miguel.dedios@artica.es>

* include/functions.php,
	include/help/clippy/godmode_agentes_modificar_agente.php,
	include/help/clippy/homepage.php,
	include/help/clippy/godmode_agentes_configurar_agente.php,
	include/javascript/intro.js,
	include/javascript/introjs.css,
	include/javascript/clippy.js,
	include/functions_ui.php,
	include/functions_clippy.php,
	index.php,
	general/header.php: first version of the new feature a annoying
	clippy such as the lovely micro$oft mascot.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10393 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-08-08 15:11:00 +00:00
parent 5565e19348
commit f956eb057c
12 changed files with 1769 additions and 6 deletions

View File

@ -1,3 +1,18 @@
2014-08-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php,
include/help/clippy/godmode_agentes_modificar_agente.php,
include/help/clippy/homepage.php,
include/help/clippy/godmode_agentes_configurar_agente.php,
include/javascript/intro.js,
include/javascript/introjs.css,
include/javascript/clippy.js,
include/functions_ui.php,
include/functions_clippy.php,
index.php,
general/header.php: first version of the new feature a annoying
clippy such as the lovely micro$oft mascot.
2014-08-07 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.sql,

View File

@ -122,7 +122,18 @@ config_check();
</script>
<?php
$table->data[0][0] = $servers_link_open . $servers_check_img . $servers_link_close;
$table->data[0]['clippy'] =
'<a href="javascript: show_clippy();">' .
html_print_image(
"images/heart_col.png",
true,
array("id" => 'clippy',
"class" => 'clippy',
"alt" => __('Clippy'),
'title' => __('Clippy'))) .
'</a>';
$table->data[0][0] = $servers_link_open .
$servers_check_img . $servers_link_close;

View File

@ -768,6 +768,23 @@ function get_parameter_checkbox ($name, $default = '') {
return get_parameter($name, 0);
}
function get_cookie($name, $default = '') {
if (isset($_COOKIE[$name])) {
return $_COOKIE[$name];
}
else {
return $default;
}
}
function set_cookie($name, $value) {
if (is_null($value)) {
unset($_COOKIE[$value]);
setcookie($value, null, -1, '/');
}
setcookie($name, $value);
}
/**
* Get a parameter from a request.
*

View File

@ -0,0 +1,39 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// 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 Lesser General Public License
// as published by the Free Software Foundation; 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.
/**
* @package Include
* @subpackage Clippy
*/
function clippy_start($sec2) {
global $config;
if ($sec2 === false) {
$sec2 = 'homepage';
}
$sec2 = str_replace('/', '_', $sec2);
//~ html_debug_print($sec2, true);
if (is_file("include/help/clippy/" . $sec2 . ".php")) {
require("include/help/clippy/" . $sec2 . ".php");
clippy_start_page();
}
}
?>

View File

@ -1245,7 +1245,13 @@ function ui_process_page_head ($string, $bitfield) {
}
$output .= "\n\t";
////////////////////////////////////////////////////////////////////
//Load CSS
////////////////////////////////////////////////////////////////////
if (empty ($config['css'])) {
$config['css'] = array ();
}
@ -1270,7 +1276,8 @@ function ui_process_page_head ($string, $bitfield) {
}
}
//First, if user has assigned a skin then try to use css files of skin subdirectory
//First, if user has assigned a skin then try to use css files of
//skin subdirectory
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
if (!$login_ok) {
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
@ -1278,6 +1285,7 @@ function ui_process_page_head ($string, $bitfield) {
}
}
$exists_css = false;
if ($login_ok and $isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
//Checks if user's skin is available
@ -1305,11 +1313,16 @@ function ui_process_page_head ($string, $bitfield) {
$config['css']);
}
// Add the jquery UI styles CSS
$config['css']['jquery-UI'] = "include/styles/jquery-ui-1.10.0.custom.css";
// Add the dialog styles CSS
$config['css']['dialog'] = "include/styles/dialog.css";
// Add the dialog styles CSS
$config['css']['dialog'] = "include/javascript/introjs.css";
//We can't load empty and we loaded (conditionally) ie
$loaded = array ('', 'ie');
@ -1333,24 +1346,33 @@ function ui_process_page_head ($string, $bitfield) {
$output .= '<link rel="stylesheet" href="' . $url_css . '" type="text/css" />'."\n\t";
}
}
////////////////////////////////////////////////////////////////////
//End load CSS
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//Load JS
////////////////////////////////////////////////////////////////////
if (empty ($config['js'])) {
$config['js'] = array (); //If it's empty, false or not init set array to empty just in case
}
//Pandora specific JavaScript should go first
$config['js'] = array_merge (array ("pandora" => "include/javascript/pandora.js"), $config['js']);
//Load base64 javascript library
$config['js']['base64'] = "include/javascript/encode_decode_base64.js";
//Load webchat javascript library
$config['js']['webchat'] = "include/javascript/webchat.js";
//Load qrcode library
$config['js']['qrcode'] = "include/javascript/qrcode.js";
//Load intro.js library (for bubbles and clippy)
$config['js']['intro'] = "include/javascript/intro.js";
$config['js']['clippy'] = "include/javascript/clippy.js";
//Load other javascript
//We can't load empty
@ -1370,9 +1392,15 @@ function ui_process_page_head ($string, $bitfield) {
$output .= '<script type="text/javascript" src="' . $url_js . '"></script>'."\n\t";
}
}
////////////////////////////////////////////////////////////////////
//End load JS
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//Load jQuery
////////////////////////////////////////////////////////////////////
if (empty ($config['jquery'])) {
$config['jquery'] = array (); //If it's empty, false or not init set array to empty just in case
}
@ -1422,6 +1450,11 @@ function ui_process_page_head ($string, $bitfield) {
$output .= '<script type="text/javascript" src="' . $url_js . '"></script>'."\n\t";
}
}
////////////////////////////////////////////////////////////////////
//End load JQuery
////////////////////////////////////////////////////////////////////
if ($config['flash_charts']) {

View File

@ -0,0 +1,153 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// 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 Lesser General Public License
// as published by the Free Software Foundation; 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.
/**
* @package Include
* @subpackage Clippy
*/
function clippy_start_page() {
global $config;
$clippy = get_cookie('clippy', false);
set_cookie('clippy', null);
switch ($clippy) {
case 'choose_tabs_modules':
$steps = array();
$steps[] = array(
'element'=> '#clippy',
'intro' => __('Now you must go to modules, don\'t worry I teach you.')
);
$steps[] = array(
'element'=> "img[alt='Modules']",
'intro' => __('Please click in this tab.')
);
break;
case 'create_module':
$steps = array();
$steps[] = array(
'element'=> '#clippy',
'intro' => __('Now you must create the module, don\'t worry I teach you.')
);
$steps[] = array(
'element'=> "#moduletype",
'intro' => __('Choose the network server module.')
);
$steps[] = array(
'element'=> "input[name='updbutton']",
'intro' => __('And click in this button.')
);
break;
case 'create_module_second_step':
$steps = array();
$steps[] = array(
'element'=> '#clippy',
'intro' => __('We are going to fill the form.')
);
$steps[] = array(
'element'=> "#network_component_group",
'intro' => __('Please choose the Network Management.')
);
$steps[] = array(
'element'=> "#network_component",
'intro' => __('And choose the component with the name "Host Alive".')
);
$steps[] = array(
'element'=> "input[name='name']",
'intro' => __('You can change the name.')
);
$steps[] = array(
'element'=> "input[name='ip_target']",
'intro' => __('Check if this IP is the address of your machine.')
);
$steps[] = array(
'element'=> "input[name='crtbutton']",
'intro' => __('And only to finish it is clicking this button.')
);
break;
case 'create_module_third_step':
$steps = array();
$steps[] = array(
'element'=> '#clippy',
'intro' => __('Now, your module is just created.<br/> And the status color is <b>blue</b>.<br/>This meaning of blue status is the module is not executed for first time.<br/>In the next seconds if there is not a problem, the status color will change to red or green.')
);
break;
}
?>
<script type="text/javascript">
var steps = <?php echo json_encode($steps); ?>;
var intro = null;
$(document).ready(function() {
intro = introJs();
<?php
switch ($clippy) {
case 'choose_tabs_modules':
?>
intro.setOptions({
steps: steps,
showBullets: false,
showStepNumbers: false
});
clippy_set_help('create_module');
intro.start();
<?php
break;
case 'create_module':
?>
intro.setOptions({
steps: steps,
showBullets: false,
showStepNumbers: false
});
clippy_set_help('create_module_second_step');
intro.start();
<?php
break;
case 'create_module_second_step':
?>
intro.setOptions({
steps: steps,
showBullets: false,
showStepNumbers: false
});
clippy_set_help('create_module_third_step');
intro.start();
<?php
break;
case 'create_module_third_step':
?>
intro.setOptions({
steps: steps,
showBullets: false,
showStepNumbers: false
});
intro.start();
<?php
break;
}
?>
});
</script>
<?php
}
?>

View File

@ -0,0 +1,100 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// 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 Lesser General Public License
// as published by the Free Software Foundation; 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.
/**
* @package Include
* @subpackage Clippy
*/
function clippy_start_page() {
global $config;
$clippy = get_cookie('clippy', false);
set_cookie('clippy', null);
switch ($clippy) {
case 'monitoring_server':
$steps = array();
$steps[] = array(
'element'=> '#clippy',
'intro' => __('I show how to monitoring a server.')
);
$steps[] = array(
'element'=> 'input[name="search"]',
'intro' => __('Please type a agent to save the modules for monitoring a server.')
);
$steps[] = array(
'element'=> 'input[name="srcbutton"]',
'intro' => __('Maybe if you typped correctly the name, you can see the agent.')
);
break;
case 'choose_agent':
$steps = array();
$steps[] = array(
'element'=> '#clippy',
'intro' => __('Please choose the agent that you have searched.')
);
$steps[] = array(
'element'=> '#agent_list',
'intro' => __('Choose the agent, please click in the name.')
);
break;
}
?>
<script type="text/javascript">
var steps = <?php echo json_encode($steps); ?>;
var intro = null;
$(document).ready(function() {
intro = introJs();
<?php
switch ($clippy) {
case 'monitoring_server':
?>
intro.setOptions({
steps: steps,
showBullets: false,
showStepNumbers: true
});
clippy_set_help('choose_agent');
intro.start();
<?php
break;
case 'choose_agent':
?>
intro.setOptions({
steps: steps,
showBullets: false,
showStepNumbers: false
});
clippy_set_help('choose_tabs_modules');
intro.start();
<?php
break;
}
?>
});
</script>
<?php
}
?>

View File

@ -0,0 +1,69 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// 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 Lesser General Public License
// as published by the Free Software Foundation; 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.
/**
* @package Include
* @subpackage Clippy
*/
function clippy_start_page() {
global $config;
$steps = array();
$steps[] = array(
'element'=> '#clippy',
'intro' => __('Could you help you?<br/><br/>I am Pandorin, the annoying clippy for Pandora. You could follow my advices for to make common and basic tasks in Pandora.')
);
$steps[] = array(
'element'=> '#clippy',
'intro' => __('What task do you want to do?') . '<br/><br/>' .
'<ul style="text-align: left; margin-left: 3px; list-style-type: disc;">' .
'<li>' .
"<a href='javascript: clippy_go_link_show_help(\"index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\", \"monitoring_server\");'>" .
//'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&clippy=monitoring_server">' .
__('Monitoring a server Linux/Windows with a pandora agent') .
'</a>' .
'</li>' .
'<li>' . __('Monitoring a switch with remote SNMP') . '</li>' .
'<li>' . __('Monitoring a Windows server with remote WMI ') . '</li>' .
'</ul>'
);
?>
<script type="text/javascript">
var steps = <?php echo json_encode($steps); ?>;
var intro = null;
$(document).ready(function() {
intro = introJs();
intro.setOptions({
steps: steps,
showBullets: false,
showStepNumbers: false
});
<?php
if ($config['logged']) {
?>
intro.start();
<?php
}
?>
});
</script>
<?php
}
?>

View File

@ -0,0 +1,8 @@
function clippy_set_help(help_section) {
document.cookie = 'clippy=' + help_section;
}
function clippy_go_link_show_help(link, help_section) {
document.cookie = 'clippy=' + help_section;
window.location.href = link;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,276 @@
.introjs-overlay {
position: absolute;
z-index: 999999;
background-color: #000;
opacity: 0;
background: -moz-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
background: -webkit-gradient(radial,center center,0px,center center,100%,color-stop(0%,rgba(0,0,0,0.4)),color-stop(100%,rgba(0,0,0,0.9)));
background: -webkit-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
background: -o-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
background: -ms-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
background: radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66000000',endColorstr='#e6000000',GradientType=1);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
filter: alpha(opacity=50);
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.introjs-fixParent {
z-index: auto !important;
opacity: 1.0 !important;
}
.introjs-showElement,
tr.introjs-showElement > td,
tr.introjs-showElement > th {
z-index: 9999999 !important;
}
.introjs-relativePosition,
tr.introjs-showElement > td,
tr.introjs-showElement > th {
position: relative;
}
.introjs-helperLayer {
position: absolute;
z-index: 9999998;
background-color: #FFF;
background-color: rgba(255,255,255,.9);
border: 1px solid #777;
border: 1px solid rgba(0,0,0,.5);
border-radius: 4px;
box-shadow: 0 2px 15px rgba(0,0,0,.4);
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.introjs-helperNumberLayer {
position: absolute;
top: -16px;
left: -16px;
z-index: 9999999999 !important;
padding: 2px;
font-family: Arial, verdana, tahoma;
font-size: 13px;
font-weight: bold;
color: white;
text-align: center;
text-shadow: 1px 1px 1px rgba(0,0,0,.3);
background: #ff3019; /* Old browsers */
background: -webkit-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* Chrome10+,Safari5.1+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ff3019), color-stop(100%, #cf0404)); /* Chrome,Safari4+ */
background: -moz-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* FF3.6+ */
background: -ms-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* IE10+ */
background: -o-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* Opera 11.10+ */
background: linear-gradient(to bottom, #ff3019 0%, #cf0404 100%); /* W3C */
width: 20px;
height:20px;
line-height: 20px;
border: 3px solid white;
border-radius: 50%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3019', endColorstr='#cf0404', GradientType=0); /* IE6-9 */
filter: progid:DXImageTransform.Microsoft.Shadow(direction=135, strength=2, color=ff0000); /* IE10 text shadows */
box-shadow: 0 2px 5px rgba(0,0,0,.4);
}
.introjs-arrow {
border: 5px solid white;
content:'';
position: absolute;
}
.introjs-arrow.top {
top: -10px;
border-top-color:transparent;
border-right-color:transparent;
border-bottom-color:white;
border-left-color:transparent;
}
.introjs-arrow.top-right {
top: -10px;
right: 10px;
border-top-color:transparent;
border-right-color:transparent;
border-bottom-color:white;
border-left-color:transparent;
}
.introjs-arrow.top-middle {
top: -10px;
left: 50%;
margin-left: -5px;
border-top-color:transparent;
border-right-color:transparent;
border-bottom-color:white;
border-left-color:transparent;
}
.introjs-arrow.right {
right: -10px;
top: 10px;
border-top-color:transparent;
border-right-color:transparent;
border-bottom-color:transparent;
border-left-color:white;
}
.introjs-arrow.bottom {
bottom: -10px;
border-top-color:white;
border-right-color:transparent;
border-bottom-color:transparent;
border-left-color:transparent;
}
.introjs-arrow.left {
left: -10px;
top: 10px;
border-top-color:transparent;
border-right-color:white;
border-bottom-color:transparent;
border-left-color:transparent;
}
.introjs-tooltip {
position: absolute;
padding: 10px;
background-color: white;
min-width: 200px;
max-width: 300px;
border-radius: 3px;
box-shadow: 0 1px 10px rgba(0,0,0,.4);
-webkit-transition: opacity 0.1s ease-out;
-moz-transition: opacity 0.1s ease-out;
-ms-transition: opacity 0.1s ease-out;
-o-transition: opacity 0.1s ease-out;
transition: opacity 0.1s ease-out;
}
.introjs-tooltipbuttons {
text-align: right;
}
/*
Buttons style by http://nicolasgallagher.com/lab/css3-github-buttons/
Changed by Afshin Mehrabani
*/
.introjs-button {
position: relative;
overflow: visible;
display: inline-block;
padding: 0.3em 0.8em;
border: 1px solid #d4d4d4;
margin: 0;
text-decoration: none;
text-shadow: 1px 1px 0 #fff;
font: 11px/normal sans-serif;
color: #333;
white-space: nowrap;
cursor: pointer;
outline: none;
background-color: #ececec;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f4f4f4), to(#ececec));
background-image: -moz-linear-gradient(#f4f4f4, #ececec);
background-image: -o-linear-gradient(#f4f4f4, #ececec);
background-image: linear-gradient(#f4f4f4, #ececec);
-webkit-background-clip: padding;
-moz-background-clip: padding;
-o-background-clip: padding-box;
/*background-clip: padding-box;*/ /* commented out due to Opera 11.10 bug */
-webkit-border-radius: 0.2em;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
/* IE hacks */
zoom: 1;
*display: inline;
margin-top: 10px;
}
.introjs-button:hover {
border-color: #bcbcbc;
text-decoration: none;
box-shadow: 0px 1px 1px #e3e3e3;
}
.introjs-button:focus,
.introjs-button:active {
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ececec), to(#f4f4f4));
background-image: -moz-linear-gradient(#ececec, #f4f4f4);
background-image: -o-linear-gradient(#ececec, #f4f4f4);
background-image: linear-gradient(#ececec, #f4f4f4);
}
/* overrides extra padding on button elements in Firefox */
.introjs-button::-moz-focus-inner {
padding: 0;
border: 0;
}
.introjs-skipbutton {
margin-right: 5px;
color: #7a7a7a;
}
.introjs-prevbutton {
-webkit-border-radius: 0.2em 0 0 0.2em;
-moz-border-radius: 0.2em 0 0 0.2em;
border-radius: 0.2em 0 0 0.2em;
border-right: none;
}
.introjs-nextbutton {
-webkit-border-radius: 0 0.2em 0.2em 0;
-moz-border-radius: 0 0.2em 0.2em 0;
border-radius: 0 0.2em 0.2em 0;
}
.introjs-disabled, .introjs-disabled:hover, .introjs-disabled:focus {
color: #9a9a9a;
border-color: #d4d4d4;
box-shadow: none;
cursor: default;
background-color: #f4f4f4;
background-image: none;
text-decoration: none;
}
.introjs-bullets {
text-align: center;
}
.introjs-bullets ul {
clear: both;
margin: 15px auto 0;
padding: 0;
display: inline-block;
}
.introjs-bullets ul li {
list-style: none;
float: left;
margin: 0 2px;
}
.introjs-bullets ul li a {
display: block;
width: 6px;
height: 6px;
background: #ccc;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
text-decoration: none;
}
.introjs-bullets ul li a:hover {
background: #999;
}
.introjs-bullets ul li a.active {
background: #999;
}
.introjsFloatingElement {
position: absolute;
height: 0;
width: 0;
left: 50%;
top: 50%;
}

View File

@ -355,6 +355,7 @@ if (isset ($_GET["bye"])) {
* Load here, because if not, some extensions not load well, I don't why.
*/
$config['logged'] = false;
extensions_load_extensions ($config['extensions']);
if ($process_login) {
/* Call all extensions login function */
@ -376,6 +377,8 @@ if ($process_login) {
//Set the initial global counter for chat.
users_get_last_global_counter('session');
$config['logged'] = true;
}
//Get old parameters before navigation.
@ -585,6 +588,11 @@ if ($config["pure"] == 0) {
require ("general/footer.php");
echo '</div>';
}
/// Clippy function
require ('include/functions_clippy.php');
clippy_start($sec2);
while (@ob_end_flush ());
db_print_database_debug ();