Skip to content
Browse files

Merge branch 'MDL-33212-m21' of git://github.com/sammarshallou/moodle…

… into MOODLE_21_STABLE
  • Loading branch information...
2 parents 29010d3 + 805366d commit 382b95d29233be5a28bf5ce2705a920e2a485332 @danpoltawski danpoltawski committed May 28, 2012
Showing with 11 additions and 1 deletion.
  1. +1 −1 course/lib.php
  2. +10 −0 lib/conditionlib.php
View
2 course/lib.php
@@ -1763,7 +1763,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
// see the activity itself, or for staff)
if (!$mod->uservisible) {
echo '<div class="availabilityinfo">'.$mod->availableinfo.'</div>';
- } else if ($canviewhidden && !empty($CFG->enableavailability)) {
+ } else if ($canviewhidden && !empty($CFG->enableavailability) && $mod->visible) {
$ci = new condition_info($mod);
$fullinfo = $ci->get_full_information();
if($fullinfo) {
View
10 lib/conditionlib.php
@@ -486,6 +486,16 @@ public function is_available(&$information, $grabthelot=false, $userid=0, $modin
}
}
+ // If the item is marked as 'not visible' then we don't change the available
+ // flag (visible/available are treated distinctly), but we remove any
+ // availability info. If the item is hidden with the eye icon, it doesn't
+ // make sense to show 'Available from <date>' or similar, because even
+ // when that date arrives it will still not be available unless somebody
+ // toggles the eye icon.
+ if (!$this->cm->visible) {
+ $information = '';
+ }
+
$information=trim($information);
return $available;
}

0 comments on commit 382b95d

Please sign in to comment.
Something went wrong with that request. Please try again.