]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16441 Display language selection drop-down list at My Moodle page. Merged from 1.9
authormudrd8mz <mudrd8mz>
Mon, 15 Sep 2008 11:31:53 +0000 (11:31 +0000)
committermudrd8mz <mudrd8mz>
Mon, 15 Sep 2008 11:31:53 +0000 (11:31 +0000)
my/pagelib.php

index 3366ddc51da4b0963a7592b97e2ba2da09edfc44..3ed3f6abdd3dffceb20e6ece1b4637173ca47b23 100644 (file)
@@ -28,7 +28,7 @@ class page_my_moodle extends page_base {
 
     function print_header($title) {
 
-        global $USER;
+        global $USER, $CFG;
 
         $replacements = array(
                               '%fullname%' => get_string('mymoodle','my')
@@ -46,7 +46,17 @@ class page_my_moodle extends page_base {
         $navigation = build_navigation($navlinks);
         
         $loggedinas = user_login_string($site);
-        print_header($title, $header,$navigation,'','',true, $button, $loggedinas);
+
+        if (empty($CFG->langmenu)) {
+            $langmenu = '';
+        } else {
+            $currlang = current_language();
+            $langs = get_list_of_languages();
+            $langlabel = get_accesshide(get_string('language'));
+            $langmenu = popup_form($CFG->wwwroot .'/my/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel);
+        }
+
+        print_header($title, $header,$navigation,'','',true, $button, $loggedinas.$langmenu);
 
     }