]> git.mjollnir.org Git - moodle.git/commitdiff
Forgot to check this in ... has a new function
authormoodler <moodler>
Fri, 7 Nov 2003 15:11:34 +0000 (15:11 +0000)
committermoodler <moodler>
Fri, 7 Nov 2003 15:11:34 +0000 (15:11 +0000)
lib/moodlelib.php

index 24c7d5dfc37d2a86e43552686fd221757dd9300a..975792590510f3332075fa978bde70c036f1d7b6 100644 (file)
@@ -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