Skip to content

Commit

Permalink
fixed problem in restricted modules - mods were accessed using strtol…
Browse files Browse the repository at this point in the history
…ower(translated module name) instead of directory name as usual, it partially worked for English; merged from MOODLE_16_STABLE
  • Loading branch information
skodak committed Jun 1, 2006
1 parent 7f9ba24 commit cb77cf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit cb77cf1

Please sign in to comment.