mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-30764 Activity settings: do not disable grouping dropdown if it is already set
This commit is contained in:
parent
acb3bf8ac1
commit
782b21dc0f
1 changed files with 13 additions and 8 deletions
|
@ -173,16 +173,21 @@ abstract class moodleform_mod extends moodleform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly') and empty($COURSE->groupmodeforce)) {
|
// Don't disable/remove groupingid if it is currently set to something,
|
||||||
$mform->disabledIf('groupingid', 'groupmode', 'eq', NOGROUPS);
|
// otherwise you cannot turn it off at same time as turning off other
|
||||||
|
// option (MDL-30764)
|
||||||
|
if (empty($this->_cm) || !$this->_cm->groupingid) {
|
||||||
|
if ($mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly') and empty($COURSE->groupmodeforce)) {
|
||||||
|
$mform->disabledIf('groupingid', 'groupmode', 'eq', NOGROUPS);
|
||||||
|
|
||||||
} else if (!$mform->elementExists('groupmode') and $mform->elementExists('groupmembersonly')) {
|
} else if (!$mform->elementExists('groupmode') and $mform->elementExists('groupmembersonly')) {
|
||||||
$mform->disabledIf('groupingid', 'groupmembersonly', 'notchecked');
|
$mform->disabledIf('groupingid', 'groupmembersonly', 'notchecked');
|
||||||
|
|
||||||
} else if (!$mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly')) {
|
} else if (!$mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly')) {
|
||||||
// groupings have no use without groupmode or groupmembersonly
|
// groupings have no use without groupmode or groupmembersonly
|
||||||
if ($mform->elementExists('groupingid')) {
|
if ($mform->elementExists('groupingid')) {
|
||||||
$mform->removeElement('groupingid');
|
$mform->removeElement('groupingid');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue