I am trying to develop a plugin called prevent-simultaneous-edits to solve the existing problem that content gets lost by edits at the same time.
I read I can use the event module to catch the q_edit event.
So I tried:
function process_event($event, $userid, $handle, $cookieid, $params)
{
if($event == "q_edit") {
$this->output('### test');
}
}
which gives me nothing in frontend. Do I need to use another module, and let them communicate?
Or in other words: The event module will write data to the database (edit time, and user), do I need another module that reads this data and outputs the html?
Who can help me on that?
-- EDIT --
Scenario would be:
1. editor clicks on "edit"
2. event is caught by event module → writes into new table `qa_preventedits`: current-time | postid | userid
3. if 2nd editor wants to edit the same question (within say 15 min), either hide "edit" button from question or if it is still available:
4. 2nd editor clicks on "edit" → edit page is loaded with javascript alert (injected by plugin - module?): "This question is being edited by *username* right now. Please wait 15 minutes and try again." (and redirect to question).
That's it.