Yes, that is one thing I had in mind, actually. In fact, that is exactly how BOLTprocess works. Just create an array like
$BOLTonloadProcess[] = 'somefunc'; then put at the appropriate place in the code if (is_array($BOLTonloadProcess)) BOLTprocess($BOLTonloadProcess); It's easy to set these up and they are nicely configurable. Of course having a single global $Events array might be even nicer. Certainly shorter typing... However, the problem is we have trouble passing info to and retrieving them from the function. For example, I want to strip out the escape routine out of the savepage function so I can use it for both content and data values. Not hard. But the easiest way to do this is to simply add a line in the code: $content = BOLTsaveEscapes($content); To use an BOLTonsaveProcess, I'd have to make the variable global to pass it over and then retrieve it. Not as nice in this situation. I'm think I could figure a way to pass parameters to BOLTprocess one way or another, but not really sure how to get a return value out of it. Other than globals... Any ideas? Cheers, Dan On Thu, Oct 8, 2009 at 5:39 AM, blues <[email protected]> wrote: > > On Oct 6, 5:42 pm, The Editor <[email protected]> wrote: >> I'll work on it. We can surely setup a hook to allow what you >> requested, I'm just not sure about rewriting the whole save page >> function. > > i had another idea for you to think about. > how about some hooks for certain *events*? think about OnPageLoad, > OnPageSave etc... you could define an array $Events which contains the > various arrays of functions: > > $Events['OnPageSave'] = array('func1', 'func2'); > $Events['OnPageLoad'] = array('func3', 'func4'); > > then you would just pass to BOLTprocess the relevant array at the > appropriate point in the code, no need to rewrite the whole save page > function. > this also would allow an easy extension in the future i think, i.e. > adding new events. > > a plugin that wants to run some code before the page is saved would > just do: $Events['OnPageSave'][] = 'myfunc'; > nice? > > blues > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BoltWire" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/boltwire?hl=en -~----------~----~----~----~------~----~------~--~---
