mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-29450 improve and cleanup course content removal
New keep roles/enrolments and groups/groupings options, notification CSS fixed, standardised notification texts, added missing delete of module blocks, fixed file deleting and some other minor issues.
This commit is contained in:
parent
79b0fece1f
commit
16ef46e7b6
5 changed files with 207 additions and 126 deletions
|
@ -414,8 +414,8 @@ function coursetag_get_tagged_courses($tagid) {
|
|||
* Course tagging function used only during the deletion of a
|
||||
* course (called by lib/moodlelib.php) to clean up associated tags
|
||||
*
|
||||
* @param $courseid
|
||||
* @param $showfeedback
|
||||
* @param int $courseid
|
||||
* @param bool $showfeedback
|
||||
*/
|
||||
function coursetag_delete_course_tags($courseid, $showfeedback=false) {
|
||||
|
||||
|
@ -428,12 +428,15 @@ function coursetag_delete_course_tags($courseid, $showfeedback=false) {
|
|||
// delete tag if there are no other tag_instance entries now
|
||||
if (!($DB->record_exists('tag_instance', array('tagid'=>$tag->tagid)))) {
|
||||
$DB->delete_records('tag', array('id'=>$tag->tagid));
|
||||
// Delete files
|
||||
$fs = get_file_storage();
|
||||
$fs->delete_area_files(get_system_context()->id, 'tag', 'description', $tag->tagid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($showfeedback) {
|
||||
echo $OUTPUT->notification(get_string('deletedcoursetags', 'tag'));
|
||||
echo $OUTPUT->notification(get_string('deletedcoursetags', 'tag'), 'notifysuccess');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue