X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=Gallery%2FArchive.pm;h=764e24324487a33c179b4f53036d16f91a2558b3;hb=HEAD;hp=6fb34571e3e685b5f1a73f849dbccb65e1a39730;hpb=326051281153aa80cd90265f36c6ff8967685dd0;p=gallery.git diff --git a/Gallery/Archive.pm b/Gallery/Archive.pm deleted file mode 100644 index 6fb3457..0000000 --- a/Gallery/Archive.pm +++ /dev/null @@ -1,45 +0,0 @@ -# Simple Photo Gallery: Web Archiver -# (c) 2005 Martin Mares - -package Gallery::Archive; -import Gallery qw(%CF); - -use IO::Handle; - -sub new($$) { - my ($cls, $type) = @_; - my $x = { 'type' => $type, 'files' => [] }; - return bless $x; -} - -sub Start($) { - my ($this) = @_; - my $type = $this->{'type'}; - my $cts = { "tar" => "application/x-tar", "zip" => "application/zip" }; - defined $cts->{$type} or die "Unknown archive type $type"; - print "Content-Type: ", $cts->{$type}, "\n"; - print "Content-Disposition: inline;filename=gallery.$type\n"; - print "\n"; -} - -sub Finish($) { - my ($this) = @_; - my $type = $this->{'type'}; - STDOUT->flush(); - chdir($CF{"PhotoDir"}) or die; - if ($type eq "tar") { - system("/home/mj/bin/tar", "cf", "-", @{$this->{'files'}}); - } elsif ($type eq "zip") { - system("zip", "-", @{$this->{'files'}}); - } else { die; } -} - -sub RawHTML($$) { -} - -sub img($$$) { - my ($this, $orig, $annot) = @_; - push @{$this->{'files'}}, $orig; -} - -1;