From: skodak Date: Mon, 31 Jul 2006 10:28:12 +0000 (+0000) Subject: Bug #6146 - Smiley popup can not be translated; merged from MOODLE_16_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3ea3763a18e74b19237c36a3d270d73aba86ce47;p=moodle.git Bug #6146 - Smiley popup can not be translated; merged from MOODLE_16_STABLE --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 80bda95bdf..ac83c37fc4 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5160,29 +5160,34 @@ function get_list_of_themes() { /** - * Returns a list of picture names in the current language + * Returns a list of picture names in the current or specified language * * @uses $CFG * @return array */ -function get_list_of_pixnames() { +function get_list_of_pixnames($lang = '') { global $CFG; - $lang = current_language(); + if (empty($lang)) { + $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_utf8'; // pix.php must exist in this pack - } - } else { - $lang = 'en_utf8'; // pix.php must exist in this pack - } + $path = $CFG->dirroot .'/lang/en_utf8/pix.php'; // always exists + + if (file_exists($CFG->dataroot .'/lang/'. $lang .'_local/pix.php')) { + $path = $CFG->dataroot .'/lang/'. $lang .'_local/pix.php'; + + } else if (file_exists($CFG->dirroot .'/lang/'. $lang .'/pix.php')) { + $path = $CFG->dirroot .'/lang/'. $lang .'/pix.php'; + + } else if (file_exists($CFG->dataroot .'/lang/'. $lang .'/pix.php')) { + $path = $CFG->dataroot .'/lang/'. $lang .'/pix.php'; + + } else if ($parentlang = get_string('parentlanguage')) { + return get_list_of_pixnames($parentlang); //return pixnames from parent language instead } - include_once($CFG->dirroot .'/lang/'. $lang .'/pix.php'); + include($path); return $string; }