2 Jul 01, 2006 18:53
Enable and Disable their own events?
The user can manually do this via the plugin's settings page.
Just look at the Plugin class: enable_event() and disable_event() are there. So, yes.
Customize their Settings Page?
So in the settings i can just have a button saying 'Go to here to customize this plugin' which redirects the user to a custom made page in the Tools section of b2evolution or whatever.
PluginSettingsEditDisplayAfter() gets called after the settings form. So, yes.
Save settings themselves?
Can plugins say $this->savesettings($name,$value), and save the setting
If So, Do settings need to be specified in DefaultSettings in order to be used in the save settings function.
Yes, of course can plugins save settings themselves. They have a PluginSettings object and can just do $this->Settings->set( 'foo', 'bar' ) - but to make them permanent they must call the Settings's dbupdate() method (we had this before, haven't we?).
Settings that are not defined in GetDefaultSettings() can be used, but won't show up anywhere automatically.
Plugin's filename need to end with '.plugin.php' ?
Plugin's directory need to end with '_plugin' ?
Plugin's Class Name need to end with '_plugin' ?
And also another question, say i have a group of plugins, lets say panels.
so i have the 'panels_plugin' folder, now inside this folder i have several plugins: _panels.plugin.php, _categories.plugin.php, _welcome.plugin.php etc.
Will b2evolution automaticly handle the loading? When _panels.plugin.php NEEDS to be loaded first as the others are dependent on it.
You could say that the panel plugins "require the plugin" panels_plugin (GetDependencies method) and then require_once() the file in each of the panel plugin's source files.
And yeh with the above example say i have the panels inside '/panels_plugin/panels/', will b2evolution handle this? Or will it have to be done manually?
That's not supported yet. Currently b2evo only scans the plugins/ folder and *_plugin subfolders thereof for available plugins (in the Plugins admin section). When loading, it first tries the *_plugin folder and than the general plugins/ folder.
This would require to store the path of the plugin's classfile in T_plugins and use this, when loading the plugin.
I've just implemented this locally, but no promise that it gets committed.
Cheers if all these questions get answered i'll be one happy man. :D
So you are.. :)