Author Topic: new Hooks  (Read 5768 times)

Offline unicorn

  • Jr. Member
  • **
  • Posts: 15
new Hooks
« on: January 13, 2011, 06:16:31 AM »
Hello,

could you add new hooks to SVN ... message_moved & message_deleted?

Something like this...
$args = array(
'uids' => $uids,
'mbox' => $mbox,
'target' => $target,
'new_uids' => $new_uids // is this possible?
);
...
$RCMAIL->plugins->exec_hook('message_moved', $args);
...
$RCMAIL->plugins->exec_hook('message_moved', $args)

We need it for our plugins to further simply upgrade of RC without our patches.

Thanks a lot.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,888
    • SKaero - Custom Roundcube development
new Hooks
« Reply #1 on: January 13, 2011, 02:21:29 PM »
You could do that using the javascript hooks before* and after*

Offline unicorn

  • Jr. Member
  • **
  • Posts: 15
new Hooks
« Reply #2 on: January 14, 2011, 01:50:31 PM »
thank you skaero for your replay.

I don't exactly understand how after* and before* works, can you explain me on the example how it works?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,888
    • SKaero - Custom Roundcube development
new Hooks
« Reply #3 on: January 15, 2011, 05:24:51 AM »
Here is an example using the after* hook. In this case after a user deletes a message it should open an alert that says "Message deleted!".
Code: [Select]
if (window.rcmail) {
rcmail.addEventListener("afterdelete", function(evt) {
alert("Message deleted!");
});
}