MDL-40922 mod_folder: replaced the 'edit' add_to_log call with an event

This commit is contained in:
Mark Nelson
2013-12-31 15:14:57 -08:00
parent 6f3e33c947
commit 81ec45ea11
4 changed files with 157 additions and 1 deletions
+10 -1
View File
@@ -63,7 +63,16 @@ if ($mform->is_cancelled()) {
$formdata = file_postupdate_standard_filemanager($formdata, 'files', $options, $context, 'mod_folder', 'content', 0);
$DB->set_field('folder', 'revision', $folder->revision+1, array('id'=>$folder->id));
add_to_log($course->id, 'folder', 'edit', 'edit.php?id='.$cm->id, $folder->id, $cm->id);
// Update the variable of the folder revision so we can pass it as an accurate snapshot later.
$folder->revision = $folder->revision + 1;
$params = array(
'context' => $context,
'objectid' => $folder->id
);
$event = \mod_folder\event\folder_updated::create($params);
$event->add_record_snapshot('folder', $folder);
$event->trigger();
redirect($redirecturl);
}