fixed problem in restricted modules - mods were accessed using strtolower(translated module name) instead of directory name as usual, it partially worked for English; merged from MOODLE_16_STABLE

This commit is contained in:
skodak
2006-06-01 19:52:38 +00:00
parent 7f9ba24ef2
commit cb77cf1262
+3 -3
View File
@@ -1227,9 +1227,9 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
}
// we need to loop through the forms and check to see if we can add them.
foreach ($modnames as $key) {
foreach ($modnames as $key=>$value) {
if (!course_allowed_module($course,$key))
unset($modnames[strtolower($key)]);
unset($modnames[$key]);
}
// this is stupid but labels get put into resource, so if resource is hidden and label is not, we're in trouble.
@@ -2096,7 +2096,7 @@ function course_allowed_module($course,$mod) {
if (is_numeric($mod)) {
$modid = $mod;
} else if (is_string($mod)) {
if ($mod = get_field("modules","id","name",strtolower($mod)))
if ($mod = get_field("modules","id","name",$mod))
$modid = $mod;
}
if (empty($modid)) {