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

* include/help/clippy/godmode_agentes_modificar_agente.php,
	include/help/clippy/homepage.php,
	include/help/clippy/godmode_agentes_configurar_agente.php,
	include/functions_clippy.php: wip in the clippy.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10399 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-08-11 14:30:09 +00:00
parent e19b631a6b
commit 0edbe523d2
5 changed files with 266 additions and 229 deletions

View File

@ -1,3 +1,10 @@
2014-08-11 Miguel de Dios <miguel.dedios@artica.es>
* include/help/clippy/godmode_agentes_modificar_agente.php,
include/help/clippy/homepage.php,
include/help/clippy/godmode_agentes_configurar_agente.php,
include/functions_clippy.php: wip in the clippy.
2014-08-11 Vanessa Gil <vanessa.gil@artica.es> 2014-08-11 Vanessa Gil <vanessa.gil@artica.es>
* godmode/agentes/agent_template.php: Fixed bug in FF * godmode/agentes/agent_template.php: Fixed bug in FF

View File

@ -28,12 +28,96 @@ function clippy_start($sec2) {
$sec2 = str_replace('/', '_', $sec2); $sec2 = str_replace('/', '_', $sec2);
//~ html_debug_print($sec2, true); if ($sec2 != 'homepage') {
if (is_file("include/help/clippy/" . $sec2 . ".php")) {
if (is_file("include/help/clippy/" . $sec2 . ".php")) { require("include/help/clippy/" . $sec2 . ".php");
require("include/help/clippy/" . $sec2 . ".php");
clippy_start_page();
}
clippy_start_page(); //Add homepage for all pages for to show the "task sugestions"
require("include/help/clippy/homepage.php");
clippy_start_page_homepage();
}
else {
require("include/help/clippy/homepage.php");
clippy_start_page_homepage();
} }
} }
function clippy_clean_help() {
set_cookie('clippy', null);
}
function clippy_write_javascript_helps_steps($helps) {
global $config;
$clippy = get_cookie('clippy', false);
set_cookie('clippy', null);
//Get the help steps from a task
$steps = $helps[$clippy]['steps'];
if (empty($steps)) {
//Get the first by default
$temp = reset($helps);
$steps = $temp['steps'];
}
$conf = $helps[$clippy]['conf'];
if (empty($conf)) {
//Get the first by default
$temp = reset($helps);
$conf = $temp['conf'];
}
$name_obj_tour = 'intro';
if (!empty($conf['name_obj_tour'])) {
$name_obj_tour = $conf['name_obj_tour'];
}
$autostart = true;
if (!is_null($conf['autostart'])) {
$autostart = $conf['autostart'];
}
$other_js = '';
if (!empty($conf['other_js'])) {
$other_js = $conf['other_js'];
}
?>
<script type="text/javascript">
var <?php echo $name_obj_tour; ?> = null;
$(document).ready(function() {
<?php echo $name_obj_tour; ?> = introJs();
<?php echo $name_obj_tour; ?>.setOptions({
steps: <?php echo json_encode($steps); ?>,
showBullets: <?php echo json_encode($conf['showBullets']); ?>,
showStepNumbers: <?php echo json_encode($conf['showStepNumbers']); ?>,
});
<?php
if (!empty($conf['next_help'])) {
?>
clippy_set_help('<?php echo $conf['next_help']; ?>');
<?php
}
?>
<?php
if ($autostart) {
?>
<?php echo $name_obj_tour; ?>.start();
<?php
}
?>
});
<?php echo $other_js; ?>
</script>
<?php
}
?> ?>

View File

@ -20,134 +20,107 @@
*/ */
function clippy_start_page() { function clippy_start_page() {
global $config; $helps = array();
$clippy = get_cookie('clippy', false); //==================================================================
set_cookie('clippy', null); //Help tour about the monitoring with a ping (step 3)
//------------------------------------------------------------------
switch ($clippy) { $helps['monitoring_server_step_3'] = array();
case 'choose_tabs_modules': $helps['monitoring_server_step_3']['steps'] = array();
$steps = array(); $helps['monitoring_server_step_3']['steps'][] = array(
$steps[] = array( 'element'=> '#clippy',
'element'=> '#clippy', 'intro' => __('Now you must go to modules, don\'t worry I teach you.')
'intro' => __('Now you must go to modules, don\'t worry I teach you.') );
); $helps['monitoring_server_step_3']['steps'][] = array(
$steps[] = array( 'element'=> "img[alt='Modules']",
'element'=> "img[alt='Modules']", 'intro' => __('Please click in this tab.')
'intro' => __('Please click in this tab.') );
); $helps['monitoring_server_step_3']['conf'] = array();
break; $helps['monitoring_server_step_3']['conf']['showBullets'] = 0;
case 'create_module': $helps['monitoring_server_step_3']['conf']['showStepNumbers'] = 0;
$steps = array(); $helps['monitoring_server_step_3']['conf']['next_help'] = 'monitoring_server_step_4';
$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;
}
//==================================================================
//Help tour about the monitoring with a ping (step 4)
//------------------------------------------------------------------
$helps['monitoring_server_step_4'] = array();
$helps['monitoring_server_step_4']['steps'] = array();
$helps['monitoring_server_step_4']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Now you must create the module, don\'t worry I teach you.')
);
$helps['monitoring_server_step_4']['steps'][] = array(
'element'=> "#moduletype",
'intro' => __('Choose the network server module.')
);
$helps['monitoring_server_step_4']['steps'][] = array(
'element'=> "input[name='updbutton']",
'intro' => __('And click in this button.')
);
$helps['monitoring_server_step_4']['conf'] = array();
$helps['monitoring_server_step_4']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_4']['conf']['showStepNumbers'] = 0;
$helps['monitoring_server_step_4']['conf']['next_help'] = 'monitoring_server_step_5';
//==================================================================
?>
<script type="text/javascript"> //==================================================================
var steps = <?php echo json_encode($steps); ?>; //Help tour about the monitoring with a ping (step 5)
var intro = null; //------------------------------------------------------------------
$helps['monitoring_server_step_5'] = array();
$(document).ready(function() { $helps['monitoring_server_step_5']['steps'] = array();
intro = introJs(); $helps['monitoring_server_step_5']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Now you must create the module, don\'t worry I teach you.')
<?php );
switch ($clippy) { $helps['monitoring_server_step_5']['steps'][] = array(
case 'choose_tabs_modules': 'element'=> '#clippy',
?> 'intro' => __('We are going to fill the form.')
intro.setOptions({ );
steps: steps, $helps['monitoring_server_step_5']['steps'][] = array(
showBullets: false, 'element'=> "#network_component_group",
showStepNumbers: false 'intro' => __('Please choose the Network Management.')
}); );
clippy_set_help('create_module'); $helps['monitoring_server_step_5']['steps'][] = array(
intro.start(); 'element'=> "#network_component",
<?php 'intro' => __('And choose the component with the name "Host Alive".')
break; );
case 'create_module': $helps['monitoring_server_step_5']['steps'][] = array(
?> 'element'=> "input[name='name']",
intro.setOptions({ 'intro' => __('You can change the name.')
steps: steps, );
showBullets: false, $helps['monitoring_server_step_5']['steps'][] = array(
showStepNumbers: false 'element'=> "input[name='ip_target']",
}); 'intro' => __('Check if this IP is the address of your machine.')
clippy_set_help('create_module_second_step'); );
intro.start(); $helps['monitoring_server_step_5']['steps'][] = array(
<?php 'element'=> "input[name='crtbutton']",
break; 'intro' => __('And only to finish it is clicking this button.')
case 'create_module_second_step': );
?> $helps['monitoring_server_step_5']['conf'] = array();
intro.setOptions({ $helps['monitoring_server_step_5']['conf']['showBullets'] = 0;
steps: steps, $helps['monitoring_server_step_5']['conf']['showStepNumbers'] = 0;
showBullets: false, $helps['monitoring_server_step_5']['conf']['next_help'] = 'monitoring_server_step_6';
showStepNumbers: false //==================================================================
});
clippy_set_help('create_module_third_step');
intro.start(); //==================================================================
<?php //Help tour about the monitoring with a ping (step 6)
break; //------------------------------------------------------------------
case 'create_module_third_step': $helps['monitoring_server_step_6'] = array();
?> $helps['monitoring_server_step_6']['steps'] = array();
intro.setOptions({ $helps['monitoring_server_step_6']['steps'][] = array(
steps: steps, 'element'=> '#clippy',
showBullets: false, '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.')
showStepNumbers: false );
}); $helps['monitoring_server_step_6']['conf'] = array();
intro.start(); $helps['monitoring_server_step_6']['conf']['showBullets'] = 0;
<?php $helps['monitoring_server_step_6']['conf']['showStepNumbers'] = 0;
break; //==================================================================
}
?>
}); clippy_write_javascript_helps_steps($helps);
</script>
<?php
} }
?> ?>

View File

@ -20,81 +20,52 @@
*/ */
function clippy_start_page() { function clippy_start_page() {
global $config;
$clippy = get_cookie('clippy', false); $helps = array();
set_cookie('clippy', null);
switch ($clippy) { //==================================================================
case 'monitoring_server': //Help tour about the monitoring with a ping (step 1)
$steps = array(); //------------------------------------------------------------------
$steps[] = array( $helps['monitoring_server_step_1'] = array();
'element'=> '#clippy', $helps['monitoring_server_step_1']['steps'] = array();
'intro' => __('I show how to monitoring a server.') $helps['monitoring_server_step_1']['steps'][] = array(
); 'element'=> '#clippy',
$steps[] = array( 'intro' => __('I show how to monitoring a server.')
'element'=> 'input[name="search"]', );
'intro' => __('Please type a agent to save the modules for monitoring a server.') $helps['monitoring_server_step_1']['steps'][] = array(
); 'element'=> 'input[name="search"]',
$steps[] = array( 'intro' => __('Please type a agent to save the modules for monitoring a server.')
'element'=> 'input[name="srcbutton"]', );
'intro' => __('Maybe if you typped correctly the name, you can see the agent.') $helps['monitoring_server_step_1']['steps'][] = array(
); 'element'=> 'input[name="srcbutton"]',
break; 'intro' => __('Maybe if you typped correctly the name, you can see the agent.')
case 'choose_agent': );
$steps = array(); $helps['monitoring_server_step_1']['conf'] = array();
$steps[] = array( $helps['monitoring_server_step_1']['conf']['showBullets'] = 0;
'element'=> '#clippy', $helps['monitoring_server_step_1']['conf']['showStepNumbers'] = 1;
'intro' => __('Please choose the agent that you have searched.') $helps['monitoring_server_step_1']['conf']['next_help'] = 'monitoring_server_step_2';
); //==================================================================
$steps[] = array(
'element'=> '#agent_list',
'intro' => __('Choose the agent, please click in the name.')
);
break;
}
//==================================================================
//Help tour about the monitoring with a ping (step 2)
//------------------------------------------------------------------
$helps['monitoring_server_step_2'] = array();
$helps['monitoring_server_step_2']['steps'] = array();
$helps['monitoring_server_step_2']['steps'][] = array(
'element'=> '#clippy',
'intro' => __('Please choose the agent that you have searched.')
);
$helps['monitoring_server_step_2']['steps'][] = array(
'element'=> '#agent_list',
'intro' => __('Choose the agent, please click in the name.')
);
$helps['monitoring_server_step_2']['conf'] = array();
$helps['monitoring_server_step_2']['conf']['showBullets'] = 0;
$helps['monitoring_server_step_2']['conf']['showStepNumbers'] = 0;
$helps['monitoring_server_step_2']['conf']['next_help'] = 'monitoring_server_step_3';
//==================================================================
?> clippy_write_javascript_helps_steps($helps);
<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

@ -19,20 +19,28 @@
* @subpackage Clippy * @subpackage Clippy
*/ */
function clippy_start_page() { function clippy_start_page_homepage() {
global $config; global $config;
$steps = array(); clippy_clean_help();
$steps[] = array(
$helps = array();
//==================================================================
//Help tour with the some task for to help the user.
//------------------------------------------------------------------
$helps['homepage'] = array();
$helps['homepage']['steps'] = array();
$helps['homepage']['steps'][] = array(
'element'=> '#clippy', '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.') '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( $helps['homepage']['steps'][] = array(
'element'=> '#clippy', 'element'=> '#clippy',
'intro' => __('What task do you want to do?') . '<br/><br/>' . 'intro' => __('What task do you want to do?') . '<br/><br/>' .
'<ul style="text-align: left; margin-left: 3px; list-style-type: disc;">' . '<ul style="text-align: left; margin-left: 3px; list-style-type: disc;">' .
'<li>' . '<li>' .
"<a href='javascript: clippy_go_link_show_help(\"index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\", \"monitoring_server\");'>" . "<a href='javascript: clippy_go_link_show_help(\"index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\", \"monitoring_server_step_1\");'>" .
//'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&clippy=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') . __('Monitoring a server Linux/Windows with a pandora agent') .
'</a>' . '</a>' .
@ -41,29 +49,23 @@ function clippy_start_page() {
'<li>' . __('Monitoring a Windows server with remote WMI ') . '</li>' . '<li>' . __('Monitoring a Windows server with remote WMI ') . '</li>' .
'</ul>' '</ul>'
); );
$helps['homepage']['conf'] = array();
$helps['homepage']['conf']['showBullets'] = 0;
$helps['homepage']['conf']['showStepNumbers'] = 0;
$helps['homepage']['conf']['name_obj_tour'] = 'intro_homepage';
$helps['homepage']['conf']['other_js'] = "
function show_clippy() {
intro_homepage.start();
}
";
if ($config['logged']) {
$helps['homepage']['conf']['autostart'] = true;
}
else {
$helps['homepage']['conf']['autostart'] = false;
}
//==================================================================
?> clippy_write_javascript_helps_steps($helps);
<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
} }
?> ?>