Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 10:52 am EST
Geeklog Forums
Implementing the Configuration GUI for plugins
Status: offline
suprsidr
Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
11
10
Quote
Status: offline
jmucchiello
Forum User
Full Member
Registered: 08/29/05
Posts: 985
Quote 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.
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.
14
13
Quote
Status: offline
Blaine
Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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.
Geeklog components by PortalParts -- www.portalparts.com
The updateConfig method is there so you don't have to do the compare to determine what value has changed.
Geeklog components by PortalParts -- www.portalparts.com
10
13
Quote
Status: offline
jmucchiello
Forum User
Full Member
Registered: 08/29/05
Posts: 985
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
}
function plugin_config_updating_$group($name, $oldvalue, $newvalue)
{
return null; // allow change
// or
return "error string"; // do not allow change, show error
}
11
9
Quote
Status: offline
Blaine
Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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.
Geeklog components by PortalParts -- www.portalparts.com
Geeklog components by PortalParts -- www.portalparts.com
13
9
Quote
All times are EST. The time is now 10:52 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content