Cor Bosman wrote:
> On May 28, 2009, at 8:01 PM, A.L.E.C wrote:
>> I probably not understand, check managesieve plugin. There are e.g.:
>>
>> $this->rc->output->command('managesieve_updatelist', 'down', '',
>> $fid);
>>
>> ... and it's working. Of course in managesieve.js we have:
>>
>> rcube_webmail.prototype.managesieve_updatelist = function(action,
>> name,
>> id) {....
>
> I think Thomas is trying to avoid having to add plugin functions to
> rcube_webmail prototype.
> It does work, and im using the same method right now, but it's kinda
> ugly and not very
> intuitive for plugin creators.

Exactly. It works but extending the rcmail object is actually not what I 
had in mind. In r2589 I've just committed some changes that allow one to 
trigger an event on the client by using 
$rcmail->output->command('plugin.somecallback', array('foo' => 'bar'));

This is also explained in 
http://trac.roundcube.net/wiki/Doc_Plugins#Ajaxrequestsandcallbacks
I hope this works as expected...

Of course the "old" way still works and you can event extend it by adding 
an instace of your plugin object to the rcmail (e.g. rcmail.managesieve = 
new managesieve_plugin();) and then call 
$rcmail->output->command('managesieve.somefunc', ...);

Regards,
Thomas
_______________________________________________
List info: http://lists.roundcube.net/dev/

Reply via email to