I put it inside my plugin:
I plug into display_link and form_link.
look in Links::HTML::Links::_plg_display and _plg_form.
You'll see the GT code and how they call \&form_expiry; or \&disp_expiry;
the problem is that we lose those self->{code}->{ExpiryDate} when plugging in.
So in order to re-establish them and NOT have to copy the code, we need to create the self->{code}->{ExpiryDate} code with an explicit call to that subroutine as I mentioned above.
If you're pluggin into display_link, you'll need to do the same with LinkOwner.
hope that helps.
sub form_link {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'form_link'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my ($self, $opts) = @_;
$self->{code}->{myfield} = \&form_myfield;
$self->{code}->{ExpiryDate} = \&Links::HTML::Links::form_expiry;
}
I plug into display_link and form_link.
look in Links::HTML::Links::_plg_display and _plg_form.
You'll see the GT code and how they call \&form_expiry; or \&disp_expiry;
the problem is that we lose those self->{code}->{ExpiryDate} when plugging in.
So in order to re-establish them and NOT have to copy the code, we need to create the self->{code}->{ExpiryDate} code with an explicit call to that subroutine as I mentioned above.
If you're pluggin into display_link, you'll need to do the same with LinkOwner.
hope that helps.
sub form_link {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'form_link'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my ($self, $opts) = @_;
$self->{code}->{myfield} = \&form_myfield;
$self->{code}->{ExpiryDate} = \&Links::HTML::Links::form_expiry;
}