phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sitemgr/sitemgr-site/inc/class.sitebo.inc.php, 1.7


From: nomail
Subject: [Phpgroupware-cvs] sitemgr/sitemgr-site/inc/class.sitebo.inc.php, 1.7
Date: Wed, 21 Jul 2004 01:22:54 +0200

Update of /sitemgr/sitemgr-site/inc
Modified Files:
        Branch: 
          class.sitebo.inc.php

date: 2004/07/20 23:22:54;  author: skwashd;  state: Exp;  lines: +21 -2

Log Message:
merge from 16
=====================================================================
Index: sitemgr/sitemgr-site/inc/class.sitebo.inc.php
diff -u sitemgr/sitemgr-site/inc/class.sitebo.inc.php:1.6 
sitemgr/sitemgr-site/inc/class.sitebo.inc.php:1.7
--- sitemgr/sitemgr-site/inc/class.sitebo.inc.php:1.6   Sat May 31 04:29:22 2003
+++ sitemgr/sitemgr-site/inc/class.sitebo.inc.php       Tue Jul 20 23:22:54 2004
@@ -196,7 +196,7 @@
                        //is there a more efficient way to do the same thing?
                        unset($GLOBALS['lang']);
                        $supportedLanguages = 
$GLOBALS['sitemgr_info']['sitelanguages'] ? 
$GLOBALS['sitemgr_info']['sitelanguages'] : array('en');
-                       $postlang = $_GET['lang_block']['select'];
+                       $postlang = trim($_GET['lang']);
                        if ($postlang && 
in_array($postlang,$supportedLanguages))
                        {
                                
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $postlang;
@@ -212,6 +212,25 @@
                                $GLOBALS['sitemgr_info']['userlang'] = 
$sessionlang;
                                return;
                        }
+
+                       $client_langs = split('[,;]', 
$_SERVER['HTTP_ACCEPT_LANGUAGE']);
+                       if(is_array($client_langs))
+                       {
+                               foreach($client_langs as $lang)
+                               {
+                                       if(strlen($lang) != 2)
+                                       {
+                                               list($lang) = explode('-', 
$lang);
+                                       }
+                                       if(in_array($lang, $supportedLanguages))
+                                       {
+                                               
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang;
+                                               
$GLOBALS['sitemgr_info']['userlang'] = $lang;
+                                               
$GLOBALS['phpgw']->session->appsession('language','sitemgr-site',$lang);
+                                               return;
+                                       }
+                               }
+                       }
                        
                        if ($this->isuser)
                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]