From 409083efb7cfa01fc2bf4c10128bbcb678e199ff Mon Sep 17 00:00:00 2001 From: esanchezm Date: Tue, 24 Mar 2009 15:38:54 +0000 Subject: [PATCH] 2009-03-24 Esteban Sanchez * general/pandora_help.php: Added support for enterprise help files. * include/javascript/pandora.js: Renamed pandora_help() to open_help(). * include/functions_ui.php: Renamed event function on print_help_icon(). Removed deprecated pandora_help(). * godmode/agentes/module_manager.php: Added enterprise hooks. * godmode/agentes/module_manager_editor.php: Added categories construction here. Added enterprise hooks. * godmode/agentes/module_manager_editor_common.php: Replaced deprecated pandora_help() with print_help_icon(). Moved categories construction to module_manager_editor. * include/config_process.php: Updated build version. * include/styles/pandora.css: Fixed textarea height. * godmode/agentes/manage_config_remote.php, godmode/agentes/massive_config.php, godmode/agentes/massive_edit_modules.php, godmode/agentes/module_manager_editor_network.php, godmode/agentes/module_manager_editor_plugin.php, godmode/agentes/module_manager_editor_prediction.php, godmode/agentes/module_manager_editor_wmi.php, godmode/agentes/planned_downtime.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_compound.php, godmode/modules/manage_network_components_form_network.php, godmode/modules/manage_network_components_form_wmi.php, godmode/reporting/map_builder.php, godmode/servers/manage_export_form.php, godmode/servers/manage_recontask_form.php, godmode/servers/plugin.php, godmode/setup/setup.php, operation/agentes/alerts_status.php, operation/agentes/tactical.php, godmode/agentes/agent_manager.php: Replaced deprecated pandora_help() with print_help_icon(). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1557 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 42 +++++++++++++++++++ pandora_console/general/pandora_help.php | 15 +++++-- .../godmode/agentes/agent_manager.php | 2 +- .../godmode/agentes/manage_config_remote.php | 2 +- .../godmode/agentes/massive_config.php | 2 +- .../godmode/agentes/massive_edit_modules.php | 2 +- .../godmode/agentes/module_manager.php | 20 ++++----- .../godmode/agentes/module_manager_editor.php | 23 +++++++--- .../agentes/module_manager_editor_common.php | 39 ++++------------- .../agentes/module_manager_editor_network.php | 4 +- .../agentes/module_manager_editor_plugin.php | 2 +- .../module_manager_editor_prediction.php | 2 +- .../agentes/module_manager_editor_wmi.php | 8 ++-- .../godmode/agentes/planned_downtime.php | 5 +-- pandora_console/godmode/alerts/alert_list.php | 2 +- .../alerts/configure_alert_compound.php | 2 +- ...manage_network_components_form_network.php | 2 +- .../manage_network_components_form_wmi.php | 8 ++-- .../godmode/reporting/map_builder.php | 2 +- .../godmode/servers/manage_export_form.php | 2 +- .../godmode/servers/manage_recontask_form.php | 2 +- pandora_console/godmode/servers/plugin.php | 2 +- pandora_console/godmode/setup/setup.php | 6 +-- pandora_console/include/config_process.php | 2 +- pandora_console/include/functions_ui.php | 20 +++++---- pandora_console/include/javascript/pandora.js | 2 +- pandora_console/include/styles/pandora.css | 2 +- .../operation/agentes/alerts_status.php | 2 +- .../operation/agentes/tactical.php | 2 +- 29 files changed, 132 insertions(+), 94 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 75bdd78a47..b3df89ee3a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,45 @@ +2009-03-24 Esteban Sanchez + + * general/pandora_help.php: Added support for enterprise help files. + + * include/javascript/pandora.js: Renamed pandora_help() to + open_help(). + + * include/functions_ui.php: Renamed event function on + print_help_icon(). Removed deprecated pandora_help(). + + * godmode/agentes/module_manager.php: Added enterprise hooks. + + * godmode/agentes/module_manager_editor.php: Added categories + construction here. Added enterprise hooks. + + * godmode/agentes/module_manager_editor_common.php: Replaced + deprecated pandora_help() with print_help_icon(). Moved categories + construction to module_manager_editor. + + * include/config_process.php: Updated build version. + + * include/styles/pandora.css: Fixed textarea height. + + * godmode/agentes/manage_config_remote.php, + godmode/agentes/massive_config.php, + godmode/agentes/massive_edit_modules.php, + godmode/agentes/module_manager_editor_network.php, + godmode/agentes/module_manager_editor_plugin.php, + godmode/agentes/module_manager_editor_prediction.php, + godmode/agentes/module_manager_editor_wmi.php, + godmode/agentes/planned_downtime.php, godmode/alerts/alert_list.php, + godmode/alerts/configure_alert_compound.php, + godmode/modules/manage_network_components_form_network.php, + godmode/modules/manage_network_components_form_wmi.php, + godmode/reporting/map_builder.php, + godmode/servers/manage_export_form.php, + godmode/servers/manage_recontask_form.php, godmode/servers/plugin.php, + godmode/setup/setup.php, operation/agentes/alerts_status.php, + operation/agentes/tactical.php, + godmode/agentes/agent_manager.php: Replaced deprecated pandora_help() + with print_help_icon(). + 2009-03-24 Esteban Sanchez * godmode/alerts/configure_alert_compound.php: Fixed clean up div for diff --git a/pandora_console/general/pandora_help.php b/pandora_console/general/pandora_help.php index d024495e44..cd8f359b37 100644 --- a/pandora_console/general/pandora_help.php +++ b/pandora_console/general/pandora_help.php @@ -24,11 +24,18 @@ echo ''; $id = get_parameter ('id'); -$help_file = $config["homedir"]."/include/help/".$config["language"]."/help_".$id.".php"; -// Default to english -if (! file_exists ($help_file)) { - $help_file = $config["homedir"]."/include/help/en/help_".$id.".php"; +/* Possible file locations */ +$files = array ($config["homedir"]."/include/help/".$config["language"]."/help_".$id.".php", + $config["homedir"].ENTERPRISE_DIR."/include/help/".$config["language"]."/help_".$id.".php", + $config["homedir"].ENTERPRISE_DIR."/include/help/en/help_".$id.".php", + $config["homedir"]."/include/help/en/help_".$id.".php"); +$help_file = ''; +foreach ($files as $file) { + if (file_exists ($file)) { + $help_file = $file; + break; + } } if (! $id || ! file_exists ($help_file)) { diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 7ebcdba920..38a0d682bc 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -138,7 +138,7 @@ $table->data[12][0] = ''.__('Description').''; $table->data[12][1] = print_input_text ('comentarios', $comentarios, '', 45, 255, true); // Learn mode / Normal mode -$table->data[13][0] = ''.__('Module definition').''.pandora_help("module_definition", true); +$table->data[13][0] = ''.__('Module definition').''.print_help_icon("module_definition", true); $table->data[13][1] = __('Learning mode').' '.print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"', true); $table->data[13][1] .= __('Normal mode').' '.print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"', true); diff --git a/pandora_console/godmode/agentes/manage_config_remote.php b/pandora_console/godmode/agentes/manage_config_remote.php index 256dec62af..f5cbafa12f 100644 --- a/pandora_console/godmode/agentes/manage_config_remote.php +++ b/pandora_console/godmode/agentes/manage_config_remote.php @@ -95,7 +95,7 @@ if ((isset($_GET["operacion"])) AND ($update_agent == -1) AND ($update_group == // Source agent echo ''. __('Source agent').''; - pandora_help ('duplicateconfig'); + print_help_icon ('duplicateconfig'); echo '

