]> mj.ucw.cz Git - gallery.git/blobdiff - gal/UCW/Gallery/Web/HighSlide.pm
Gallery2: Front-end attachment reform
[gallery.git] / gal / UCW / Gallery / Web / HighSlide.pm
index 86ffcacf4a09548cbc06ed5a0a8c158daa4034b2..b3df6e6eaeae445f41373d26aa5c00f798008150 100644 (file)
@@ -12,12 +12,6 @@ use UCW::Gallery::Web;
 our @ISA = qw(UCW::Gallery::Web);
 
 my $theme_name = "plain";
-my $navw = 48;
-my $navh = 48;
-my $box_w = 130;
-my $box_h = 110;
-my $thumb_w = 114;
-my $thumb_h = 94;
 
 sub theme_dir($) {
        my ($self) = @_;
@@ -26,10 +20,8 @@ sub theme_dir($) {
 
 sub theme_head_extras($) {
        my ($self) = @_;
-       my $tdir = $self->theme_dir;
        my $hsdir = $self->get('ThemeUrlPrefix') . "highslide";
        return <<AMEN ;
-<link rel=stylesheet href='$tdir/style.css' type='text/css' media=all>
 <script type="text/javascript" src="$hsdir/highslide-with-gallery.js"></script>
 <script type="text/javascript" src="$hsdir/custom.js" charset="utf-8"></script>
 <script type="text/javascript">
@@ -47,13 +39,9 @@ sub show_links($$$$) {
        my ($self, $prev, $up, $next) = @_;
        my $theme = $self->theme_dir;
        print "<p class=parent>";
-       print "<span class=back style='width: ${navw}px; height: ${navh}px'>";
-       print "<a href='$prev'><img src='$theme/prev.png' width=${navw} height=${navh} alt='Back'></a>" if $prev ne "";
-       print "</span>\n";
-       printf "<span class=fwd style='width: ${navw}px; height: ${navh}px'>";
-       printf "<a href='$next'><img src='$theme/next.png' width=${navw} height=${navh} alt='Forward'></a>" if $next ne "";
-       print "</span>\n";
-       printf "<a href='$up'><img src='$theme/back.png' width=${navw} height=${navh} alt='Up'></a>" if $up ne "";
+       print "<a href='$prev'><img class=back prev src='$theme/prev.png'></a>" if $prev ne "";
+       printf "<a href='$next'><img class=fwd src='$theme/next.png'></a>" if $next ne "";
+       printf "<a href='$up'><img class=up src='$theme/back.png'></a>" if $up ne "";
 }
 
 sub show_pre_thumbs($) {
@@ -69,10 +57,9 @@ sub show_post_thumbs($) {
 
 sub show_thumb($) {
        my ($self, $meta, $photo_id, $click_url) = @_;
-       my $theme = $self->theme_dir;
        my $m = $meta->{photo}->{$photo_id};
        my $annot = UCW::CGI::html_escape($m->{title});
-       my $tf = $self->{thumb_fmt};
+       my $tf = $self->get('ThumbFormats')->[0];
        my $tm = $meta->{thumb}->{$tf}->{$photo_id} or die "No thumbnails for format $tf found!\n";
        my $tw = $tm->{w};
        my $th = $tm->{h};
@@ -85,10 +72,10 @@ sub show_thumb($) {
        print "<img src='$thumb' width=$tw height=$th alt='Photo'$tit></a>\n";
 }
 
-sub attach($$) {
+sub run($$) {
        my ($class, $gal) = @_;
        my $self = $class->SUPER::attach($gal);
-       $self->{thumb_fmt} = $gal->require_thumbnails($thumb_w, $thumb_h);
+       $self->dispatch();
        return $self;
 }