Update of /cvsroot/phpcvsview/phpcvsview
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15942
Modified Files:
cvsview.php
Log Message:
Added autodetection support for language, it will fall back to the users cookie setting, and at worst case back to the site administrators setting in the configuration file.
Index: cvsview.php
===================================================================
RCS file: /cvsroot/phpcvsview/phpcvsview/cvsview.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** cvsview.php 2 Feb 2005 06:12:29 -0000 1.21
--- cvsview.php 2 Feb 2005 07:15:34 -0000 1.22
***************
*** 17,20 ****
--- 17,29 ----
global $config, $env;
+ if (phpversion() <= "4.1.0") {
+ global $HTTP_ENV_VARS;
+ $_ENVIRON = $HTTP_ENV_VARS;
+ }
+ else
+ {
+ $_ENVIRON = $_ENV;
+ }
+
$REPOS = "";
$env['script_name'] = $_SERVER['PHP_SELF'];
***************
*** 26,31 ****
// check if cookie exist, if so use cookie, otherwise use config value
// then verify that config value is a valid entry
! $config['language'] = (empty($_COOKIE['config']['lang'])) ? $config['language'] : $_COOKIE['config']['lang'];
! $config['language'] = (in_array($config['language'], GetLanguagesList(), false)) ? $config['language'] : 'en';
$config['theme'] = (empty($_COOKIE['config']['theme'])) ? $config['theme'] : $_COOKIE['config']['theme'];
--- 35,40 ----
// check if cookie exist, if so use cookie, otherwise use config value
// then verify that config value is a valid entry
! $config['language'] = (empty($_COOKIE['config']['lang'])) ? SetDefaultLanguage() : $_COOKIE['config']['lang'];
! $config['language'] = (in_array($config['language'], GetLanguagesList(), false)) ? $config['language'] : "en";
$config['theme'] = (empty($_COOKIE['config']['theme'])) ? $config['theme'] : $_COOKIE['config']['theme'];
|