Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-39033 Conditional availability: Available items dimmed to students
  • Loading branch information
sammarshallou committed Apr 12, 2013
1 parent b3661ab commit 4bab91b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion course/renderer.php
Expand Up @@ -674,8 +674,15 @@ public function course_section_cm_name(cm_info $mod, $displayoptions = array())
$altname = get_accesshide(' '.$altname);
}

// For items which are hidden but available to current user
// ($mod->uservisible), we show those as dimmed only if the user has
// viewhiddenactivities, so that teachers see 'items which might not
// be available to some students' dimmed but students do not see 'item
// which is actually available to current student' dimmed.
$conditionalhidden = $this->is_cm_conditionally_hidden($mod);
$accessiblebutdim = !$mod->visible || $conditionalhidden;
$accessiblebutdim = (!$mod->visible || $conditionalhidden) &&
(!$mod->uservisible || has_capability('moodle/course:viewhiddenactivities',
context_course::instance($mod->course)));

$linkclasses = '';
$accesstext = '';
Expand Down

0 comments on commit 4bab91b

Please sign in to comment.