Update of /cvsroot/phpwiki/phpwiki/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31125
Modified Files:
main.php
Log Message:
try to avoid duoplicate lang/theme init
Index: main.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -2 -b -p -d -r1.206 -r1.207
--- main.php 4 Feb 2005 11:30:10 -0000 1.206
+++ main.php 10 Feb 2005 19:03:37 -0000 1.207
@@ -143,17 +143,12 @@ class WikiRequest extends Request {
function initializeLang () {
- $user_lang = $this->getPref('lang');
+ // check non-default pref lang
$_lang = @$this->_prefs->_prefs['lang'];
+ if (isset($_lang->lang) and $_lang->lang != $GLOBALS['LANG']) {
+ $user_lang = $_lang->lang;
//check changed LANG and THEME inside a session.
// (e.g. by using another baseurl)
- if (isset($this->_user->_authhow) and
- $this->_user->_authhow == 'session' and
- !isset($_lang->lang) and
- $user_lang != $GLOBALS['LANG'])
- {
+ if (isset($this->_user->_authhow) and $this->_user->_authhow ==
'session')
$user_lang = $GLOBALS['LANG'];
- }
- if (isset($user_lang)) {
- //trigger_error("DEBUG: initializeLang() ". $user_lang ." calling
update_locale()...");
update_locale($user_lang);
FindLocalizedButtonFile(".",'missing_ok','reinit');
@@ -164,14 +159,17 @@ class WikiRequest extends Request {
global $WikiTheme;
- // Load theme
- $user_theme = $this->getPref('theme');
+ // Load non-default theme
$_theme = @$this->_prefs->_prefs['theme'];
+ if ($_theme and isset($_theme->theme))
+ $user_theme = $_theme->theme;
+ else
+ $user_theme = $this->getPref('theme');
//check changed LANG and THEME inside a session.
// (e.g. by using another baseurl)
- if (isset($this->_user->_authhow) and
- $this->_user->_authhow == 'session' and
- !isset($_theme->theme) and
- defined('THEME') and
- $user_theme != THEME)
+ if (isset($this->_user->_authhow)
+ and $this->_user->_authhow == 'session'
+ and !isset($_theme->theme)
+ and defined('THEME')
+ and $user_theme != THEME)
{
include_once("themes/" . THEME . "/themeinfo.php");
@@ -398,5 +396,5 @@ class WikiRequest extends Request {
function getLevelDescription($level) {
static $levels = false;
- if (!$levels)
+ if (!$levels) // This looks like Visual Basic hack. For the very same
reason.
$levels = array('x-1' => _("FORBIDDEN"),
'x0' => _("ANON"),
@@ -1240,4 +1238,7 @@ if (!defined('PHPWIKI_NOMAIN') or !PHPWI
// $Log$
+// Revision 1.207 2005/02/10 19:03:37 rurban
+// try to avoid duoplicate lang/theme init
+//
// Revision 1.206 2005/02/04 11:30:10 rurban
// remove old comments
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|
|