MDL-32150 Libraries: checkbox controller will not check or uncheck freezed checkboxes

This commit is contained in:
Rajesh Taneja 2012-03-22 10:28:39 +08:00
parent af8def57f6
commit 91f7f8c1c1
2 changed files with 7 additions and 2 deletions

View File

@ -100,7 +100,11 @@ YUI.add('moodle-form-checkboxcontroller', function(Y) {
controllervaluenode.set('value', '1');
newvalue = 'checked';
}
checkboxes.set('checked', newvalue);
checkboxes.each(function(checkbox){
if (!checkbox.get('disabled')) {
checkbox.set('checked', newvalue);
}
});
}
}
});

View File

@ -1086,7 +1086,8 @@ abstract class moodleform {
if (!is_null($contollerbutton) || is_null($selectvalue)) {
foreach ($mform->_elements as $element) {
if (($element instanceof MoodleQuickForm_advcheckbox) &&
$element->getAttribute('class') == $checkboxgroupclass) {
$element->getAttribute('class') == $checkboxgroupclass &&
!$element->isFrozen()) {
$mform->setConstants(array($element->getName() => $newselectvalue));
}
}