I have utilized many hooks for my plugin, but can't seem to grasp what should be a simple concept...
Can we create a hook that simply replaces one "if" statement and then returns directly to the original code and follows the plugin hook's "if" result rather than the original?
Previously all my hooks have been at the beginning or end of a code block and do not need to pass that kind of logic info back to the existing code...
The only way I am seeing something like that working is to actually pass a value back from the plugin and then have to modify the original "if" statement in accordance with the new value...is there a better way that I don't know about? Currently, I keep having periodically patch one line in the downloaded svn main file to make OD behave the way I want without replacing that entire block of code in my plugin...
Thanks.
Hook and Plugin Question
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: Hook and Plugin Question
I think it's a good idea for us to consider and to look into. But it would take days of valuable programming time. I don't think we have the resources to add any more "features" to plug-ins right now. We're really swamped with EHR 2014, etc.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
Re: Hook and Plugin Question
How about if the hook returns false, then nothing happens, but if it returns positive(hook exists), then we could add a "goto:label" line to skip a section of code? That would seem to be simple to implement...
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: Hook and Plugin Question
Yeah, that's fine. Oh goodie, an excuse to finally use the goto.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com