From cb77cf12621ab7d3eddb4ccbe60f23716b5cc47c Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 1 Jun 2006 19:52:38 +0000 Subject: [PATCH] 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 --- course/lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/course/lib.php b/course/lib.php index 553fb9f6e3..a663301765 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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)) { -- 2.39.5