Merge branch 'wip-mdl-36736' of git://github.com/rajeshtaneja/moodle

This commit is contained in:
Dan Poltawski 2012-12-17 12:08:57 +08:00
commit 8ca70aff14
2 changed files with 16 additions and 13 deletions

View File

@ -1694,17 +1694,20 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
if (!$mod->uservisible) {
echo '<div class="availabilityinfo">'.$mod->availableinfo.'</div>';
} else if ($canviewhidden && !empty($CFG->enableavailability)) {
$visibilityclass = '';
if (!$mod->visible) {
$visibilityclass = 'accesshide';
}
$ci = new condition_info($mod);
$fullinfo = $ci->get_full_information();
if($fullinfo) {
echo '<div class="availabilityinfo '.$visibilityclass.'">'.get_string($mod->showavailability
? 'userrestriction_visible'
: 'userrestriction_hidden','condition',
$fullinfo).'</div>';
// Don't add availability information if user is not editing and activity is hidden.
if ($mod->visible || $PAGE->user_is_editing()) {
$hidinfoclass = '';
if (!$mod->visible) {
$hidinfoclass = 'hide';
}
$ci = new condition_info($mod);
$fullinfo = $ci->get_full_information();
if($fullinfo) {
echo '<div class="availabilityinfo '.$hidinfoclass.'">'.get_string($mod->showavailability
? 'userrestriction_visible'
: 'userrestriction_hidden','condition',
$fullinfo).'</div>';
}
}
}

View File

@ -37,7 +37,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
CONDITIONALHIDDEN : 'conditionalhidden',
AVAILABILITYINFODIV : 'div.availabilityinfo',
SHOWCLASS : 'editing_show',
ACCESSHIDECLASS : 'accesshide'
HIDECLASS : 'hide'
};
/**
@ -99,7 +99,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
var availabilityinfo = element.one(CSS.AVAILABILITYINFODIV);
if (availabilityinfo) {
availabilityinfo.toggleClass(CSS.ACCESSHIDECLASS);
availabilityinfo.toggleClass(CSS.HIDECLASS);
}
return value;
},