From 2b247e0ed1c46bdc007d206d73d47e19ae0da6ea Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 22 Sep 2014 13:37:23 +0200 Subject: [PATCH] Added the context help icon for the learning mode in form of agent. TICKET #1311 --- .../godmode/agentes/agent_manager.php | 31 +++++++++- .../help/clippy/modules_not_learning_mode.php | 56 +++++++++++++++++++ 2 files changed, 85 insertions(+), 2 deletions(-) create mode 100755 pandora_console/include/help/clippy/modules_not_learning_mode.php diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 3bc1912588..a560a73bff 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -94,6 +94,7 @@ if (is_ajax ()) { // Load global vars enterprise_include ('godmode/agentes/agent_manager.php'); +require_once ('include/functions_clippy.php'); require_once ('include/functions_servers.php'); require_once ('include/functions_gis.php'); require_once($config['homedir'] . "/include/functions_agents.php"); @@ -288,9 +289,11 @@ $table->data[0][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255 $table->data[1][0] = __('Module definition') . ui_print_help_icon("module_definition", true); $table->data[1][1] = __('Learning mode') . ' ' . - html_print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"', true); + html_print_radio_button_extended ("modo", 1, '', $modo, false, 'show_modules_not_learning_mode_context_help();', + 'style="margin-right: 40px;"', true); $table->data[1][1] .= __('Normal mode') . ' ' . - html_print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"', true); + html_print_radio_button_extended ("modo", 0, '', $modo, false, 'show_modules_not_learning_mode_context_help();', + 'style="margin-right: 40px;"', true); // Status (Disabled / Enabled) $table->data[2][0] = __('Status'); @@ -414,7 +417,22 @@ if (!empty($fields)) { } echo '
'; + + +//The context help about the learning mode +if ($modo == 0) { + echo ""; +} +else { + echo ""; + + + if ($id_agente) { + html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"'); html_print_input_hidden ('update_agent', 1); html_print_input_hidden ('id_agente', $id_agente); @@ -465,6 +483,15 @@ function changeIcons() { //$("#icon_default").attr("src", "" + icon + } +function show_modules_not_learning_mode_context_help() { + if ($("input[name='modo'][value=1]").is(':checked')) { + $("#modules_not_learning_mode_context_help").hide(); + } + else { + $("#modules_not_learning_mode_context_help").show(); + } +} + $(document).ready (function () { $("select#id_os").pandoraSelectOS (); diff --git a/pandora_console/include/help/clippy/modules_not_learning_mode.php b/pandora_console/include/help/clippy/modules_not_learning_mode.php new file mode 100755 index 0000000000..03cc6847d0 --- /dev/null +++ b/pandora_console/include/help/clippy/modules_not_learning_mode.php @@ -0,0 +1,56 @@ + true, + 'position' => 'left', + 'intro' => '' . + '' . + '' . + '' . + '
' . + __('Please note that you have your agent setup to do not add new modules coming from the data XML.') . '
' . + __('That means if you have a local plugin or add manually new modules to the configuration file, you won\'t have it in your agent, unless you first create manually in the interface (with the exact name and type as coming in the XML file).') . '
' . + __('You should use the "normal" mode (non learn) only when you don\'t intend to add more modules to the agent.') . + ui_print_help_icon ('module_definition', true, '', 'images/help.png') . + '
' + ); + $return_tours['tours']['modules_not_learning_mode']['conf'] = array(); + $return_tours['tours']['modules_not_learning_mode']['conf']['autostart'] = false; + $return_tours['tours']['modules_not_learning_mode']['conf']['show_bullets'] = 0; + $return_tours['tours']['modules_not_learning_mode']['conf']['show_step_numbers'] = 0; + //================================================================== + + return $return_tours; +} +?> \ No newline at end of file