'; // Show combo with SOURCE agents diff --git a/pandora_console/godmode/agentes/massive_config.php b/pandora_console/godmode/agentes/massive_config.php index f58723f7ce..65d5a7c42e 100644 --- a/pandora_console/godmode/agentes/massive_config.php +++ b/pandora_console/godmode/agentes/massive_config.php @@ -73,7 +73,7 @@ echo '
'; echo '
'; echo ''.__('Source'); -pandora_help ('manageconfig'); +print_help_icon ('manageconfig'); echo ''; print_table ($table); echo '
'; diff --git a/pandora_console/godmode/agentes/massive_edit_modules.php b/pandora_console/godmode/agentes/massive_edit_modules.php index e097a563f8..8cf6e782e8 100644 --- a/pandora_console/godmode/agentes/massive_edit_modules.php +++ b/pandora_console/godmode/agentes/massive_edit_modules.php @@ -140,7 +140,7 @@ $table->data['edit1'][3] .= '
'.__('Max.').''; $table->data['edit1'][3] .= print_input_text ('max_critical', '', '', 5, 15, true); /* FF stands for Flip-flop */ -$table->data['edit2'][0] = __('FF threshold').' '.pandora_help ('ff_threshold', true); +$table->data['edit2'][0] = __('FF threshold').' '.print_help_icon ('ff_threshold', true); $table->data['edit2'][1] = print_input_text ('ff_event', '', '', 5, 15, true); $table->data['edit2'][2] = __('Historical data'); $table->data['edit2'][3] = print_checkbox ("history_data", 1, '', true); diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index d6118e8c6b..a0b9be8d9f 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -22,12 +22,11 @@ if (!isset ($id_agente)) { die ("Not Authorized"); } +enterprise_include ('godmode/agentes/module_manager.php'); + echo "

".__('Agent configuration')." > ".__('Modules')."

"; -// ========================== // Create module/type combo -// ========================== - echo ''; echo ''; echo "'; echo ' - + diff --git a/pandora_console/godmode/modules/manage_network_components_form_wmi.php b/pandora_console/godmode/modules/manage_network_components_form_wmi.php index c3ee0e2e6a..6682f44900 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_wmi.php +++ b/pandora_console/godmode/modules/manage_network_components_form_wmi.php @@ -142,7 +142,7 @@ echo ''; // WMI Query echo ''; echo ''; // Key string echo ''; echo ''; // Field echo ''; echo ''; // Namespace echo ''; echo ' - + '; foreach ($serverinfo as $server_id => $server_info) {
"; @@ -47,17 +46,18 @@ if ($develop_bypass) { $prediction_available = 1; } -$servers = array (); -$servers['dataserver'] = __('Create a new data server module'); +$modules = array (); +$modules['dataserver'] = __('Create a new data server module'); if ($network_available) - $servers['networkserver'] = __('Create a new network server module'); + $modules['networkserver'] = __('Create a new network server module'); if ($plugin_available) - $servers['pluginserver'] = __('Create a new plugin Server module'); + $modules['pluginserver'] = __('Create a new plugin Server module'); if ($wmi_available) - $servers['wmiserver'] = __('Create a new WMI Server module'); + $modules['wmiserver'] = __('Create a new WMI Server module'); if ($prediction_available) - $servers['predictionserver'] = __('Create a new prediction Server module'); -print_select ($servers, 'moduletype', '', '', '', '', false, false, false); + $modules['predictionserver'] = __('Create a new prediction Server module'); +enterprise_hook ('set_enterprise_module_types', array (&$modules)); +print_select ($modules, 'moduletype', '', '', '', '', false, false, false); print_input_hidden ('edit_module', 1); echo ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 17428a7790..fee8fccc18 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -157,40 +157,51 @@ switch ($moduletype) { case "dataserver": $moduletype = 1; case 1: + /* Categories is an array containing the allowed module types + (generic_data, generic_string, etc) from ttipo_modulo (field categoria) */ + $categories = array (0, 1, 2, 6, 7, 8, 9, -1); require ('module_manager_editor_common.php'); require ('module_manager_editor_data.php'); break; case "networkserver": $moduletype = 2; case 2: + $categories = array (3, 4, 5); require ('module_manager_editor_common.php'); require ('module_manager_editor_network.php'); break; case "pluginserver": $moduletype = 4; case 4: + $categories = array (0, 1, 2, 9); require ('module_manager_editor_common.php'); require ('module_manager_editor_plugin.php'); break; case "predictionserver": $moduletype = 5; case 5: + $categories = array (1, 2); require ('module_manager_editor_common.php'); require ('module_manager_editor_prediction.php'); break; case "wmiserver": $moduletype = 6; case 6: + $categories = array (0, 1, 2); require ('module_manager_editor_common.php'); require ('module_manager_editor_wmi.php'); break; +/* WARNING: type 7 is reserved on enterprise */ default: - echo '

DEBUG: Invalid module type specified in '.__FILE__.':'.__LINE__.'

'; - echo 'Most likely you have recently upgraded from an earlier version of Pandora and either
- 1) forgot to use the database converter
- 2) used a bad version of the database converter (see Bugreport #2124706 for the solution)
- 3) found a new bug - please report a way to duplicate this error'; - return; //We return control to the invoking script so the page finishes rendering + if (enterprise_include ('godmode/agentes/module_manager_editor.php') === ENTERPRISE_NOT_HOOK) { + echo '

