mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-65327 performance: Lazy-load module name strings
This commit is contained in:
parent
6735197cc2
commit
d91aa1e760
4 changed files with 10 additions and 11 deletions
|
@ -559,12 +559,10 @@ function get_module_types_names($plural = false) {
|
|||
if ($allmods = $DB->get_records("modules")) {
|
||||
foreach ($allmods as $mod) {
|
||||
if (file_exists("$CFG->dirroot/mod/$mod->name/lib.php") && $mod->visible) {
|
||||
$modnames[0][$mod->name] = get_string("modulename", "$mod->name");
|
||||
$modnames[1][$mod->name] = get_string("modulenameplural", "$mod->name");
|
||||
$modnames[0][$mod->name] = get_string("modulename", "$mod->name", null, true);
|
||||
$modnames[1][$mod->name] = get_string("modulenameplural", "$mod->name", null, true);
|
||||
}
|
||||
}
|
||||
core_collator::asort($modnames[0]);
|
||||
core_collator::asort($modnames[1]);
|
||||
}
|
||||
}
|
||||
return $modnames[(int)$plural];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue