From: martin Date: Wed, 25 Sep 2002 11:06:27 +0000 (+0000) Subject: It's possible $USER->lang may not be defined. If so, use $CFG->lang. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=632d6407519a782d4ff9ef86a4016f277b7da32e;p=moodle.git It's possible $USER->lang may not be defined. If so, use $CFG->lang. --- diff --git a/admin/lang.php b/admin/lang.php index a39c68e7ab..9b44986559 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -35,11 +35,17 @@ break; } + if ($USER->lang) { + $currentlang = $USER->lang; + } else { + $currentlang = $CFG->lang; + } + print_header("$site->fullname: $title", "$site->fullname", "$stradministration -> $navigation"); if (!$mode) { - print_heading("$strcurrentlanguage: $USER->lang - ".get_string("thislanguage")); + print_heading("$strcurrentlanguage: $currentlang - ".get_string("thislanguage")); print_heading("$strmissingstrings"); print_heading("$strcomparelanguage"); print_footer(); @@ -48,7 +54,7 @@ // Get a list of all the root files in the English directory - $langdir = "$CFG->dirroot/lang/$USER->lang"; + $langdir = "$CFG->dirroot/lang/$currentlang"; $enlangdir = "$CFG->dirroot/lang/en"; if (! $stringfiles = get_directory_list($enlangdir, "", false)) {