Loading...
 
Skip to main content

Features / Usability


Event notifications - how?

posts: 13

Apologies if this is the wrong forum for this question, but I couldn't find a more obvious one. And I'm fairly new to Tiki (although I am an experienced programmer and designer - 35+ years!)

I'm trying to integrate TikiWiki (version 9.1) with some other web applications, and I've seen the hints in the documentation of "event notification", such as tiki.user.save. Looking through the code, I've found places where these notifications would be raised (for example in userslib.php there are calls to TikiLib::events()->trigger.

Which is all great. But my problem is how do I register my own callback routine that will be invoked when the event is triggered? Trawling the web and searching the Tiki documentation has revealed nothing other than the picture of the events that can be raised - which just whets my appetite, but doen't give me the answers - frustrating to say the least!!

Any help and information will be much appreciated.

Many thanks

Kevin Ayton

posts: 35 Canada

Hello Kevin,

Events are a relatively new concept in Tiki and have not been deployed a whole lot. You might run into cases where they do not exist for what you need, but feel free to trigger more. Just get commit access.

The bindings are set-up in lib/setup/events.php at this time. You can find quite a few examples in there. They are essentially just callback functions.

There is no defined way to attach custom handlers for your specific installation, but I guess you could quite easily add a block you would maintain, or include a file you create so that it is easier to maintain.

As always, contributions are welcome.

posts: 13

Thanks for the rapid response and the useful pointer.

I'm away for a couple of days now, but I'll follow it up when I get back.

Kevin