Merge branch 'wip-MDL-27145-master' of git://github.com/samhemelryk/moodle

This commit is contained in:
Petr Skoda 2011-04-17 16:11:49 +02:00
commit bdc782470b

View File

@ -166,7 +166,9 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group
}
break;
case 'createElement':
if($arg[2]['optional']) {
// Optional is an optional param, if its set we need to add a disabledIf rule.
// If its empty or not specified then its not an optional dateselector.
if (!empty($arg[2]['optional']) && !empty($arg[0])) {
$caller->disabledIf($arg[0], $arg[0].'[enabled]');
}
return parent::onQuickFormEvent($event, $arg, $caller);