]> git.mjollnir.org Git - moodle.git/commitdiff
Moved session lang setting into setup.php (works on all pages)
authormoodler <moodler>
Mon, 20 Jan 2003 08:09:25 +0000 (08:09 +0000)
committermoodler <moodler>
Mon, 20 Jan 2003 08:09:25 +0000 (08:09 +0000)
index.php
lib/setup.php

index 45b6adfd375eda46c05e2871d02a8d3e02a132e1..896c55704ce48b3041c78c0691ff20589f6e9335 100644 (file)
--- a/index.php
+++ b/index.php
         }
     }
 
-    if (isset($lang)) {
-        $SESSION->lang = $lang;
-        save_session("SESSION");
-    }
     $currlang = current_language();
     $langs = get_list_of_languages();
     $langmenu = popup_form ("$CFG->wwwroot/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
index 430a45ecbdc22ea18495f87c60c9b0151cb3c259..17cecc9b99898f1d7320f4f0c5eaa66f3d5d5506 100644 (file)
 /// then use the one from the default language.  Otherwise (and this is the 
 /// majority of cases), use the stored locale specified by admin.
 
+    if (isset($lang)) {
+        $SESSION->lang = $lang;
+        save_session("SESSION");
+    }
+
     if (!empty($SESSION->lang) and ($SESSION->lang != $CFG->lang) ) {
         $CFG->locale = get_string("locale");
     } else if (!empty($USER->lang) and ($USER->lang != $CFG->lang) ) {