mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Each mod is responsible to deleting its own blocks; what I had in mind for
centralizing this wouldn't work out. Use the flexible page_import_types so that we don't create one more dependency when writing new code.
This commit is contained in:
parent
b5e9682173
commit
880d86758b
@ -123,6 +123,13 @@ function chat_delete_instance($id) {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
$pagetypes = page_import_types('mod/chat/');
|
||||
foreach($pagetypes as $pagetype) {
|
||||
if(!delete_records('block_instance', 'pageid', $chat->id, 'pagetype', $pagetype)) {
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (! delete_records('event', 'modulename', 'chat', 'instance', $chat->id)) {
|
||||
$result = false;
|
||||
}
|
||||
|
@ -170,6 +170,13 @@ function quiz_delete_instance($id) {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
$pagetypes = page_import_types('mod/quiz/');
|
||||
foreach($pagetypes as $pagetype) {
|
||||
if(!delete_records('block_instance', 'pageid', $quiz->id, 'pagetype', $pagetype)) {
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($events = get_records_select('event', "modulename = 'quiz' and instance = '$quiz->id'")) {
|
||||
foreach($events as $event) {
|
||||
delete_event($event->id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user