Subversion Repositories ALCASAR

Rev

Rev 2795 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2795 Rev 2800
Line 42... Line 42...
42
include_once PSI_APP_ROOT.'/read_config.php';
42
include_once PSI_APP_ROOT.'/read_config.php';
43
 
43
 
44
if (defined('PSI_DEFAULT_LANG')) {
44
if (defined('PSI_DEFAULT_LANG')) {
45
    $lang = PSI_DEFAULT_LANG;
45
    $lang = PSI_DEFAULT_LANG;
46
}
46
}
47
 
-
 
48
if (isset($_GET['lang']) && (trim($_GET['lang'])!=="")
47
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
49
   && !preg_match('/[^A-Za-z\-]/', $_GET['lang'])
48
	$lang = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
50
   && file_exists(PSI_APP_ROOT.'/language/'.$_GET['lang'].'.xml')) {
-
 
51
    $lang = strtolower($_GET['lang']);
49
	$lang = strtolower(substr(chop($lang[0]), 0, 2));
52
}
50
}
53
/** ALCASAR changes
51
/** ALCASAR changes
54
 *  $lang set by the web browser config
52
 *  $lang set by the web browser config
55
 *
53
 *
56
 */
54
 */
57
 if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
55
 if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
58
	$Langue	  = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
56
	$Langue	  = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
59
	$lang = strtolower(substr(chop($Langue[0]), 0, 2));
57
	$lang = strtolower(substr(chop($Langue[0]), 0, 2));
60
 
58
 
-
 
59
//if (isset($_GET['lang']) && (trim($_GET['lang'])!=="")
-
 
60
//   && !preg_match('/[^A-Za-z\-]/', $_GET['lang'])
-
 
61
//   && file_exists(PSI_APP_ROOT.'/language/'.$_GET['lang'].'.xml')) {
-
 
62
//    $lang = strtolower($_GET['lang']);
-
 
63
//}
-
 
64
 
61
if (isset($_GET['plugin'])) {
65
if (isset($_GET['plugin'])) {
62
   if ((trim($_GET['plugin'])!=="") && !preg_match('/[^A-Za-z]/', $_GET['plugin'])) {
66
   if ((trim($_GET['plugin'])!=="") && !preg_match('/[^A-Za-z]/', $_GET['plugin'])) {
63
       $plugin = strtolower($_GET['plugin']);
67
       $plugin = strtolower($_GET['plugin']);
64
        if (file_exists(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/'.$lang.'.xml')) {
68
        if (file_exists(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/'.$lang.'.xml')) {
65
            echo file_get_contents(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/'.$lang.'.xml');
69
            echo file_get_contents(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/'.$lang.'.xml');