mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'wip-mdl-36131' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
558aecf818
@ -1474,8 +1474,8 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
$linkclasses = '';
|
||||
$textclasses = '';
|
||||
if ($accessiblebutdim) {
|
||||
$linkclasses .= ' dimmed';
|
||||
$textclasses .= ' dimmed_text';
|
||||
$linkclasses .= ' dimmed conditionalhidden';
|
||||
$textclasses .= ' dimmed_text conditionalhidden';
|
||||
$accesstext = '<span class="accesshide">'.
|
||||
get_string('hiddenfromstudents').': </span>';
|
||||
} else {
|
||||
@ -1657,11 +1657,15 @@ 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) && $mod->visible) {
|
||||
} 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">'.get_string($mod->showavailability
|
||||
echo '<div class="availabilityinfo '.$visibilityclass.'">'.get_string($mod->showavailability
|
||||
? 'userrestriction_visible'
|
||||
: 'userrestriction_hidden','condition',
|
||||
$fullinfo).'</div>';
|
||||
|
27
course/yui/toolboxes/toolboxes.js
vendored
27
course/yui/toolboxes/toolboxes.js
vendored
@ -33,7 +33,11 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
SECTIONIDPREFIX : 'section-',
|
||||
SECTIONLI : 'li.section',
|
||||
SHOW : 'a.editing_show',
|
||||
SHOWHIDE : 'a.editing_showhide'
|
||||
SHOWHIDE : 'a.editing_showhide',
|
||||
CONDITIONALHIDDEN : 'conditionalhidden',
|
||||
AVAILABILITYINFODIV : 'div.availabilityinfo',
|
||||
SHOWCLASS : 'editing_show',
|
||||
ACCESSHIDECLASS : 'accesshide'
|
||||
};
|
||||
|
||||
/**
|
||||
@ -68,18 +72,14 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
|
||||
var status = '';
|
||||
var value;
|
||||
if (dimarea.hasClass(toggle_class)) {
|
||||
if (button.hasClass(CSS.SHOWCLASS)) {
|
||||
status = 'hide';
|
||||
value = 1;
|
||||
} else {
|
||||
status = 'show';
|
||||
value = 0;
|
||||
}
|
||||
|
||||
// Change the UI
|
||||
dimarea.toggleClass(toggle_class);
|
||||
// We need to toggle dimming on the description too
|
||||
element.all(CSS.CONTENTAFTERLINK).toggleClass(CSS.DIMMEDTEXT);
|
||||
// Update button info.
|
||||
var newstring = M.util.get_string(status, 'moodle');
|
||||
hideicon.setAttrs({
|
||||
'alt' : newstring,
|
||||
@ -88,6 +88,19 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
||||
button.set('title', newstring);
|
||||
button.set('className', 'editing_'+status);
|
||||
|
||||
// If activity is conditionally hidden, then don't toggle.
|
||||
if (!dimarea.hasClass(CSS.CONDITIONALHIDDEN)) {
|
||||
// Change the UI.
|
||||
dimarea.toggleClass(toggle_class);
|
||||
// We need to toggle dimming on the description too.
|
||||
element.all(CSS.CONTENTAFTERLINK).toggleClass(CSS.DIMMEDTEXT);
|
||||
}
|
||||
// Toggle availablity info for conditional activities.
|
||||
var availabilityinfo = element.one(CSS.AVAILABILITYINFODIV);
|
||||
|
||||
if (availabilityinfo) {
|
||||
availabilityinfo.toggleClass(CSS.ACCESSHIDECLASS);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user