Author Topic: Quick Question from an amateur  (Read 4891 times)

Offline Aodhan

  • Newbie
  • *
  • Posts: 5
Quick Question from an amateur
« 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 ?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Quick Question from an amateur
« Reply #1 on: July 13, 2010, 10:12:33 AM »
Code: [Select]

rcmail.display_message('Well Done!', 'confirmation');

Offline qnrq

  • Jr. Member
  • **
  • Posts: 22
    • http://pipemail.org/
Quick Question from an amateur
« Reply #2 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');

Offline Aodhan

  • Newbie
  • *
  • Posts: 5
Quick Question from an amateur
« Reply #3 on: July 13, 2010, 08:06:28 PM »
Thanks for the replys...

I'll try that out now.

Offline corbosman

  • Sr. Member
  • ****
  • Posts: 260
Quick Question from an amateur
« Reply #4 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.