mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-77991 filelib: Allow groups to generate svgs
This commit is contained in:
parent
a4b3b0d044
commit
9bb91ce870
@ -7,6 +7,16 @@ information provided here is intended especially for developers.
|
||||
- `core_group_get_course_groups`
|
||||
- `core_group_get_course_user_groups`
|
||||
- `core_group_get_activity_allowed_groups`
|
||||
* Groups now have access to create GeoPattern default images based upon their ID with their associated course context.
|
||||
This can be done by calling the following:
|
||||
moodle_url::make_pluginfile_url(
|
||||
$coursecontext->id,
|
||||
'group',
|
||||
'generated',
|
||||
$group->id,
|
||||
'/',
|
||||
'group.svg'
|
||||
);
|
||||
|
||||
=== 4.2 ===
|
||||
* `\core_group\visibility` class added to support new `visibility` field in group records. This holds the visibility constants
|
||||
|
@ -5029,6 +5029,18 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
|
||||
\core\session\manager::write_close(); // Unlock session during file serving.
|
||||
send_stored_file($file, 60*60, 0, false, $sendfileoptions);
|
||||
|
||||
} else if ($filearea === 'generated') {
|
||||
if ($CFG->forcelogin) {
|
||||
require_login($course);
|
||||
} else if ($course->id != SITEID) {
|
||||
require_login($course);
|
||||
}
|
||||
|
||||
$svg = $OUTPUT->get_generated_svg_for_id($group->id);
|
||||
|
||||
\core\session\manager::write_close(); // Unlock session during file serving.
|
||||
send_file($svg, 'group.svg', 60 * 60, 0, true, $forcedownload);
|
||||
|
||||
} else {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user