Permalink
Browse files

Merge branch 'wip-mdl-32150-m22' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_22_STABLE
  • Loading branch information...
2 parents ed9cc07 + a99a9a1 commit f65eadd42db932e9eb63dbd2dda8737f954df9b5 Sam Hemelryk committed Apr 2, 2012
Showing with 13 additions and 2 deletions.
  1. +5 −1 lib/form/yui/checkboxcontroller/checkboxcontroller.js
  2. +2 −1 lib/formslib.php
  3. +6 −0 lib/javascript-static.js
@@ -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
@@ -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));
}
}
View
@@ -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;
}
}
@@ -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;
}
}

0 comments on commit f65eadd

Please sign in to comment.