Posted on: 07/27/08 11:06pm
By: suprsidr
So I've implemented the Configuration GUI for my G2Bridge plugin....
I was wondering if a plugin function gets called upon config update/change.
something like function plugin_config_update_myPlugin would certainly be handy.
I'm interested in controlling the visibility of an exsisting block simply by changing a config value.
But I want to avoid querying the db for every request.
-s
Re: Implementing the Configuration GUI for plugins
Posted on: 07/28/08 03:50am
By: jmucchiello
Quote by: suprsidrSo I've implemented the Configuration GUI for my G2Bridge plugin....
I was wondering if a plugin function gets called upon config update/change.
something like function plugin_config_update_myPlugin would certainly be handy.
Make a feature request in the bug tracker. This and the ability to put custom controls on the config screen were discussed on the dev mailing list but dev list discussions are easily forgotten. The bug tracker is a better place to make sure these kinds of ideas aren't lost.
Re: Implementing the Configuration GUI for plugins
Posted on: 07/28/08 08:31am
By: Blaine
I am assuming you care presently calling the config class method updateConfig with group parm set to your plugin name and that would only update the values in the config table for your plugin. If you don't want to use that class method then you could call the set() method which will update just one value.
The updateConfig method is there so you don't have to do the compare to determine what value has changed.
Re: Implementing the Configuration GUI for plugins
Posted on: 07/28/08 10:08am
By: jmucchiello
Blaine, I think he wants the plugin to be notified when someone modifies a config setting in the configuration GUI. The benefit to this is the plugin could do validation on the change:
function plugin_config_updating_$group($name, $oldvalue, $newvalue)
{
return null; // allow change
// or
return "error string"; // do not allow change, show error
}
Re: Implementing the Configuration GUI for plugins
Posted on: 07/28/08 10:26am
By: Blaine
Oh a callback function on update notify, sorry miss-understood. Yep - as Joe suggested, thats a good idea and add that to the bug/feature request tracker and we can add that.