mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
Merge branch 'wip-MDL-43800-m26' of git://github.com/marinaglancy/moodle into MOODLE_26_STABLE
This commit is contained in:
commit
866bbb05f7
5 changed files with 17 additions and 6 deletions
|
@ -321,6 +321,7 @@ class course_edit_form extends moodleform {
|
|||
$options[$grouping->id] = format_string($grouping->name);
|
||||
}
|
||||
}
|
||||
core_collator::asort($options);
|
||||
$gr_el =& $mform->getElement('defaultgroupingid');
|
||||
$gr_el->load($options);
|
||||
}
|
||||
|
|
|
@ -67,13 +67,14 @@ class editsection_form extends moodleform {
|
|||
// Grouping conditions - only if grouping is enabled at site level
|
||||
if (!empty($CFG->enablegroupmembersonly)) {
|
||||
$options = array();
|
||||
$options[0] = get_string('none');
|
||||
if ($groupings = $DB->get_records('groupings', array('courseid' => $course->id))) {
|
||||
foreach ($groupings as $grouping) {
|
||||
$options[$grouping->id] = format_string(
|
||||
$grouping->name, true, array('context' => $context));
|
||||
}
|
||||
}
|
||||
core_collator::asort($options);
|
||||
$options = array(0 => get_string('none')) + $options;
|
||||
$mform->addElement('select', 'groupingid', get_string('groupingsection', 'group'), $options);
|
||||
$mform->addHelpButton('groupingid', 'groupingsection', 'group');
|
||||
}
|
||||
|
|
|
@ -504,12 +504,13 @@ abstract class moodleform_mod extends moodleform {
|
|||
if ($this->_features->groupings or $this->_features->groupmembersonly) {
|
||||
//groupings selector - used for normal grouping mode or also when restricting access with groupmembersonly
|
||||
$options = array();
|
||||
$options[0] = get_string('none');
|
||||
if ($groupings = $DB->get_records('groupings', array('courseid'=>$COURSE->id))) {
|
||||
foreach ($groupings as $grouping) {
|
||||
$options[$grouping->id] = format_string($grouping->name);
|
||||
}
|
||||
}
|
||||
core_collator::asort($options);
|
||||
$options = array(0 => get_string('none')) + $options;
|
||||
$mform->addElement('select', 'groupingid', get_string('grouping', 'group'), $options);
|
||||
$mform->addHelpButton('groupingid', 'grouping', 'group');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue