Gossamer Forum
Quote Reply
Re: Hooks.... In reply to
Hi,

In Reply To:
my $results = GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'user_add_link', \&add_link, {});
This is a hook. Wherever you see GT::Plugins->dispatch, then the subroutine mentioned can be overridden (in this case add_link) by your own code.

You supply the PRE hook or POST hook code that gets run either before or after the add_link function.

The goal of this is not to modify the distributed CGI files.

So when you create a PRE hook in a file called YourHooks.pm in the Plugins directory, what happens is the program sees that you have a function registered as a PRE hook for user_add_link. It then runs your function first, and then depending on what your function does, runs the main code.

Cheers,

Alex

--
Gossamer Threads Inc.
Subject Author Views Date
Thread Hooks.... Paul 13635 Feb 6, 2001, 10:22 AM
Thread Re: Hooks....
Robert_B 13325 Feb 6, 2001, 2:07 PM
Post Re: Hooks....
Paul 13292 Feb 6, 2001, 2:23 PM
Thread Re: Hooks....
Paul 13299 Feb 6, 2001, 2:28 PM
Thread Re: Hooks....
Alex 13296 Feb 6, 2001, 3:08 PM
Thread Re: Hooks....
Paul 13289 Feb 6, 2001, 3:16 PM
Thread Re: Hooks....
Alex 13287 Feb 6, 2001, 3:22 PM
Thread Re: Hooks....
Paul 13273 Feb 6, 2001, 4:01 PM
Thread Re: Hooks....
Alex 13300 Feb 6, 2001, 4:32 PM
Thread Re: Hooks....
Paul 13326 Feb 6, 2001, 4:36 PM
Thread Re: Hooks....
pugdog 13274 Feb 6, 2001, 6:14 PM
Post Re: Hooks....
Robert_B 13260 Feb 6, 2001, 6:50 PM
Thread Re: Hooks....
Paul 13245 Feb 7, 2001, 5:07 AM
Thread Re: Hooks....
padders 13257 Feb 7, 2001, 11:43 AM
Post Re: Hooks....
Paul 13242 Feb 7, 2001, 11:47 AM
Thread Re: Hooks....
Alex 13235 Feb 7, 2001, 12:45 PM
Thread Re: Hooks....
Paul 13257 Feb 7, 2001, 1:22 PM
Thread Re: Hooks....
Alex 13222 Feb 7, 2001, 1:34 PM
Thread Re: Hooks....
Paul 13210 Feb 7, 2001, 2:40 PM
Post Re: Hooks....
padders 13218 Feb 7, 2001, 3:00 PM
Post Re: Hooks....
Paul 13296 Feb 6, 2001, 3:23 PM