Skip to content

Commit

Permalink
Merge branch 'wip-mdl-32150-m22' of git://github.com/rajeshtaneja/moo…
Browse files Browse the repository at this point in the history
…dle into MOODLE_22_STABLE
  • Loading branch information
Sam Hemelryk committed Apr 2, 2012
2 parents ed9cc07 + a99a9a1 commit f65eadd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/form/yui/checkboxcontroller/checkboxcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
}
});
Expand Down
3 changes: 2 additions & 1 deletion lib/formslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,8 @@ function add_checkbox_controller($groupid, $text = null, $attributes = null, $or
if (!is_null($contollerbutton) || is_null($select_value)) {
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() => $new_select_value));
}
}
Expand Down
6 changes: 6 additions & 0 deletions lib/javascript-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,9 @@ function checkall() {
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'checkbox') {
if (inputs[i].disabled || inputs[i].readOnly) {
continue;
}
inputs[i].checked = true;
}
}
Expand All @@ -805,6 +808,9 @@ function checknone() {
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'checkbox') {
if (inputs[i].disabled || inputs[i].readOnly) {
continue;
}
inputs[i].checked = false;
}
}
Expand Down

0 comments on commit f65eadd

Please sign in to comment.