local lang: MDL-13001 perf improvement: only searches extra folders if $module == 'local'

Will merge to HEAD later, as part of MDL-18669
This commit is contained in:
tjhunt
2009-03-26 09:00:15 +00:00
parent 1a5a1c0e6c
commit 823ebe16cc
+3 -2
View File
@@ -5363,7 +5363,6 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) {
} else {
$locations[] = $CFG->dataroot.'/lang/';
$locations[] = $CFG->dirroot.'/lang/';
$locations[] = $CFG->dirroot.'/local/lang/';
}
/// Add extra places to look for strings for particular plugin types.
@@ -5380,7 +5379,9 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) {
$type = substr($module, 0, $dividerpos + 1);
$plugin = substr($module, $dividerpos + 1);
}
if (!empty($rules[$type])) {
if ($module == 'local') {
$locations[] = $CFG->dirroot . '/local/lang/';
} if (!empty($rules[$type])) {
foreach ($rules[$type] as $location) {
$locations[] = $CFG->dirroot . "/$location/$plugin/lang/";
}