mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2008-08-19 Esteban Sanchez <estebans@artica.es>
* include/locale.class.php: Fixes in Translate_Locale() to work properly. Tab style correction in all the file, use tabs instead of blankspaces. * godmode/setup/setup.php: Added locale configuration option. * pandoradb_data.sql: Added locale to tconfig. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1013 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
85a10ec9ab
commit
b1c689f17b
@ -1,3 +1,13 @@
|
|||||||
|
2008-08-19 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
|
* include/locale.class.php: Fixes in Translate_Locale() to work
|
||||||
|
properly. Tab style correction in all the file, use tabs instead of
|
||||||
|
blankspaces.
|
||||||
|
|
||||||
|
* godmode/setup/setup.php: Added locale configuration option.
|
||||||
|
|
||||||
|
* pandoradb_data.sql: Added locale to tconfig.
|
||||||
|
|
||||||
2008-08-19 Esteban Sanchez <estebans@artica.es>
|
2008-08-19 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
* include/locale.class.php: Check $ENV["TMPDIR"] existance to avoid
|
* include/locale.class.php: Check $ENV["TMPDIR"] existance to avoid
|
||||||
|
@ -45,6 +45,7 @@ if ($update_settings) {
|
|||||||
$config["graph_color2"] = (string) get_parameter ('graph_color2');
|
$config["graph_color2"] = (string) get_parameter ('graph_color2');
|
||||||
$config["graph_color3"] = (string) get_parameter ('graph_color3');
|
$config["graph_color3"] = (string) get_parameter ('graph_color3');
|
||||||
$config["sla_period"] = (int) get_parameter ("sla_period");
|
$config["sla_period"] = (int) get_parameter ("sla_period");
|
||||||
|
$config["locale"] = (string) get_parameter ("locale");
|
||||||
|
|
||||||
$config["style"] = substr ($config["style"], 0, strlen ($config["style"]) - 4);
|
$config["style"] = substr ($config["style"], 0, strlen ($config["style"]) - 4);
|
||||||
process_sql ("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE token = 'remote_config'");
|
process_sql ("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE token = 'remote_config'");
|
||||||
@ -61,6 +62,7 @@ if ($update_settings) {
|
|||||||
process_sql ("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token = 'graph_color2'");
|
process_sql ("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token = 'graph_color2'");
|
||||||
process_sql ("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token = 'graph_color3'");
|
process_sql ("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token = 'graph_color3'");
|
||||||
process_sql ("UPDATE tconfig SET VALUE='".$config["sla_period"]."' WHERE token = 'sla_period'");
|
process_sql ("UPDATE tconfig SET VALUE='".$config["sla_period"]."' WHERE token = 'sla_period'");
|
||||||
|
process_sql ("UPDATE tconfig SET VALUE='".$config["locale"]."' WHERE token = 'locale'");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<h2>".__('Pandora Setup')." > ";
|
echo "<h2>".__('Pandora Setup')." > ";
|
||||||
@ -72,32 +74,40 @@ $table->width = '500px';
|
|||||||
$table->data = array ();
|
$table->data = array ();
|
||||||
$table->data[0][0] = __('Language Code for Pandora');
|
$table->data[0][0] = __('Language Code for Pandora');
|
||||||
$table->data[0][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language_code', $config["language"], '', '', '', true);
|
$table->data[0][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language_code', $config["language"], '', '', '', true);
|
||||||
$table->data[1][0] = __('Remote config directory');
|
if (isset ($LOCALE)) {
|
||||||
$table->data[1][1] = print_input_text ('remote_config', $config["remote_config"], '', 30, 100, true);
|
$locales = array ();
|
||||||
$table->data[2][0] = __('Graph color (min)');
|
foreach ($LOCALE->Get_Locales_Array () as $locale) {
|
||||||
$table->data[2][1] = print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
|
$locales[$locale] = $LOCALE->Translate_Locale ($locale);
|
||||||
$table->data[3][0] = __('Graph color (avg)');
|
}
|
||||||
$table->data[3][1] = print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
|
$table->data[1][0] = __('Locale');
|
||||||
$table->data[4][0] = __('Graph color (max)');
|
$table->data[1][1] = print_select ($locales, 'locale', $config["locale"], '', '', '', true);
|
||||||
$table->data[4][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
|
}
|
||||||
$table->data[5][0] = __('SLA period');
|
$table->data[2][0] = __('Remote config directory');
|
||||||
$table->data[5][1] = print_input_text ('sla_period', $config["sla_period"], '', 5, 5, true);
|
$table->data[2][1] = print_input_text ('remote_config', $config["remote_config"], '', 30, 100, true);
|
||||||
$table->data[5][0] = __('Max. days before compact data');
|
$table->data[3][0] = __('Graph color (min)');
|
||||||
$table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true);
|
$table->data[3][1] = print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
|
||||||
$table->data[6][0] = __('Max. days before purge');
|
$table->data[4][0] = __('Graph color (avg)');
|
||||||
$table->data[6][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true);
|
$table->data[4][1] = print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
|
||||||
$table->data[7][0] = __('Graphic resolution (1-low, 5-high)');
|
$table->data[5][0] = __('Graph color (max)');
|
||||||
$table->data[7][1] = print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
|
$table->data[5][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
|
||||||
$table->data[8][0] = __('Compact interpolation in hours (1 Fine-20 bad)');
|
$table->data[6][0] = __('SLA period');
|
||||||
$table->data[8][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true);
|
$table->data[6][1] = print_input_text ('sla_period', $config["sla_period"], '', 5, 5, true);
|
||||||
$table->data[9][0] = __('Show unknown modules in global view');
|
$table->data[6][0] = __('Max. days before compact data');
|
||||||
$table->data[9][1] = print_checkbox ('show_unknown', 1, $config["show_unknown"], true);
|
$table->data[6][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true);
|
||||||
$table->data[10][0] = __('Show last fired alerts in global view');
|
$table->data[7][0] = __('Max. days before purge');
|
||||||
$table->data[10][1] = print_checkbox ('show_lastalerts', 1, $config["show_lastalerts"], true);
|
$table->data[7][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true);
|
||||||
$table->data[11][0] = __('Style template');
|
$table->data[8][0] = __('Graphic resolution (1-low, 5-high)');
|
||||||
$table->data[11][1] = print_select ($file_styles, 'style', $config["style"], '', '', '', true);
|
$table->data[8][1] = print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
|
||||||
$table->data[12][0] = __('Block size for pagination');
|
$table->data[9][0] = __('Compact interpolation in hours (1 Fine-20 bad)');
|
||||||
$table->data[12][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true);
|
$table->data[9][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true);
|
||||||
|
$table->data[10][0] = __('Show unknown modules in global view');
|
||||||
|
$table->data[10][1] = print_checkbox ('show_unknown', 1, $config["show_unknown"], true);
|
||||||
|
$table->data[11][0] = __('Show last fired alerts in global view');
|
||||||
|
$table->data[11][1] = print_checkbox ('show_lastalerts', 1, $config["show_lastalerts"], true);
|
||||||
|
$table->data[12][0] = __('Style template');
|
||||||
|
$table->data[12][1] = print_select ($file_styles, 'style', $config["style"], '', '', '', true);
|
||||||
|
$table->data[13][0] = __('Block size for pagination');
|
||||||
|
$table->data[13][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true);
|
||||||
|
|
||||||
echo '<form id="form_setup" method="POST" action="index.php?sec=gsetup&sec2=godmode/setup/setup">';
|
echo '<form id="form_setup" method="POST" action="index.php?sec=gsetup&sec2=godmode/setup/setup">';
|
||||||
print_input_hidden ('update_settings', 1);
|
print_input_hidden ('update_settings', 1);
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
// Locale Class - Working number, date and monetary converter
|
// Locale Class - Working number, date and monetary converter
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Copyright (c) 2008 Evi Vanoost (vanooste@rcbi.rochester.edu)
|
// Copyright (c) 2008 Evi Vanoost (vanooste@rcbi.rochester.edu)
|
||||||
|
|
||||||
// This program is free software; you can redistribute it and/or
|
// This program is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License
|
// modify it under the terms of the GNU General Public License
|
||||||
// as published by the Free Software Foundation for version 2.
|
// as published by the Free Software Foundation for version 2.
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
// USA.
|
// USA.
|
||||||
|
|
||||||
// This class should only be used for output, not for the parsing of input nor
|
// This class should only be used for output, not for the parsing of input nor
|
||||||
// database storage. This class might output UTF-8 codes that might not be
|
// database storage. This class might output UTF-8 codes that might not be
|
||||||
// supported by all output formats. Please format these strings accordingly.
|
// supported by all output formats. Please format these strings accordingly.
|
||||||
|
|
||||||
class Set_Locale {
|
class Set_Locale {
|
||||||
public $localedir = ""; //can be set from outside or you should set it here if it's in an unusual location
|
public $localedir = ""; //can be set from outside or you should set it here if it's in an unusual location
|
||||||
@ -740,11 +740,13 @@ class Set_Locale {
|
|||||||
if($locale == "UTF-8" || $locale == "C" || $locale == "POSIX") {
|
if($locale == "UTF-8" || $locale == "C" || $locale == "POSIX") {
|
||||||
return $locale; //Pure UTF-8, C or POSIX is not localized to a country
|
return $locale; //Pure UTF-8, C or POSIX is not localized to a country
|
||||||
}
|
}
|
||||||
$lang_cntr = split("_",$langcntr_char[0]);
|
|
||||||
$lang = $lang_cntr[0];
|
$lang_country = split ("_",$locale);
|
||||||
$cntr = $lang_cntr[1];
|
$lang = $lang_country[0];
|
||||||
$char = $langcntr_char[1];
|
$country_char = split ("\.",$lang_country[1]);
|
||||||
unset ($langcntr_char, $lang_cntr);
|
$cntr = isset($country_char[0]) ? $country_char[0] : "";
|
||||||
|
$char = isset($country_char[1]) ? $country_char[1] : "";
|
||||||
|
unset ($lang_country, $country_char);
|
||||||
|
|
||||||
if (in_array($lang,array_keys($this->lang_codes))) {
|
if (in_array($lang,array_keys($this->lang_codes))) {
|
||||||
$lang = $this->lang_codes[$lang];
|
$lang = $this->lang_codes[$lang];
|
||||||
@ -960,5 +962,5 @@ class Set_Locale {
|
|||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -59,7 +59,8 @@ INSERT INTO `tconfig` VALUES
|
|||||||
(17, 'graph_color1', '#38B800'),
|
(17, 'graph_color1', '#38B800'),
|
||||||
(18, 'graph_color2', '#42D100'),
|
(18, 'graph_color2', '#42D100'),
|
||||||
(19, 'graph_color3', '#89FF09'),
|
(19, 'graph_color3', '#89FF09'),
|
||||||
(20, 'sla_period', '604800');
|
(20, 'sla_period', '604800'),
|
||||||
|
(21, 'locale', 'C'),;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
|
Loading…
x
Reference in New Issue
Block a user