Personal tools
User Handbook/Admin Panel/Extensions/Event Manager
From CMSMS
(Redirected from User Handbook/Admin Panel/Extensions/Events)
Table of Contents
This page in: English - Deutsch - Español - Français - Italiano - Lietuvių - Nederlands - Norsk - Polski - Русский - Svenska - Tiếng việt
Event Manager
- The Event Manager allows user defined tags or modules to handle events triggered by other modules; i.e. News sends an event when a new article is added, and it is possible to trap that with a UDT (User Defined Tag), or another module without having to modify the news code.
- In brief, here's how it works
- A module, or the core, can register, and then Send Events such as "newNews", or "newFronteEndUser" or "fileUploaded", "editPage", etc, etc, etc. There's some 50 events in the core at the moment, and then uploads and frontend users have been configured to send events. I still have to do selfreg, etc, etc, etc.
- There are pages in the "Admin Console/Extensions" to allow you to specify which modules, and/or user tags should handle those events, and the order that each of those handlers should be called in.
- If one of the handlers of an event is a module, then.... the modules DoEvent method is called with the name of the event, and whatever data it wants to send. Each triggered event needs to be documented, but as of this moment, most are.
- This functionality allows anybody with a bit of php knowledge, and the ability to look through the cms source, etc. to write their own workflows. For example, it should be easy now to write a bridge between frontendusers and any forum software that you want to keep users and groups updated in the forum.
- The search module also uses events, and now because of this mechanism, the content submitted with the uploads module, i.e.: the summary, and the description, are searchable with the search module and a link is provided to the detail report of the file, and then you have the ability to download the file.
- Example
- To get CMS Made Simple to send someone an email when a content page is updated, do the following:
- Create a new user defined tag, and call it something like 'EmailEditor'. Put the following in the contents: mail('my@email.com.au','page updated','the page has been updated'); (replacing my@email.com.au with your email address of course). Save the UDT.
- Go to the Events page, and find the entry labelled "ContentEditPost" and click the edit button for it.
- Select your UDT from the dropdown list (the one you called 'EmailEditor') and click add.
- Thats it. Now whenever someone updates a page you will be sent an email.
- Because the content object also gets passed to the UDT, you should be able to put the actual page contents / title / author / whatever into the email that gets sent.
- You should also probably use the cms mailer function, rather than the built-in php one. This is only a proof of concept. I just did this in CMS Made Simple 1.0.8 and it worked fine.
This page in: English - Deutsch - Español - Français - Italiano - Lietuvių - Nederlands - Norsk - Polski - Русский - Svenska - Tiếng Việt
