From e33cebbd8e403100037113b2f8cff365bdc577fb Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 25 Oct 2012 16:46:52 +0000 Subject: [PATCH] 2012-10-25 Miguel de Dios * include/functions_extensions.php, extensions/pandora_logs.php, extensions/update_manager.php, extensions/resource_registration.php, extensions/resource_exportation.php, extensions/module_groups.php, extensions/plugin_registration.php, extensions/snmp_explorer.php, extensions/system_info.php, operation/menu.php: cleaned source code style. * include/functions_menu.php: fixed the hidden icons the extensions in menu. Fixes: #3568966 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7096 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 14 +++++++++++ pandora_console/extensions/module_groups.php | 16 ++++++------- pandora_console/extensions/pandora_logs.php | 14 +++++------ .../extensions/plugin_registration.php | 24 +++++++++---------- .../extensions/resource_exportation.php | 6 ++--- .../extensions/resource_registration.php | 18 +++++++------- pandora_console/extensions/snmp_explorer.php | 9 +++---- pandora_console/extensions/system_info.php | 18 +++++++------- pandora_console/extensions/update_manager.php | 2 +- .../include/functions_extensions.php | 14 +++++++---- pandora_console/include/functions_menu.php | 22 +++++++++-------- pandora_console/operation/menu.php | 2 +- 12 files changed, 88 insertions(+), 71 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a378d61632..8e907fa330 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2012-10-25 Miguel de Dios + + * include/functions_extensions.php, extensions/pandora_logs.php, + extensions/update_manager.php, extensions/resource_registration.php, + extensions/resource_exportation.php, extensions/module_groups.php, + extensions/plugin_registration.php, extensions/snmp_explorer.php, + extensions/system_info.php, operation/menu.php: cleaned source code + style. + + * include/functions_menu.php: fixed the hidden icons the extensions + in menu. + + Fixes: #3568966 + 2012-10-25 Vanessa Gil * include/functions_reporting.php diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 5dc89b2439..1bc643745c 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -83,9 +83,9 @@ if (is_ajax ()) { /** * Translate the array texts using gettext */ - function translate(&$item, $key) { - $item = __($item); - } +function translate(&$item, $key) { + $item = __($item); +} /** * The main function of module groups and the enter point to @@ -143,7 +143,7 @@ function mainModuleGroups() { $agentGroups = users_get_groups ($config['id_user'], "AR", false); $modelGroups = users_get_all_model_groups(); - if(!empty($agentGroups) && !empty($modelGroups)) { + if (!empty($agentGroups) && !empty($modelGroups)) { array_walk($modelGroups, 'translate'); //Translate all head titles to language is set foreach ($modelGroups as $i => $n) { @@ -217,17 +217,17 @@ function mainModuleGroups() { if ($fired) { $color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired. } - else if (array_key_exists(1,$states)) { + else if (array_key_exists(1, $states)) { $color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state. $font_color = '#ffffff'; } - elseif (array_key_exists(2,$states)) { + elseif (array_key_exists(2, $states)) { $color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state. } - elseif (array_key_exists(3,$states)) { + elseif (array_key_exists(3, $states)) { $color = '#babdb6'; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state. } - elseif (array_key_exists(0,$states)) { + elseif (array_key_exists(0, $states)) { $color = '#8ae234'; //Green when the cell for this model group and agent has OK state all modules. } diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index e68e003ccf..6bec5f5a6c 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -16,7 +16,7 @@ function view_logfile ($file_name) { global $config; - + if (!file_exists($file_name)){ echo "

".__("Cannot find file"). "(".$file_name; echo ")

"; @@ -26,7 +26,7 @@ function view_logfile ($file_name) { if ($file_size > 512000) { $data = file_get_contents ($file_name, false, NULL, $file_size - 512000); echo "

$file_name (".__("File is too large (> 500KB)").")

"; - + echo "