> I hope I could provide a small patch on monday for testing. 
I made it. The Patch is made with SVN Version 1626. I implemented it
slightly different. I'll describe it here:

Changes:

1 Config: optional you can set a plugin directory, default is as follows:
$rcmail_config['plugin_dir'] = 'plugins/';

2 At the points where different plugin-actions should raise:
rcube_plugins::get_instance()->actionUserLoggedIn();
Currently only this action is defined - other follow if the code is proved.
As not really needed to implement a own function for each plugin-action it
gives us a good documentation.

3 As rcube_plugins is a singleton class it is initialized when first needed.
Then:
... the constructor calls registerPlugins()
which loops thru the plugin-directory and searches for plugin classes and
initiates them:
This defaults to ./plugins/Pluginname/Pluginname.php which includes 'class
Pluginname'

4 on the call to actionUserLoggedIn() in 2. the rcube_plugins singleton
tries to find a matching method actionUserLoggedIn() in any plugin class. 

5 demoEventLogger is an very small example plugin which should write a log
to the temp folder.

-------------------
Why I implemented it this way:
* there is no need for configuration in RC
* there is no need for an extra hook registration in the plugins
* because you may have a better way to do it?

You will find the patch-file and a complete 7zip file including the whole
roundcubemail folder here:
http://www.lagg.at/temp
The patch file is also included in this mail.

As I am not the greatest php programmer it would be great if someone can
review it.

Thanks, yours

-- 
Florian Lagg
- 
 Florian Lagg - IT-Komplettlösungen
 Juch 7, 6631 Lermoos
 tel +43 (699) 10 20 10 24
 www.lagg.at - [EMAIL PROTECTED]
-
 Xing: http://www.xing.com/go/invite/7372113.3da562
-



 --- 8< --- detachments --- 8< ---
 The following attachments have been detached and are available for viewing.
  http://detached.gigo.com/rc/BG/FeBAgRCc/plugin-architecture.patch
 Only click these links if you trust the sender, as well as this message.
 --- 8< --- detachments --- 8< ---

_______________________________________________
List info: http://lists.roundcube.net/dev/

Reply via email to