From: skodak Date: Thu, 1 Jun 2006 19:52:38 +0000 (+0000) Subject: fixed problem in restricted modules - mods were accessed using strtolower(translated... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cb77cf12621ab7d3eddb4ccbe60f23716b5cc47c;p=moodle.git 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 --- 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)) {