2012-12-17 Miguel de Dios <miguel.dedios@artica.es>

* godmode/alerts/alert_list.php,
	godmode/alerts/configure_alert_template.php,
	godmode/alerts/alert_templates.php,
	godmode/alerts/alert_list.builder.php,
	operation/messages/message_edit.php, include/functions_api.php,
	operation/reporting/reporting_xml.php,
	godmode/reporting/graph_builder.graph_editor.php: cleaned source
	code style.
	
	* include/functions_io.php: improved the function "__" for to hook
	the translations from metaconsole.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7292 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-12-17 16:50:38 +00:00
parent 9c8d0c052e
commit e2bb2d12de
10 changed files with 101 additions and 76 deletions

View File

@ -1,3 +1,17 @@
2012-12-17 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/alert_list.builder.php,
operation/messages/message_edit.php, include/functions_api.php,
operation/reporting/reporting_xml.php,
godmode/reporting/graph_builder.graph_editor.php: cleaned source
code style.
* include/functions_io.php: improved the function "__" for to hook
the translations from metaconsole.
2012-12-17 Miguel de Dios <miguel.dedios@artica.es>
* godmode/setup/file_manager.php, include/functions_filemanager.php:

View File

@ -278,7 +278,7 @@ else {
$buttons[$tab]['active'] = true;
if ($tab == 'list') {
ui_print_page_header(__('Alerts') . ' &raquo; ' . __('Manage alerts') . ' &raquo; ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons);
ui_print_page_header(__('Alerts') . ' &raquo; ' . __('Manage alerts') . ' &raquo; ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons);
}
else {
ui_print_page_header(__('Alerts') . ' &raquo; ' . __('Manage alerts') . ' &raquo; ' . __('Create'), "images/god2.png", false, "manage_alert_list", true, $buttons);

View File

@ -105,7 +105,8 @@ if ($a_template !== false) {
}
}
// This prevents to duplicate the header in case duplicate/edit_template action is performed
} else {
}
else {
// Header
if (defined('METACONSOLE')) {
@ -280,19 +281,19 @@ function update_template ($step) {
$default_action = NULL;
}
$values = array ('monday' => $monday,
'tuesday' => $tuesday,
'wednesday' => $wednesday,
'thursday' => $thursday,
'friday' => $friday,
'saturday' => $saturday,
'sunday' => $sunday,
'special_day' => $special_day,
'time_threshold' => $threshold,
'id_alert_action' => $default_action,
'max_alerts' => $max_alerts,
'min_alerts' => $min_alerts
);
$values = array (
'monday' => $monday,
'tuesday' => $tuesday,
'wednesday' => $wednesday,
'thursday' => $thursday,
'friday' => $friday,
'saturday' => $saturday,
'sunday' => $sunday,
'special_day' => $special_day,
'time_threshold' => $threshold,
'id_alert_action' => $default_action,
'max_alerts' => $max_alerts,
'min_alerts' => $min_alerts);
$fields = array();
for($i=1;$i<=10;$i++) {
@ -393,17 +394,17 @@ if ($create_template) {
$name_check = db_get_value ('name', 'talert_templates', 'name', $name);
$values = array ('description' => $description,
'value' => $value,
'max_value' => $max,
'min_value' => $min,
'id_group' => $id_group,
'matches_value' => $matches,
'priority' => $priority,
'wizard_level' => $wizard_level);
'value' => $value,
'max_value' => $max,
'min_value' => $min,
'id_group' => $id_group,
'matches_value' => $matches,
'priority' => $priority,
'wizard_level' => $wizard_level);
if($config['dbtype'] == "oracle") {
$values['field3'] = ' ';
$values['field3_recovery'] = ' ';
$values['field3'] = ' ';
$values['field3_recovery'] = ' ';
}
if (!$name_check) {

View File

@ -2681,7 +2681,7 @@ function api_set_validate_all_policy_alerts($id, $thrash1, $other, $thrash3) {
foreach ($result_alerts as $result_alert){
$result = alerts_validate_alert_agent_module($result_alert, true);
if ($result){
if ($result) {
$count_results++;
}
}

View File

@ -365,11 +365,21 @@ function __ ($string /*, variable arguments */) {
global $l10n;
$extensions = extensions_get_extensions();
if (empty($extensions)) $extensions = array();
if (empty($extensions))
$extensions = array();
global $config;
if ($config['enterprise_installed'] &&
if (defined('METACONSOLE')) {
enterprise_include_once ('meta/include/functions_meta.php');
$tranlateString = meta_get_defined_translation($string);
if ($tranlateString !== false) {
return $tranlateString;
}
}
elseif ($config['enterprise_installed'] &&
isset($config['translate_string_extension_installed']) &&
$config['translate_string_extension_installed'] == 1 &&
array_key_exists('translate_string.php', $extensions)) {
@ -397,7 +407,7 @@ function __ ($string /*, variable arguments */) {
$string = array_shift ($args);
if (is_null ($l10n))
return vsprintf ($string, $args);
return vsprintf ($string, $args);
return vsprintf ($l10n->translate ($string), $args);
}