DEBUG: Invalid module type specified in '.__FILE__.':'.__LINE__.'

'; + echo 'Most likely you have recently upgraded from an earlier version of Pandora and either
+ 1) forgot to use the database converter
+ 2) used a bad version of the database converter (see Bugreport #2124706 for the solution)
+ 3) found a new bug - please report a way to duplicate this error'; + + return; + } } echo '

'.__('Module assignment'); diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 0567134531..60ce192933 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -69,7 +69,7 @@ function add_component_selection ($id_network_component_type) { $data = array (); $data[0] = __('Using module component').' '; - $data[0] .= pandora_help ('network_component', true); + $data[0] .= print_help_icon ('network_component', true); $component_groups = get_network_component_groups ($id_network_component_type); $data[1] = ''; @@ -105,41 +105,18 @@ $table_simple->class = 'databox_color'; $table_simple->data = array (); $table_simple->colspan = array (); $table_simple->style = array (); -$table_simple->style[0] = 'font-weight: bold'; -$table_simple->style[2] = 'font-weight: bold'; +$table_simple->style[0] = 'font-weight: bold; vertical-align: top'; +$table_simple->style[2] = 'font-weight: bold; vertical-align: top'; $table_simple->data[0][0] = __('Name'); $table_simple->data[0][1] = print_input_text ('name', $name, '', 20, 100, true); $table_simple->data[0][2] = __('Disabled'); $table_simple->data[0][3] = print_checkbox ("disabled", 1, $disabled, true); -$table_simple->data[1][0] = __('Type').' '.pandora_help ('module_type', true); +$table_simple->data[1][0] = __('Type').' '.print_help_icon ('module_type', true); if ($id_agent_module) { $table_simple->data[1][1] = ''.get_moduletype_description ($id_module_type).''; } else { - switch ($moduletype) { - case 1: - case "dataserver": - $categories = array (0, 1, 2, 6, 7, 8, 9, -1); - break; - case 2: - case "networkserver": - $categories = array (3, 4, 5); - break; - case 4: - case "pluginserver": - $categories = array (0, 1, 2, 9); - break; - case 5: - case "predictionserver": - $categories = array (1, 2); - break; - case 6: - case "wmiserver": - $categories = array (0, 1, 2); - break; - } - $sql = sprintf ('SELECT id_tipo, descripcion FROM ttipo_modulo WHERE categoria IN (%s) @@ -170,7 +147,7 @@ $table_simple->data[2][3] .= print_input_text ('max_critical', $max_critical, '', 5, 15, true); /* FF stands for Flip-flop */ -$table_simple->data[3][0] = __('FF threshold').' '.pandora_help ('ff_threshold', true); +$table_simple->data[3][0] = __('FF threshold').' '.print_help_icon ('ff_threshold', true); $table_simple->data[3][1] = print_input_text ('ff_event', $ff_event, '', 5, 15, true); $table_simple->data[3][2] = __('Historical data'); @@ -182,8 +159,8 @@ $table_advanced->width = '90%'; $table_advanced->class = 'databox_color'; $table_advanced->data = array (); $table_advanced->style = array (); -$table_advanced->style[0] = 'font-weight: bold'; -$table_advanced->style[2] = 'font-weight: bold'; +$table_advanced->style[0] = 'font-weight: bold; vertical-align: top'; +$table_advanced->style[2] = 'font-weight: bold; vertical-align: top'; $table_advanced->colspan = array (); $table_advanced->data[0][0] = __('Description'); @@ -199,7 +176,7 @@ $table_advanced->data[2][0] = __('Interval'); $table_advanced->data[2][1] = print_input_text ('module_interval', $interval, '', 5, 10, true); -$table_advanced->data[2][2] = __('Post process').' '.pandora_help ('postprocess', true); +$table_advanced->data[2][2] = __('Post process').' '.print_help_icon ('postprocess', true); $table_advanced->data[2][3] = print_input_text ('post_process', $post_process, '', 5, 5, true); diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 6344fda5ed..32564d0a99 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -75,7 +75,7 @@ $data[1] .= ''; $data[1] .= ''; $data[1] .= print_button (__('SNMP walk'), 'snmp_walk', $ip_target == '', '', 'class="sub next"', true); -$data[1] .= pandora_help ('snmpwalk', true); +$data[1] .= print_help_icon ('snmpwalk', true); $data[1] .= ''; $table_simple->colspan['snmp_2'][1] = 3; @@ -83,7 +83,7 @@ push_table_simple ($data, 'snmp_2'); /* Advanced stuff */ $data = array (); -$data[0] = __('TCP send').' '.pandora_help ("tcp_send", true); +$data[0] = __('TCP send').' '.print_help_icon ("tcp_send", true); $data[1] = print_textarea ('tcp_send', 2, 65, $tcp_send, '', true); $table_advanced->colspan['tcp_send'][1] = 3; diff --git a/pandora_console/godmode/agentes/module_manager_editor_plugin.php b/pandora_console/godmode/agentes/module_manager_editor_plugin.php index 7dd2f4676e..e5273c113b 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_plugin.php +++ b/pandora_console/godmode/agentes/module_manager_editor_plugin.php @@ -51,7 +51,7 @@ push_table_simple ($data, 'plugin_2'); $data = array (); $data[0] = __('Plugin parameters'); -$data[0] .= pandora_help ('plugin_parameters', true); +$data[0] .= print_help_icon ('plugin_parameters', true); $data[1] = print_input_text ('plugin_parameter', $plugin_parameter, '', 30, 60, true); $table_simple->colspan['plugin_3'][1] = 3; diff --git a/pandora_console/godmode/agentes/module_manager_editor_prediction.php b/pandora_console/godmode/agentes/module_manager_editor_prediction.php index d87dd03906..d7733c11ab 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_prediction.php +++ b/pandora_console/godmode/agentes/module_manager_editor_prediction.php @@ -25,7 +25,7 @@ $extra_title = __('Prediction server module'); $data = array (); $data[0] = __('Source module'); -$data[0] .= pandora_help ('prediction_source_module', true); +$data[0] .= print_help_icon ('prediction_source_module', true); $agents = get_group_agents (array_keys (get_user_groups ($config["id_user"], "AW"))); $fields = array (); foreach ($agents as $agent_id => $agent_name) { diff --git a/pandora_console/godmode/agentes/module_manager_editor_wmi.php b/pandora_console/godmode/agentes/module_manager_editor_wmi.php index 1bf876e535..ed4c74ab05 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_wmi.php +++ b/pandora_console/godmode/agentes/module_manager_editor_wmi.php @@ -36,7 +36,7 @@ $data = array (); $data[0] = __('Target IP'); $data[1] = print_input_text ('ip_target', $ip_target, '', 15, 60, true); $data[2] = _('Namespace'); -$data[2] .= pandora_help ('wminamespace', true); +$data[2] .= print_help_icon ('wminamespace', true); $data[3] = print_input_text ('tcp_send', $tcp_send, '', 5, 20, true); push_table_simple ($data, 'target_ip'); @@ -51,7 +51,7 @@ push_table_simple ($data, 'user_pass'); $data = array (); $data[0] = __('WMI Query'); -$data[0] .= pandora_help ('wmiquery', true); +$data[0] .= print_help_icon ('wmiquery', true); $data[1] = print_input_text ('snmp_oid', $snmp_oid, '', 35, 255, true); $table_simple->colspan['wmi_query'][1] = 3; @@ -59,10 +59,10 @@ push_table_simple ($data, 'wmi_query'); $data = array (); $data[0] = __('Key string'); -$data[0] .= pandora_help ('wmikey', true); +$data[0] .= print_help_icon ('wmikey', true); $data[1] = print_input_text ('snmp_community', $snmp_community, '', 20, 60, true); $data[2] = __('Field number'); -$data[2] .= pandora_help ('wmifield', true); +$data[2] .= print_help_icon ('wmifield', true); $data[3] = print_input_text ('tcp_port', $tcp_port, '', 5, 15, true); push_table_simple ($data, 'key_field'); diff --git a/pandora_console/godmode/agentes/planned_downtime.php b/pandora_console/godmode/agentes/planned_downtime.php index 67d2c6123c..d02684c557 100644 --- a/pandora_console/godmode/agentes/planned_downtime.php +++ b/pandora_console/godmode/agentes/planned_downtime.php @@ -160,10 +160,9 @@ if ($create_downtime || $update_downtime) { } //Editor form - echo '

'.__('Planned Downtime Form').' help

'; + echo '

'.__('Planned Downtime Form').' '.print_help_icon ('planned_downtime', true).'

'; print_table ($table); - - + print_input_hidden ('id_agent', $id_agent); echo '
'; if ($id_downtime) { diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 5887f4a972..cda38c5efe 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -394,7 +394,7 @@ print_input_text ('fires_min', -1, '', 4, 10); echo ' '.__('to').' '; print_input_text ('fires_max', -1, '', 4, 10); echo ' '.__('matches of the alert'); -echo pandora_help ("alert-matches", true); +echo print_help_icon ("alert-matches", true); echo ''; echo '
'; print_submit_button (__('Add'), 'add_action', false, 'class="sub next"'); diff --git a/pandora_console/godmode/alerts/configure_alert_compound.php b/pandora_console/godmode/alerts/configure_alert_compound.php index 4fa413ca97..cccaf38876 100644 --- a/pandora_console/godmode/alerts/configure_alert_compound.php +++ b/pandora_console/godmode/alerts/configure_alert_compound.php @@ -361,7 +361,7 @@ if ($step == 2) { $table->data[4][1] .= ' '.__('to').' '; $table->data[4][1] .= print_input_text ('fires_max', 0, '', 4, 10, true); $table->data[4][1] .= ' '.__('matches of the alert'); - $table->data[4][1] .= pandora_help("alert-matches", true); + $table->data[4][1] .= print_help_icon("alert-matches", true); $table->data[4][1] .= ''; */ $table->data['actions'][0] = __('Assigned actions'); diff --git a/pandora_console/godmode/modules/manage_network_components_form_network.php b/pandora_console/godmode/modules/manage_network_components_form_network.php index 9510276c93..5d6e827aaf 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_network.php +++ b/pandora_console/godmode/modules/manage_network_components_form_network.php @@ -241,7 +241,7 @@ echo '
' . __('WMI Query') ; -pandora_help("wmiquery"); +print_help_icon("wmiquery"); echo ''; echo ''; @@ -150,7 +150,7 @@ echo '' . __('Key string'); -pandora_help("wmikey"); +print_help_icon("wmikey"); echo ''; echo ''; @@ -158,7 +158,7 @@ echo '
' . __('Field number'); -pandora_help("wmifield"); +print_help_icon("wmifield"); echo ''; echo ''; @@ -166,7 +166,7 @@ echo '' . __('Namespace'); -pandora_help("wminamespace"); +print_help_icon("wminamespace"); echo ''; echo ''; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index f1ebc1caa6..c1e5908c8b 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -252,7 +252,7 @@ if ($id_layout) { } echo "

".__('Reporting')." > ".__('Map builder'); -pandora_help ("map_builder"); +print_help_icon ("map_builder"); echo "

"; if (! $edit_layout && ! $id_layout) { diff --git a/pandora_console/godmode/servers/manage_export_form.php b/pandora_console/godmode/servers/manage_export_form.php index 55e307a500..6bc410af22 100644 --- a/pandora_console/godmode/servers/manage_export_form.php +++ b/pandora_console/godmode/servers/manage_export_form.php @@ -59,7 +59,7 @@ else { } echo '

'.__('Pandora servers').' > '.__('export targets'); -//pandora_help ("exportserver"); +//print_help_icon ("exportserver"); echo '

'; $table->width=700; diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index 6bf6c92a4e..909a1f7b82 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -54,7 +54,7 @@ if (isset ($_GET["update"])) { // Edit mode } echo '

'.__('Pandora servers').' > '.__('Manage recontask'); -pandora_help ("recontask"); +print_help_icon ("recontask"); echo '

'; $table->width=700; diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 525d905f59..a072f40a2d 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -139,7 +139,7 @@ if (($create != "") OR ($view != "")){ echo __('Plugin update'); $plugin_id = get_parameter ("view",""); } - pandora_help("plugin_definition"); + print_help_icon("plugin_definition"); echo ""; if ($create == "") diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 5ceca6011c..790ec9ef1a 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -50,7 +50,7 @@ $table->data[0][0] = __('Language code for Pandora'); $table->data[0][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language', $config["language"], '', '', '', true); -$table->data[1][0] = __('Date format string') . pandora_help("date_format", true); +$table->data[1][0] = __('Date format string') . print_help_icon("date_format", true); $table->data[1][1] = ''.__('Example').' '.date ($config["date_format"]); $table->data[1][1] .= print_input_text ('date_format', $config["date_format"], '', 30, 100, true); @@ -93,13 +93,13 @@ $table->data[14][1] = print_input_text ('block_size', $config["block_size"], '', $table->data[15][0] = __('Default hours for event view'); $table->data[15][1] = print_input_text ('event_view_hr', $config["event_view_hr"], '', 5, 5, true); -$table->data[16][0] = __('Timestamp or time comparation') . pandora_help ("time_stamp-comparation", true); +$table->data[16][0] = __('Timestamp or time comparation') . print_help_icon ("time_stamp-comparation", true); $table->data[16][1] = __('Comparation in rollover').' '; $table->data[16][1] .= print_radio_button ('prominent_time', "timestamp", '', $config["prominent_time"], true); $table->data[16][1] .= '
'.__('Timestamp in rollover').' '; $table->data[16][1] .= print_radio_button ('prominent_time', "comparation", '', $config["prominent_time"], true); -$table->data[17][0] = __('Time source') . pandora_help ("timesource", true); +$table->data[17][0] = __('Time source') . print_help_icon ("timesource", true); $sources["system"] = __('System'); $sources["sql"] = __('Database'); $table->data[17][1] = print_select ($sources, 'timesource', $config["timesource"], '', '', '', true); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 93ef563f9e..7ebed1aebf 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //Pandora Version -$build_version = 'PC090312'; +$build_version = 'PC090324'; $pandora_version = 'v3.0-dev'; $config['start_time'] = microtime (true); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 056990115c..d62438d294 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -397,13 +397,6 @@ function print_alert_template_example ($id_alert_template, $return = false, $pri echo $output; } -/** - * DEPRECATED: Use print_help_icon to avoid confusion with pandora_help javascript function - */ -function pandora_help ($help_id, $return = false) { - return print_help_icon ($help_id, $return); -} - /** * Prints a help tip icon. * @@ -413,7 +406,10 @@ function pandora_help ($help_id, $return = false) { * @return string The help tip */ function print_help_icon ($help_id, $return = false) { - $output = ' '.print_image ("images/help.png", true, array ("class" => "img_help", "title" => __('Help'), "onclick" => "pandora_help ('".$help_id."')")); + $output = ' '.print_image ("images/help.png", true, + array ("class" => "img_help", + "title" => __('Help'), + "onclick" => "open_help ('".$help_id."')")); if (!$return) echo $output; @@ -927,13 +923,19 @@ function debug ($var, $backtrace = true) { * @return string An HTML string with the icon. Printed if return is false */ function print_moduletype_icon ($id_moduletype, $return = false) { + global $config; + $type = get_db_row ("ttipo_modulo", "id_tipo", (int) $id_moduletype, array ("nombre", "icon")); if ($type === false) { $type = array (); $type["nombre"] = __('Unknown Type'); $type["icon"] = 'b_down.png'; } - return print_image ("images/".$type["icon"], $return, array ("border" => 0, "title" => $type["nombre"])); + $imagepath = 'images/'.$type["icon"]; + if (! file_exists ($config['homedir'].'/'.$imagepath)) + $imagepath = ENTERPRISE_DIR.'/'.$imagepath; + + return print_image ($imagepath, $return, array ("border" => 0, "title" => $type["nombre"])); } /** diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index a53acf432b..ce9f37ce3e 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -15,7 +15,7 @@ function winopeng (url, wid) { status =wid; } -function pandora_help (help_id) { +function open_help (help_id) { open ("general/pandora_help.php?id="+help_id, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0"); } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index e9218abf27..8d3a68f1db 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -33,7 +33,7 @@ input, textarea { } textarea { padding: 5px; - height: 100px; + min-height: 100px; width: 100%; } textarea.conf_editor { diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 168eee9e08..a8b607670a 100644 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -132,7 +132,7 @@ $table->head[1] = ''; //Placeholder for name $table->head[2] = __('Template'); $table->head[3] = __('Last fired'); $table->head[4] = __('Status'); -$table->head[5] = __('Validate').pandora_help ('alert_validation', true); +$table->head[5] = __('Validate').print_help_icon ('alert_validation', true); $table->title = __('Single alerts'); if ($print_agent == 0) { diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index ef972daffb..ac6aaafcbb 100644 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -169,7 +169,7 @@ if ($serverinfo) {
'.__('Name').' '.__('Status').' '.__('Load').''.__('Lag').pandora_help ("serverlag", true).''.__('Lag').print_help_icon ("serverlag", true).'