Each hook is now passed a reference to the front-end object,
which provides a trivial interface to hooks.
my ($self, $key) = @_;
my $val = $self->get($key);
if (ref $val eq 'CODE') {
- return &$val($self->{gal});
+ return &$val($self);
} else {
return $val;
}
}
+# For use by extras hooks
+sub gallery($) {
+ my ($self) = @_;
+ return $self->{gal};
+}
+
+# For use by extras hooks: return true if we are showing an image page, false for index page
+sub showing_image($) {
+ my ($self) = @_;
+ return $show_img ne "";
+}
+
sub html_top($) {
my ($self) = @_;
my $title = UCW::CGI::html_escape($self->get('Title'));