2011-07-28 Sergio Martin <sergio.martin@artica.es>

* include/config_process.php
	include/functions.php
	operation/agentes/stat_win.php
	general/pandora_help.php: Create new functions to manage pandora
	languages.
	Fix pandora_help languages to use the user language, no always the
	global language.
	Fix som SESSION index little bugs



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4641 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-07-28 09:25:42 +00:00
parent a02a50e695
commit 37d25ee6b6
5 changed files with 41 additions and 15 deletions

View File

@ -1,3 +1,14 @@
2011-07-28 Sergio Martin <sergio.martin@artica.es>
* include/config_process.php
include/functions.php
operation/agentes/stat_win.php
general/pandora_help.php: Create new functions to manage pandora
languages.
Fix pandora_help languages to use the user language, no always the
global language.
Fix som SESSION index little bugs
2011-07-27 Ramon Novoa <rnovoa@artica.es>
* operation/events/events_list.php: Hide agent details unless we have

View File

@ -27,9 +27,15 @@ require_once ("../include/functions_html.php");
<?php echo '<link rel="stylesheet" href="../include/styles/'.$config['style'].'.css" type="text/css">'; ?>
<body style="background-color: #fff; height: 100%; margin: -10 0;">
<?php
$id = get_parameter ('id');
$user_language = get_user_language ();
if (! isset($_SESSION['id_usuario'])) {
session_start();
session_write_close();
}
$user_language = get_user_language ($_SESSION['id_usuario']);
/* Possible file locations */
$safe_language = safe_url_extraclean ($user_language, "en");

View File

@ -112,14 +112,7 @@ if (isset ($config['id_user'])){
}
}
$l10n = NULL;
$user_language = get_user_language ();
if (file_exists ($config["homedir"] . '/include/languages/'.$user_language.'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ($config["homedir"] . '/include/languages/'.$user_language.'.mo'));
$l10n->load_tables();
}
set_user_language();
require_once ($ownDir . 'functions_extensions.php');

View File

@ -350,6 +350,22 @@ function get_user_language ($id_user = false) {
return $config['language'];
}
/**
* This function get the user language and set it on the system
*/
function set_user_language() {
global $config;
global $l10n;
$l10n = NULL;
$user_language = get_user_language ();
if (file_exists ('./include/languages/'.$user_language.'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$user_language.'.mo'));
$l10n->load_tables();
}
}
/**
* INTERNAL (use ui_print_timestamp for output): Transform an amount of time in seconds into a human readable
* strings of minutes, hours or days.

View File

@ -19,16 +19,16 @@
require_once ('../../include/config.php');
require_once ('../../include/auth/mysql.php');
if (! isset($_SESSION["id_user"])) {
if (! isset($_SESSION['id_usuario'])) {
session_start();
session_write_close();
}
require_once ($config["homedir"] . '/include/functions.php');
require_once ($config["homedir"] . '/include/functions_db.php');
require_once ($config["homedir"] . '/include/functions_reporting.php');
require_once ($config["homedir"] . '/include/functions_graph.php');
require_once ($config['homedir'] . "/include/functions_modules.php");
require_once ($config['homedir'] . '/include/functions.php');
require_once ($config['homedir'] . '/include/functions_db.php');
require_once ($config['homedir'] . '/include/functions_reporting.php');
require_once ($config['homedir'] . '/include/functions_graph.php');
require_once ($config['homedir'] . '/include/functions_modules.php');
check_login ();