mirror of
https://github.com/moodle/moodle.git
synced 2025-03-11 19:29:51 +01:00
MDL-78026 group: format retrieved group names from external methods.
This commit is contained in:
parent
017a3274fe
commit
7a23da59ce
@ -187,7 +187,8 @@ class core_group_external extends external_api {
|
|||||||
}
|
}
|
||||||
require_capability('moodle/course:managegroups', $context);
|
require_capability('moodle/course:managegroups', $context);
|
||||||
|
|
||||||
list($group->description, $group->descriptionformat) =
|
$group->name = external_format_string($group->name, $context);
|
||||||
|
[$group->description, $group->descriptionformat] =
|
||||||
external_format_text($group->description, $group->descriptionformat,
|
external_format_text($group->description, $group->descriptionformat,
|
||||||
$context->id, 'group', 'description', $group->id);
|
$context->id, 'group', 'description', $group->id);
|
||||||
|
|
||||||
@ -209,7 +210,7 @@ class core_group_external extends external_api {
|
|||||||
array(
|
array(
|
||||||
'id' => new external_value(PARAM_INT, 'group record id'),
|
'id' => new external_value(PARAM_INT, 'group record id'),
|
||||||
'courseid' => new external_value(PARAM_INT, 'id of course'),
|
'courseid' => new external_value(PARAM_INT, 'id of course'),
|
||||||
'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
|
'name' => new external_value(PARAM_TEXT, 'group name'),
|
||||||
'description' => new external_value(PARAM_RAW, 'group description text'),
|
'description' => new external_value(PARAM_RAW, 'group description text'),
|
||||||
'descriptionformat' => new external_format_value('description'),
|
'descriptionformat' => new external_format_value('description'),
|
||||||
'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
|
'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
|
||||||
@ -260,7 +261,8 @@ class core_group_external extends external_api {
|
|||||||
|
|
||||||
$groups = array();
|
$groups = array();
|
||||||
foreach ($gs as $group) {
|
foreach ($gs as $group) {
|
||||||
list($group->description, $group->descriptionformat) =
|
$group->name = external_format_string($group->name, $context);
|
||||||
|
[$group->description, $group->descriptionformat] =
|
||||||
external_format_text($group->description, $group->descriptionformat,
|
external_format_text($group->description, $group->descriptionformat,
|
||||||
$context->id, 'group', 'description', $group->id);
|
$context->id, 'group', 'description', $group->id);
|
||||||
$groups[] = (array)$group;
|
$groups[] = (array)$group;
|
||||||
@ -281,7 +283,7 @@ class core_group_external extends external_api {
|
|||||||
array(
|
array(
|
||||||
'id' => new external_value(PARAM_INT, 'group record id'),
|
'id' => new external_value(PARAM_INT, 'group record id'),
|
||||||
'courseid' => new external_value(PARAM_INT, 'id of course'),
|
'courseid' => new external_value(PARAM_INT, 'id of course'),
|
||||||
'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
|
'name' => new external_value(PARAM_TEXT, 'group name'),
|
||||||
'description' => new external_value(PARAM_RAW, 'group description text'),
|
'description' => new external_value(PARAM_RAW, 'group description text'),
|
||||||
'descriptionformat' => new external_format_value('description'),
|
'descriptionformat' => new external_format_value('description'),
|
||||||
'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
|
'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
|
||||||
@ -1264,7 +1266,8 @@ class core_group_external extends external_api {
|
|||||||
'g.id, g.name, g.description, g.descriptionformat, g.idnumber');
|
'g.id, g.name, g.description, g.descriptionformat, g.idnumber');
|
||||||
|
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
list($group->description, $group->descriptionformat) =
|
$group->name = external_format_string($group->name, $course->context);
|
||||||
|
[$group->description, $group->descriptionformat] =
|
||||||
external_format_text($group->description, $group->descriptionformat,
|
external_format_text($group->description, $group->descriptionformat,
|
||||||
$course->context->id, 'group', 'description', $group->id);
|
$course->context->id, 'group', 'description', $group->id);
|
||||||
$group->courseid = $course->id;
|
$group->courseid = $course->id;
|
||||||
@ -1303,7 +1306,7 @@ class core_group_external extends external_api {
|
|||||||
return new external_single_structure(
|
return new external_single_structure(
|
||||||
array(
|
array(
|
||||||
'id' => new external_value(PARAM_INT, 'group record id'),
|
'id' => new external_value(PARAM_INT, 'group record id'),
|
||||||
'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
|
'name' => new external_value(PARAM_TEXT, 'group name'),
|
||||||
'description' => new external_value(PARAM_RAW, 'group description text'),
|
'description' => new external_value(PARAM_RAW, 'group description text'),
|
||||||
'descriptionformat' => new external_format_value('description'),
|
'descriptionformat' => new external_format_value('description'),
|
||||||
'idnumber' => new external_value(PARAM_RAW, 'id number'),
|
'idnumber' => new external_value(PARAM_RAW, 'id number'),
|
||||||
@ -1388,7 +1391,8 @@ class core_group_external extends external_api {
|
|||||||
$groups = groups_get_activity_allowed_groups($cm, $user->id);
|
$groups = groups_get_activity_allowed_groups($cm, $user->id);
|
||||||
|
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
list($group->description, $group->descriptionformat) =
|
$group->name = external_format_string($group->name, $coursecontext);
|
||||||
|
[$group->description, $group->descriptionformat] =
|
||||||
external_format_text($group->description, $group->descriptionformat,
|
external_format_text($group->description, $group->descriptionformat,
|
||||||
$coursecontext->id, 'group', 'description', $group->id);
|
$coursecontext->id, 'group', 'description', $group->id);
|
||||||
$group->courseid = $cm->course;
|
$group->courseid = $cm->course;
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
This files describes API changes in /group/*,
|
This files describes API changes in /group/*,
|
||||||
information provided here is intended especially for developers.
|
information provided here is intended especially for developers.
|
||||||
|
|
||||||
|
=== 4.1.4 ===
|
||||||
|
* The following external methods now return group names correctly formatted:
|
||||||
|
- `core_group_get_groups`
|
||||||
|
- `core_group_get_course_groups`
|
||||||
|
- `core_group_get_course_user_groups`
|
||||||
|
- `core_group_get_activity_allowed_groups`
|
||||||
|
|
||||||
=== 3.11 ===
|
=== 3.11 ===
|
||||||
|
|
||||||
* The groups do not support 'hidepicture' any more, and so the column 'hidepicture'
|
* The groups do not support 'hidepicture' any more, and so the column 'hidepicture'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user