Permalink
Browse files

MDL-32150 Libraries: checkbox controller will not check or uncheck fr…

…eezed checkboxes
  • Loading branch information...
1 parent af8def5 commit 91f7f8c1c10da003744f12383b54ebcf39d2206e Rajesh Taneja committed Mar 22, 2012
Showing with 7 additions and 2 deletions.
  1. +5 −1 lib/form/yui/checkboxcontroller/checkboxcontroller.js
  2. +2 −1 lib/formslib.php
@@ -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
@@ -1086,7 +1086,8 @@ function add_checkbox_controller($groupid, $text = null, $attributes = null, $or
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));
}
}

0 comments on commit 91f7f8c

Please sign in to comment.