Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-36707 Course: set conditionalhidden class properly, so it doesn't…

… overlap with dimmed class
  • Loading branch information...
commit 6402047395b7d33028795fdcbfd69f45cc8a836a 1 parent 2d7c5ee
@rajeshtaneja rajeshtaneja authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 course/lib.php
View
13 course/lib.php
@@ -1427,15 +1427,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();
@@ -1491,8 +1492,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 {
Please sign in to comment.
Something went wrong with that request. Please try again.