Welcome to Geeklog, Anonymous Wednesday, October 09 2024 @ 09:55 am EDT

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
 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.
 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
 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
}
 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
 Quote

All times are EDT. The time is now 09:55 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