mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +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);
|
$options[$grouping->id] = format_string($grouping->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
core_collator::asort($options);
|
||||||
$gr_el =& $mform->getElement('defaultgroupingid');
|
$gr_el =& $mform->getElement('defaultgroupingid');
|
||||||
$gr_el->load($options);
|
$gr_el->load($options);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,13 +67,14 @@ class editsection_form extends moodleform {
|
||||||
// Grouping conditions - only if grouping is enabled at site level
|
// Grouping conditions - only if grouping is enabled at site level
|
||||||
if (!empty($CFG->enablegroupmembersonly)) {
|
if (!empty($CFG->enablegroupmembersonly)) {
|
||||||
$options = array();
|
$options = array();
|
||||||
$options[0] = get_string('none');
|
|
||||||
if ($groupings = $DB->get_records('groupings', array('courseid' => $course->id))) {
|
if ($groupings = $DB->get_records('groupings', array('courseid' => $course->id))) {
|
||||||
foreach ($groupings as $grouping) {
|
foreach ($groupings as $grouping) {
|
||||||
$options[$grouping->id] = format_string(
|
$options[$grouping->id] = format_string(
|
||||||
$grouping->name, true, array('context' => $context));
|
$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->addElement('select', 'groupingid', get_string('groupingsection', 'group'), $options);
|
||||||
$mform->addHelpButton('groupingid', 'groupingsection', 'group');
|
$mform->addHelpButton('groupingid', 'groupingsection', 'group');
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,12 +504,13 @@ abstract class moodleform_mod extends moodleform {
|
||||||
if ($this->_features->groupings or $this->_features->groupmembersonly) {
|
if ($this->_features->groupings or $this->_features->groupmembersonly) {
|
||||||
//groupings selector - used for normal grouping mode or also when restricting access with groupmembersonly
|
//groupings selector - used for normal grouping mode or also when restricting access with groupmembersonly
|
||||||
$options = array();
|
$options = array();
|
||||||
$options[0] = get_string('none');
|
|
||||||
if ($groupings = $DB->get_records('groupings', array('courseid'=>$COURSE->id))) {
|
if ($groupings = $DB->get_records('groupings', array('courseid'=>$COURSE->id))) {
|
||||||
foreach ($groupings as $grouping) {
|
foreach ($groupings as $grouping) {
|
||||||
$options[$grouping->id] = format_string($grouping->name);
|
$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->addElement('select', 'groupingid', get_string('grouping', 'group'), $options);
|
||||||
$mform->addHelpButton('groupingid', 'grouping', 'group');
|
$mform->addHelpButton('groupingid', 'grouping', 'group');
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,9 +68,13 @@ echo $OUTPUT->heading($strgroupings);
|
||||||
$data = array();
|
$data = array();
|
||||||
if ($groupings = $DB->get_records('groupings', array('courseid'=>$course->id), 'name')) {
|
if ($groupings = $DB->get_records('groupings', array('courseid'=>$course->id), 'name')) {
|
||||||
$canchangeidnumber = has_capability('moodle/course:changeidnumber', $context);
|
$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) {
|
foreach($groupings as $grouping) {
|
||||||
$line = array();
|
$line = array();
|
||||||
$line[0] = format_string($grouping->name);
|
$line[0] = $grouping->formattedname;
|
||||||
|
|
||||||
if ($groups = groups_get_all_groups($courseid, 0, $grouping->id)) {
|
if ($groups = groups_get_all_groups($courseid, 0, $grouping->id)) {
|
||||||
$groupnames = array();
|
$groupnames = array();
|
||||||
|
|
|
@ -62,8 +62,12 @@ $strfiltergroups = get_string('filtergroups', 'group');
|
||||||
$strnogroups = get_string('nogroups', 'group');
|
$strnogroups = get_string('nogroups', 'group');
|
||||||
$strdescription = get_string('description');
|
$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');
|
$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();
|
$members = array();
|
||||||
foreach ($groupings as $grouping) {
|
foreach ($groupings as $grouping) {
|
||||||
$members[$grouping->id] = array();
|
$members[$grouping->id] = array();
|
||||||
|
@ -136,7 +140,7 @@ echo $strfiltergroups;
|
||||||
$options = array();
|
$options = array();
|
||||||
$options[0] = get_string('all');
|
$options[0] = get_string('all');
|
||||||
foreach ($groupings as $grouping) {
|
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);
|
$popupurl = new moodle_url($rooturl.'&group='.$groupid);
|
||||||
$select = new single_select($popupurl, 'grouping', $options, $groupingid, array());
|
$select = new single_select($popupurl, 'grouping', $options, $groupingid, array());
|
||||||
|
@ -199,7 +203,7 @@ foreach ($members as $gpgid=>$groupdata) {
|
||||||
if ($gpgid < 0) {
|
if ($gpgid < 0) {
|
||||||
echo $OUTPUT->heading($strnotingrouping, 3);
|
echo $OUTPUT->heading($strnotingrouping, 3);
|
||||||
} else {
|
} 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);
|
$description = file_rewrite_pluginfile_urls($groupings[$gpgid]->description, 'pluginfile.php', $context->id, 'grouping', 'description', $gpgid);
|
||||||
$options = new stdClass;
|
$options = new stdClass;
|
||||||
$options->noclean = true;
|
$options->noclean = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue