]> www.average.org Git - mkgallery.git/blob - include/chrome.pm
add html customizaton template
[mkgallery.git] / include / chrome.pm
1 #!/usr/bin/perl
2 # $Id$
3 #
4 # customizable class to generate html around the gallery index
5
6 package Chrome;
7
8 use strict;
9
10 # Boilerplate. Do not change this (unless you know better).
11
12 sub new {
13         my $this=shift;
14         my $self;
15         my $parm=shift;
16         if (ref($this)) {
17                 die "$this::new should not be called as instance method";
18         } else {
19                 $self={
20                         -title          => $parm->{-title},
21                         -depth          => $parm->{-depth},
22                         -breadcrumbs    => $parm->{-breadcrumbs},
23                 };
24         }
25         bless $self,$this;
26         return $self;
27 }
28
29 # Public methods. Replace this with what suits you.
30
31 sub header {
32         my $self=shift;
33         return $self{-depth}?
34                 "<div class=\"uplink\"><a href=\"../index.html\">UP</a></div>":
35                 "".
36                 "<h1 class=\"title\">$self{-title}</h1>";
37 }
38
39 sub axheader {
40         my $self=shift;
41         return "<h2 class=\"alisthdr\">Albums</h2>";
42 }
43
44 sub ixheader {
45         my $self=shift;
46         return "<h2 class=\"ilisthdr\">Images</h2>";
47 }
48
49 sub footer {
50         my $self=shift;
51         return "<hr class=\"footer\" />";
52 }