Commit caa06f4b authored by Frederic Massart's avatar Frederic Massart
Browse files

MDL-39954 mod_assign: add_to_log can return an array of parameters

parent e185f72d
......@@ -2403,9 +2403,11 @@ class assign {
* @param string $action The current action
* @param string $info A detailed description of the change. But no more than 255 characters.
* @param string $url The url to the assign module instance.
* @return void
* @param bool $return If true, returns the arguments, else adds to log. The purpose of this is to
* retrieve the arguments to use them with the new event system (Event 2).
* @return void|array
*/
public function add_to_log($action = '', $info = '', $url='') {
public function add_to_log($action = '', $info = '', $url='', $return = false) {
global $USER;
$fullurl = 'view.php?id=' . $this->get_course_module()->id;
......@@ -2413,13 +2415,20 @@ class assign {
$fullurl .= '&' . $url;
}
add_to_log($this->get_course()->id,
'assign',
$action,
$fullurl,
$info,
$this->get_course_module()->id,
$USER->id);
$args = array(
$this->get_course()->id,
'assign',
$action,
$fullurl,
$info,
$this->get_course_module()->id,
$USER->id
);
if ($return) {
return $args;
}
call_user_func_array('add_to_log', $args);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment