[RCD] Using javascript from message hooks

Sergio Carrasco Mayans sergioc at derechonntt.com
Mon Nov 3 10:12:13 CET 2014


Hello, I tried sending a question through nabble but it seems there's a
problem since it states it isn't accepted even though i'm already
registered (and it doesn't show in history, so I think it won't be
duplicated).

I've been using command events, but i'm not able to find out how to use it
from a message hook. What I have right now is first a hook to
'message_part_after' and I want to call a command from inside the called
function (the call to the function is correct since it raises a flag I've
put there).

In other places I use  $this->rcmail->output->command rcmail being a
rcmail::getinstance, but this doesn't seem to work here (I have an error
in the javascript console stating that rcmail.functionname is not a
function).

I also tried output directly, but to no avail. Is something changed when
calling commands from the showing a mail action? The js was included
through $this->include_script in the beginning of my php. All the examples
I've found in plugins are more of a command in a button, not directly
executing the script from the read message action.

Right now I'm using directly a script inside the php, but I'd like to know
how to call the event.



-- 
Sergio Carrasco Mayans
http://www.derechonntt.com
http://www.lawandit.net
sergioc at derechonntt.com



More information about the dev mailing list