Permalink
Browse files

Merge branch 'wip-mdl-36707-m23' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_23_STABLE
  • Loading branch information...
2 parents 3ec8f9f + 84e47a8 commit 862606800186061f7bf05ef02a54b90ab5e9bd64 @nebgor nebgor committed Nov 20, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 course/lib.php
View
@@ -1484,15 +1484,16 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$modcontext = context_module::instance($mod->id);
$canviewhidden = has_capability('moodle/course:viewhiddenactivities', $modcontext);
$accessiblebutdim = false;
+ $conditionalhidden = false;
if ($canviewhidden) {
$accessiblebutdim = !$mod->visible;
if (!empty($CFG->enableavailability)) {
- $accessiblebutdim = $accessiblebutdim ||
- $mod->availablefrom > time() ||
+ $conditionalhidden = $mod->availablefrom > time() ||
($mod->availableuntil && $mod->availableuntil < time()) ||
count($mod->conditionsgrade) > 0 ||
count($mod->conditionscompletion) > 0;
}
+ $accessiblebutdim = $conditionalhidden || $accessiblebutdim;
}
$liclasses = array();
@@ -1548,8 +1549,12 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$linkclasses = '';
$textclasses = '';
if ($accessiblebutdim) {
- $linkclasses .= ' dimmed conditionalhidden';
- $textclasses .= ' dimmed_text conditionalhidden';
+ $linkclasses .= ' dimmed';
+ $textclasses .= ' dimmed_text';
+ if ($conditionalhidden) {
+ $linkclasses .= ' conditionalhidden';
+ $textclasses .= ' conditionalhidden';
+ }
$accesstext = '<span class="accesshide">'.
get_string('hiddenfromstudents').': </span>';
} else {

0 comments on commit 8626068

Please sign in to comment.