From 7ddb347cec1bc388f0fe7ef0cd4670bdc2a2037a Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Sun, 9 Feb 2014 14:48:29 -0800 Subject: [PATCH] MDL-40061 mod_data: replaced 'view all' add_to_log call with an event --- .../course_module_instance_list_viewed.php | 32 +++++++++++++++++++ mod/data/index.php | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 mod/data/classes/event/course_module_instance_list_viewed.php diff --git a/mod/data/classes/event/course_module_instance_list_viewed.php b/mod/data/classes/event/course_module_instance_list_viewed.php new file mode 100644 index 00000000000..7e19721fc4a --- /dev/null +++ b/mod/data/classes/event/course_module_instance_list_viewed.php @@ -0,0 +1,32 @@ +. + +/** + * The mod_data course module instance list viewed event. + * + * @package mod_data + * @copyright 2014 Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace mod_data\event; + +defined('MOODLE_INTERNAL') || die(); + +class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed { + // No code required here as the parent class handles it all. +} + diff --git a/mod/data/index.php b/mod/data/index.php index de7c74bb1af..8620a3476f3 100644 --- a/mod/data/index.php +++ b/mod/data/index.php @@ -39,7 +39,11 @@ $PAGE->set_pagelayout('incourse'); $context = context_course::instance($course->id); -add_to_log($course->id, "data", "view all", "index.php?id=$course->id", ""); +$params = array( + 'context' => context_course::instance($course->id) +); +$event = \mod_data\event\course_module_instance_list_viewed::create($params); +$event->trigger(); $strname = get_string('name'); $strdata = get_string('modulename','data');