Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: Aodhan on July 12, 2010, 01:20:55 PM

Title: Quick Question from an amateur
Post by: Aodhan on July 12, 2010, 01:20:55 PM
How would I display a message in the same place all the confirmation messages come up from a plugin ?

So lets say for example I wanted a message to come up saying 'Well Done!' after the 'Message Sent Successfully' Message.

I guess I'd use the 'message_sent' hook ? but how to display the message ?
Title: Quick Question from an amateur
Post by: SKaero on July 13, 2010, 10:12:33 AM
Code: [Select]

rcmail.display_message('Well Done!', 'confirmation');
Title: Quick Question from an amateur
Post by: qnrq on July 13, 2010, 11:49:22 AM
What skaero posted above is Javascript, if you want to hook it in message_sent then you can include the script like this:

$this->include_script ('welldone.js');
Title: Quick Question from an amateur
Post by: Aodhan on July 13, 2010, 08:06:28 PM
Thanks for the replys...

I'll try that out now.
Title: Quick Question from an amateur
Post by: corbosman on July 14, 2010, 04:16:51 AM
There is a much easier method.. from PHP you can just say:

Code: [Select]

$rcmail = rcmail::get_instance();
$rcmail->output->show_message('my_plugin.my_label', 'confirmation');


Where my_label is a label from your localization strings. Look through existing plugins for examples.