Phil Weir wrote:
Hi,
Hi Phil
Many thanks for your feedback.
I have come across a couple of little things when porting my patches to plugins, I assumed that these bits just hadn't been done yet in the development. I'm sure you have your own plans but here is what I have found so far….
rcube_plugin->add_texts() always adds texts to the output even in AJAX mode, $OUTPUT->add_label() does not. Adding the texts when the page is loaded to service an AJAX request causes JS errors and an alert box with "error: undefined" pops up.
This was due a bug in rcube_json_output.class. Should now be fixed and working.
$OUTPUT->button() always tries to load text from the core localization array. Is there a better alternative for use in plugins? For example if you want a button and you give it a label like
'label' => $this->gettext('myplugin')
then on the button you get[My Plugin]
– the correct text but with [] around it, as it cant be found in the core localization array.
You can now add the label 'domain' => $this->ID when calling $OUTPUT->button() from within a plugin class.
I think the new API is great apart from those two minor snags. It was really easy to move all my code across. The example plugins really help show what's what as well.
Thanks a lot. I'm looking forward to see your patches all turned into plugins. These will make a lot of RoundCube users happy.
Finally a couple of hook requests:
- A hook for when the message list is loaded or updated – I have been
working on a context menu for the message list and it works great the first time the page is loaded but I can’t see a way in the API to attach the event listener when switching between folders or when a new message arrives.
I've created two new events which could be helpful for you. listupdate: After the message list was updated (ajax response) insertrow: Triggers for each row after it was inserted.
- Address book hooks, when something is added/updated/deleted from the
address book.
OK, I'll work on these soon. Just keep an eye on http://trac.roundcube.net/wiki/Plugin_Hooks
Best regards, Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/