From: moodler Date: Fri, 7 Nov 2003 15:11:34 +0000 (+0000) Subject: Forgot to check this in ... has a new function X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=82196932b051847221f4551a16d4e15777ebe568;p=moodle.git Forgot to check this in ... has a new function --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 24c7d5dfc3..9757925905 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1370,13 +1370,36 @@ function get_list_of_countries() { } } - include("$CFG->dirroot/lang/$lang/countries.php"); + include_once("$CFG->dirroot/lang/$lang/countries.php"); asort($string); return $string; } +function get_list_of_pixnames() { +/// Returns a list of picture names in the current language + global $CFG; + + $lang = current_language(); + + if (!file_exists("$CFG->dirroot/lang/$lang/pix.php")) { + if ($parentlang = get_string("parentlanguage")) { + if (file_exists("$CFG->dirroot/lang/$parentlang/pix.php")) { + $lang = $parentlang; + } else { + $lang = "en"; // countries.php must exist in this pack + } + } else { + $lang = "en"; // countries.php must exist in this pack + } + } + + include_once("$CFG->dirroot/lang/$lang/pix.php"); + + return $string; +} + function document_file($file, $include=true) { /// Can include a given document file (depends on second /// parameter) or just return info about it