mirror of
https://github.com/moodle/moodle.git
synced 2025-04-12 20:12:15 +02:00
Merge branch 'wip-MDL-43800-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
commit
9be395ee99
@ -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');
|
||||
}
|
||||
|
@ -68,9 +68,13 @@ echo $OUTPUT->heading($strgroupings);
|
||||
$data = array();
|
||||
if ($groupings = $DB->get_records('groupings', array('courseid'=>$course->id), 'name')) {
|
||||
$canchangeidnumber = has_capability('moodle/course:changeidnumber', $context);
|
||||
foreach ($groupings as $gid => $grouping) {
|
||||
$groupings[$gid]->formattedname = format_string($grouping->name, true, array('context' => $context));
|
||||
}
|
||||
core_collator::asort_objects_by_property($groupings, 'formattedname');
|
||||
foreach($groupings as $grouping) {
|
||||
$line = array();
|
||||
$line[0] = format_string($grouping->name);
|
||||
$line[0] = $grouping->formattedname;
|
||||
|
||||
if ($groups = groups_get_all_groups($courseid, 0, $grouping->id)) {
|
||||
$groupnames = array();
|
||||
|
@ -62,8 +62,12 @@ $strfiltergroups = get_string('filtergroups', 'group');
|
||||
$strnogroups = get_string('nogroups', 'group');
|
||||
$strdescription = get_string('description');
|
||||
|
||||
// Get all groupings
|
||||
// Get all groupings and sort them by formatted name.
|
||||
$groupings = $DB->get_records('groupings', array('courseid'=>$courseid), 'name');
|
||||
foreach ($groupings as $gid => $grouping) {
|
||||
$groupings[$gid]->formattedname = format_string($grouping->name, true, array('context' => $context));
|
||||
}
|
||||
core_collator::asort_objects_by_property($groupings, 'formattedname');
|
||||
$members = array();
|
||||
foreach ($groupings as $grouping) {
|
||||
$members[$grouping->id] = array();
|
||||
@ -136,7 +140,7 @@ echo $strfiltergroups;
|
||||
$options = array();
|
||||
$options[0] = get_string('all');
|
||||
foreach ($groupings as $grouping) {
|
||||
$options[$grouping->id] = strip_tags(format_string($grouping->name));
|
||||
$options[$grouping->id] = strip_tags($grouping->formattedname);
|
||||
}
|
||||
$popupurl = new moodle_url($rooturl.'&group='.$groupid);
|
||||
$select = new single_select($popupurl, 'grouping', $options, $groupingid, array());
|
||||
@ -199,7 +203,7 @@ foreach ($members as $gpgid=>$groupdata) {
|
||||
if ($gpgid < 0) {
|
||||
echo $OUTPUT->heading($strnotingrouping, 3);
|
||||
} else {
|
||||
echo $OUTPUT->heading(format_string($groupings[$gpgid]->name), 3);
|
||||
echo $OUTPUT->heading($groupings[$gpgid]->formattedname, 3);
|
||||
$description = file_rewrite_pluginfile_urls($groupings[$gpgid]->description, 'pluginfile.php', $context->id, 'grouping', 'description', $gpgid);
|
||||
$options = new stdClass;
|
||||
$options->noclean = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user