From de5a16b29d09600b17787b426937f57095454bd6 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 12 Aug 2014 09:36:05 +0000 Subject: [PATCH] 2014-08-12 Miguel de Dios * general/header.php, godmode/setup/setup_general.php, include/functions_clippy.php, include/functions_config.php, include/help/clippy/homepage.php: wip in the clippy. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10404 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++ pandora_console/general/header.php | 24 ++++++++------ .../godmode/setup/setup_general.php | 11 +++++++ pandora_console/include/functions_clippy.php | 16 ++++++++- pandora_console/include/functions_config.php | 12 +++++-- .../include/help/clippy/homepage.php | 33 +++++++++++++++++-- 6 files changed, 86 insertions(+), 16 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 089b3ca1c8..154f9d9297 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2014-08-12 Miguel de Dios + + * general/header.php, godmode/setup/setup_general.php, + include/functions_clippy.php, include/functions_config.php, + include/help/clippy/homepage.php: wip in the clippy. + 2014-08-12 Sancho Lerena * pandoradb_data.sql: No more "welcome to Pandora FMS 5.0" diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 73e9bf45e8..be10dc4df6 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -122,16 +122,20 @@ config_check(); data[0]['clippy'] = - '' . - html_print_image( - "images/heart_col.png", - true, - array("id" => 'clippy', - "class" => 'clippy', - "alt" => __('Clippy'), - 'title' => __('Clippy'))) . - ''; + if ($config['tutorial_mode'] !== 'expert') { + $table->data[0]['clippy'] = + '' . + html_print_image( + "images/heart_col.png", + true, + array("id" => 'clippy', + "class" => 'clippy', + "alt" => __('Clippy'), + 'title' => __('Clippy'))) . + ''; + } + + $table->data[0][0] = $servers_link_open . $servers_check_img . $servers_link_close; diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index d83d176635..e980d16cf8 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -252,6 +252,17 @@ $table->data[31][1] .= __('No').'   '.html_print_radio_button ('c $table->data[32][0] = __('Server logs directory') . ui_print_help_tip (__("Directory where the server logs are stored."), true); $table->data[32][1] = html_print_input_text ('server_log_dir', $config["server_log_dir"], '', 50, 255, true); +$modes_tutorial = array( + 'full' => __('Full mode'), + 'on_demand' => __('On demand'), + 'expert' => __('Expert') + ); +$table->data['tutorial_mode'][0] = __('Tutorial mode') . + ui_print_help_tip (__("Configuration of our clippy, 'full mode' show the icon in the header and the contextual helps and it is noise, 'on demand' it is equal to full but it is not noise and 'expert' the icons in the header and the context is not."), true); +$table->data['tutorial_mode'][1] = + html_print_select($modes_tutorial, 'tutorial_mode', + $config["tutorial_mode"], '', '', 0, true); + echo '
'; echo "
"; diff --git a/pandora_console/include/functions_clippy.php b/pandora_console/include/functions_clippy.php index ad7c9f52cf..3d11f642d2 100644 --- a/pandora_console/include/functions_clippy.php +++ b/pandora_console/include/functions_clippy.php @@ -97,7 +97,21 @@ function clippy_write_javascript_helps_steps($helps) { steps: , showBullets: , showStepNumbers: , - }); + nextLabel: "", + prevLabel: "", + skipLabel: "", + doneLabel: "", + exitOnOverlayClick: false, + exitOnEsc: true, //false, + }) + .onexit(function(value) { + console.log("onexit"); + return false; + }) + .oncomplete(function(value) { + console.log("oncomplete"); + + }); '#clippy', - 'intro' => __('Could you help you?

I am Pandorin, the annoying clippy for Pandora. You could follow my advices for to make common and basic tasks in Pandora.') + 'intro' => __('Could I help you?

I am Pandorin, the annoying clippy for Pandora. You could follow my advices for to make common and basic tasks in Pandora.') ); $helps['homepage']['steps'][] = array( 'element'=> '#clippy', @@ -47,7 +49,13 @@ function clippy_start_page_homepage() { '' . '
  • ' . __('Monitoring a switch with remote SNMP') . '
  • ' . '
  • ' . __('Monitoring a Windows server with remote WMI ') . '
  • ' . - '' + '' . + '
    '. + html_print_checkbox_extended + ('clippy_is_annoying', 1, $clippy_is_annoying, false, + 'set_clippy_annoying()', '', true) . + __('Please the clippy is annoying, I don\'t want see.') . + '
    ' ); $helps['homepage']['conf'] = array(); $helps['homepage']['conf']['showBullets'] = 0; @@ -57,6 +65,18 @@ function clippy_start_page_homepage() { function show_clippy() { intro_homepage.start(); } + + function set_clippy_annoying() { + checked = $('input[name=\'clippy_is_annoying\']').is(':checked'); + intro_homepage.exit(); + + if (checked) { + document.cookie = 'clippy_is_annoying=1'; + } + else { + document.cookie = 'clippy_is_annoying=0'; + } + } "; if ($config['logged']) { $helps['homepage']['conf']['autostart'] = true; @@ -64,6 +84,15 @@ function clippy_start_page_homepage() { else { $helps['homepage']['conf']['autostart'] = false; } + + if ($config["tutorial_mode"] == 'on_demand') { + $helps['homepage']['conf']['autostart'] = false; + } + + if ($clippy_is_annoying === 1) { + $helps['homepage']['conf']['autostart'] = false; + } + //================================================================== clippy_write_javascript_helps_steps($helps);