logo       


CVS: phpwiki/lib main.php,1.206,1.207: msg#00086

Subject: CVS: phpwiki/lib main.php,1.206,1.207
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


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe