mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
Merge branch 'MDL-35637_m23' of git://github.com/markn86/moodle into MOODLE_23_STABLE
This commit is contained in:
commit
aa63be7f5f
1 changed files with 11 additions and 10 deletions
|
@ -239,17 +239,18 @@ function groups_update_group_icon($group, $data, $editform) {
|
||||||
$context = get_context_instance(CONTEXT_COURSE, $group->courseid, MUST_EXIST);
|
$context = get_context_instance(CONTEXT_COURSE, $group->courseid, MUST_EXIST);
|
||||||
|
|
||||||
//TODO: it would make sense to allow picture deleting too (skodak)
|
//TODO: it would make sense to allow picture deleting too (skodak)
|
||||||
|
if (!empty($CFG->gdversion)) {
|
||||||
if ($iconfile = $editform->save_temp_file('imagefile')) {
|
if ($iconfile = $editform->save_temp_file('imagefile')) {
|
||||||
if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
|
if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
|
||||||
$DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
|
$DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
|
||||||
$group->picture = 1;
|
$group->picture = 1;
|
||||||
} else {
|
} else {
|
||||||
$fs->delete_area_files($context->id, 'group', 'icon', $group->id);
|
$fs->delete_area_files($context->id, 'group', 'icon', $group->id);
|
||||||
$DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
|
$DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
|
||||||
$group->picture = 0;
|
$group->picture = 0;
|
||||||
|
}
|
||||||
|
@unlink($iconfile);
|
||||||
}
|
}
|
||||||
@unlink($iconfile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue