Which actions to add to mdl_log_display?

Which actions to add to mdl_log_display?

by Jan Dierckx -
Number of replies: 3

I am updating the multiple search block to enable it's use in the resource module and the book module. That part is nearly finished. Now I would like the block to log what people have searched for on our school site. I thought about adding a command like this...

add_to_log($course->id, "block_multiple_search", "search",
 "search.php?id=$course->id&search=".urlencode($search),  
 $search);

... but I don't get what the table mdl_log_display is used for. I know that every module adds some values in there when the module is installed, but I don't see it being used in the add_to_log function.

How does it work?

Average of ratings: -
In reply to Jan Dierckx

Re: Which actions to add to mdl_log_display?

by Gustav W Delius -
Ah, yes, a page in the Developer Documentation about how to use logs would help me a lot as well. I figured it out a long time ago but have of course forgotten since.
In reply to Jan Dierckx

Re: Which actions to add to mdl_log_display?

by Penny Leach -
log display helps to resolve the info field to something for a SELECT...

So for example, sometimes you put the userid into the 'info' field of log.. logdisplay tells you for the combination of module and action, in order to turn the info field into something meaningful, mtable is 'user' (the table to select on), and the field to select is firstname||' '||lastname.

Because info is a general field that just gets random stuff put into it, for a module/action combination, moodle needs to know how to turn the info field into something useful.

I hope that's vaguely helpful, it's monday morning and I have only had 2 coffees sleepy
In reply to Penny Leach

Re: Which actions to add to mdl_log_display?

by Samuli Karevaara -
"...it's monday morning and I have only had 2 coffees"

You just need to upgrade you mug! smile