|
From: alex <bin...@li...> - 2001-09-05 03:52:29
|
alex Tue Sep 4 20:52:22 2001 EDT
Modified files:
/r2/binarycloud/base/core Lang.php
Log:
Making Debug available to private methods in Lang.
Index: r2/binarycloud/base/core/Lang.php
diff -u r2/binarycloud/base/core/Lang.php:1.4 r2/binarycloud/base/core/Lang.php:1.5
--- r2/binarycloud/base/core/Lang.php:1.4 Tue Jul 10 14:31:46 2001
+++ r2/binarycloud/base/core/Lang.php Tue Sep 4 20:52:22 2001
@@ -1,7 +1,7 @@
<?php
// Header {{{
/*******************************************************************************
- ** -File $Id: Lang.php,v 1.4 2001/07/10 21:31:46 alex Exp $
+ ** -File $Id: Lang.php,v 1.5 2001/09/05 03:52:22 alex Exp $
** -License LGPL (http://www.gnu.org/copyleft/lesser.html)
** -Copyright 2001, The Turing Studio, Inc.
** -Author nico galoppo, ni...@cr...
@@ -350,6 +350,7 @@
function _set_charset_from_langs() {
global $Sess;
+ global $Debug;
global $gLangCharset;
foreach ($this->langs as $lang) {
@@ -407,6 +408,7 @@
function _set_currency_from_langs() {
global $Sess;
+ global $Debug;
global $gLangCurrencyName;
global $gLangCurrencySymbol;
@@ -505,6 +507,7 @@
function _set_datetime_from_langs() {
global $Sess;
+ global $Debug;
global $gLangDateSpec;
global $gLangTimeSpec;
|
|
From: andi <bin...@li...> - 2001-09-09 16:48:22
|
andi Sun Sep 9 09:48:17 2001 EDT
Modified files:
/r2/binarycloud/base/core Lang.php
Log:
Changed to support 'default' config setting in user/conf/langs.php
Index: r2/binarycloud/base/core/Lang.php
diff -u r2/binarycloud/base/core/Lang.php:1.5 r2/binarycloud/base/core/Lang.php:1.6
--- r2/binarycloud/base/core/Lang.php:1.5 Tue Sep 4 20:52:22 2001
+++ r2/binarycloud/base/core/Lang.php Sun Sep 9 09:48:17 2001
@@ -1,7 +1,7 @@
<?php
// Header {{{
/*******************************************************************************
- ** -File $Id: Lang.php,v 1.5 2001/09/05 03:52:22 alex Exp $
+ ** -File $Id: Lang.php,v 1.6 2001/09/09 16:48:17 andi Exp $
** -License LGPL (http://www.gnu.org/copyleft/lesser.html)
** -Copyright 2001, The Turing Studio, Inc.
** -Author nico galoppo, ni...@cr...
@@ -286,7 +286,7 @@
foreach ($this->langs as $lang) {
- if ($lang['flag_default'] == true) {
+ if ($lang['default'] == true) {
$this->_set_lang($lang['code'], $lang['native']);
break;
}
|
|
From: andi <bin...@li...> - 2001-09-12 18:13:29
|
andi Wed Sep 12 11:13:24 2001 EDT
Modified files:
/r2/binarycloud/base/core Lang.php
Log:
Changes to match new conf filenames
Index: r2/binarycloud/base/core/Lang.php
diff -u r2/binarycloud/base/core/Lang.php:1.6 r2/binarycloud/base/core/Lang.php:1.7
--- r2/binarycloud/base/core/Lang.php:1.6 Sun Sep 9 09:48:17 2001
+++ r2/binarycloud/base/core/Lang.php Wed Sep 12 11:13:24 2001
@@ -1,7 +1,7 @@
<?php
// Header {{{
/*******************************************************************************
- ** -File $Id: Lang.php,v 1.6 2001/09/09 16:48:17 andi Exp $
+ ** -File $Id: Lang.php,v 1.7 2001/09/12 18:13:24 andi Exp $
** -License LGPL (http://www.gnu.org/copyleft/lesser.html)
** -Copyright 2001, The Turing Studio, Inc.
** -Author nico galoppo, ni...@cr...
@@ -61,7 +61,7 @@
*/
function Set_Language() {
- import("user.conf.langs");
+ import("user.conf.Languages");
$lang_set = $this->_set_lang_from_query_string();
|
|
From: andi <bin...@li...> - 2001-09-18 13:47:56
|
andi Tue Sep 18 06:47:50 2001 EDT
Modified files:
/r2/binarycloud/base/core Lang.php
Log:
Switched Lang to use Request
Index: r2/binarycloud/base/core/Lang.php
diff -u r2/binarycloud/base/core/Lang.php:1.7 r2/binarycloud/base/core/Lang.php:1.8
--- r2/binarycloud/base/core/Lang.php:1.7 Wed Sep 12 11:13:24 2001
+++ r2/binarycloud/base/core/Lang.php Tue Sep 18 06:47:50 2001
@@ -1,7 +1,7 @@
<?php
// Header {{{
/*******************************************************************************
- ** -File $Id: Lang.php,v 1.7 2001/09/12 18:13:24 andi Exp $
+ ** -File $Id: Lang.php,v 1.8 2001/09/18 13:47:50 andi Exp $
** -License LGPL (http://www.gnu.org/copyleft/lesser.html)
** -Copyright 2001, The Turing Studio, Inc.
** -Author nico galoppo, ni...@cr...
@@ -178,12 +178,14 @@
function _set_lang_from_query_string() {
global $Debug;
- global $_lang;
+ global $Request;
- if (isset($_lang)) {
- foreach ($this->langs as $lang) {
- if ($lang['code'] == $_lang) {
- $this->_set_lang($lang['code'], $lang['native']);
+ $lang = $Request->GetVar('_lang', 'GET');
+
+ if ($lang !== $Request->undefined) {
+ foreach ($this->langs as $lng) {
+ if ($lng['code'] == $lang) {
+ $this->_set_lang($lng['code'], $lng['native']);
break;
}
}
@@ -211,12 +213,14 @@
function _set_lang_from_session() {
global $Debug;
- global $HTTP_SESSION_VARS;
-
- if (isset($HTTP_SESSION_VARS["gLangCode"])) {
- foreach ($this->langs as $lang) {
- if ($lang['code'] == $HTTP_SESSION_VARS["gLangCode"]) {
- $this->_set_lang($lang['code'], $lang['native']);
+ global $Request;
+
+ $langCode = $Request->GetVar('gLangCode', 'SESSION');
+
+ if ($langCode !== $Request->undefined) {
+ foreach ($this->langs as $lng) {
+ if ($lng['code'] == $langCode) {
+ $this->_set_lang($lng['code'], $lng['native']);
break;
}
}
@@ -245,15 +249,18 @@
*/
function _set_lang_from_accept_language() {
- global $Sess;
global $Debug;
- global $HTTP_ACCEPT_LANGUAGE;
- global $gLangCode;
+ global $Request;
+ global $Sess;
+
+
+ $HttpAcceptLanguage = $Request->GetVar("HTTP_ACCEPT_LANGUAGE", 'SERVER');
+ $langCode = $Request->GetVar("gLangCode");
- if (!empty($HTTP_ACCEPT_LANGUAGE) && !defined('BC_LANG')) {
- foreach ($this->langs as $lang) {
- if ($lang['code'] == $HTTP_ACCEPT_LANGUAGE) {
- $this->_set_lang($lang['code'], $lang['native']);
+ if (!empty($HttpAcceptLanguage) && !defined('BC_LANG')) {
+ foreach ($this->langs as $lng) {
+ if ($lng['code'] == $HttpAcceptLanguage) {
+ $this->_set_lang($lng['code'], $lng['native']);
break;
}
}
@@ -280,14 +287,13 @@
*/
function _set_lang_from_default() {
- global $Sess;
global $Debug;
- global $gLangCode;
+ global $Sess;
- foreach ($this->langs as $lang) {
- if ($lang['default'] == true) {
- $this->_set_lang($lang['code'], $lang['native']);
+ foreach ($this->langs as $lng) {
+ if ($lng['default'] == true) {
+ $this->_set_lang($lng['code'], $lng['native']);
break;
}
}
@@ -319,7 +325,10 @@
*/
function _set_lang($code, $name) {
+ global $Debug;
+ global $Request;
global $Sess;
+
global $gLangCode;
global $gLangName;
@@ -330,8 +339,9 @@
$gLangCode = BC_LANG;
$gLangName = BC_LANG_NAME;
$Sess->Register("gLangCode");
+ $Sess->SetVar("gLangCode", $gLangCode);
$Sess->Register("gLangName");
-
+ $Sess->SetVar("gLangName", $gLangName);
return true;
}
@@ -473,14 +483,17 @@
*/
function _set_datetime_from_session() {
- global $HTTP_SESSION_VARS;
+ global $Request;
global $gLangDateSpec;
global $gLangTimeSpec;
-
- if (isset($HTTP_SESSION_VARS["gLangDateSpec"]) && isset($HTTP_SESSION_VARS["gLangTimeSpec"])) {
- define("BC_LANG_DATESPEC", $HTTP_SESSION_VARS["gLangDateSpec"]);
- define("BC_LANG_TIMESPEC", $HTTP_SESSION_VARS["gLangTimeSpec"]);
+ $gLangDateSpec = $Request->GetVar('gLangDateSpec', 'SESSION');
+ $gLangTimeSpec = $Request->GetVar('gLangTimeSpec', 'SESSION');
+
+
+ if (isset($gLangDateSpec) && isset($gLangTimeSpec)) {
+ define("BC_LANG_DATESPEC", $gLangDateSpec);
+ define("BC_LANG_TIMESPEC", $gLangTimeSpec);
}
if (defined('BC_LANG_DATESPEC') && defined('BC_LANG_TIMESPEC')) {
@@ -506,6 +519,7 @@
*/
function _set_datetime_from_langs() {
+ global $Request;
global $Sess;
global $Debug;
global $gLangDateSpec;
@@ -518,7 +532,9 @@
$gLangDateSpec = BC_LANG_DATESPEC;
$gLangTimeSpec = BC_LANG_TIMESPEC;
$Sess->Register("gLangDateSpec");
+ $Sess->SetVar("gLangDateSpec", $gLangDateSpec);
$Sess->Register("gLangTimeSpec");
+ $Sess->SetVar("gLangTimeSpec", $gLangTimeSpec);
break;
}
}
@@ -535,4 +551,11 @@
}
// }}}
+/*
+ * Local Variables:
+ * mode: php
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
?>
|