From: stronk7 Date: Sun, 4 Jun 2006 15:19:05 +0000 (+0000) Subject: make_default_scale() now searches properly under X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ee6e91d4af8bbba43da2cc65094f7ab34a2b4e86;p=moodle.git make_default_scale() now searches properly under both dataroot and dirroot, defaulting to en_utf8. Bug 5719. (http://moodle.org/bugs/bug.php?op=show&bugid=5719) Merged from MOODLE_16_STABLE --- diff --git a/lib/datalib.php b/lib/datalib.php index 3a4f023f65..588264fa7b 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -2501,12 +2501,16 @@ function make_default_scale() { /// Read in the big description from the file. Note this is not /// HTML (despite the file extension) but Moodle format text. $parentlang = get_string('parentlang'); - if (is_readable($CFG->dirroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html')) { + if (is_readable($CFG->dataroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html')) { + $file = file($CFG->dataroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html'); + } else if (is_readable($CFG->dirroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html')) { $file = file($CFG->dirroot .'/lang/'. $CFG->lang .'/help/forum/ratings.html'); + } else if ($parentlang and is_readable($CFG->dataroot .'/lang/'. $parentlang .'/help/forum/ratings.html')) { + $file = file($CFG->dataroot .'/lang/'. $parentlang .'/help/forum/ratings.html'); } else if ($parentlang and is_readable($CFG->dirroot .'/lang/'. $parentlang .'/help/forum/ratings.html')) { $file = file($CFG->dirroot .'/lang/'. $parentlang .'/help/forum/ratings.html'); - } else if (is_readable($CFG->dirroot .'/lang/en/help/forum/ratings.html')) { - $file = file($CFG->dirroot .'/lang/en/help/forum/ratings.html'); + } else if (is_readable($CFG->dirroot .'/lang/en_utf8/help/forum/ratings.html')) { + $file = file($CFG->dirroot .'/lang/en_utf8/help/forum/ratings.html'); } else { $file = ''; }