Apache-Album
view release on metacpan or search on metacpan
. qq!" ALT="$picture"></CENTER>!);
last; };
/med/ and do {
$r->print(qq!<CENTER><IMG SRC="!
. (-f "$thumb_dir/$path_info/800x600_$picture"
? "$thumb_uri/$path_info/800x600_$picture"
: "$album_uri/$path_info/$picture")
. qq!" ALT="$picture"></CENTER>!);
last; };
/lg/ and do {
$r->print(qq!<CENTER><IMG SRC="!
. (-f "$thumb_dir/$path_info/1024x768_$picture"
? "$thumb_uri/$path_info/1024x768_$picture"
: "$album_uri/$path_info/$picture")
. qq!" ALT="$picture"></CENTER>!);
last; };
/xlg/ and do {
$r->print(qq!<CENTER><IMG SRC="!
. (-f "$thumb_dir/$path_info/1600x1200_$picture"
? "$thumb_uri/$path_info/1600x1200_$picture"
: "$album_uri/$path_info/$picture")
. qq!" ALT="$picture"></CENTER>!);
last; };
$r->print(qq!<CENTER><IMG SRC="$album_uri/$path_info/$picture" ALT="$picture"></CENTER>!);
}
$r->print(qq!<HR><CENTER>$message</CENTER><HR>!);
}
else {
$r->print(qq!<TD ALIGN="center"><TABLE BORDER=$settings{'InsideTablesBorder'}><TR><TD ALIGN="center"><A HREF="$_">! .
qq!<IMG SRC="$thumb_uri/$path_info/tn__$_" ALT="$_"></A>$resize_urls</TD></TR>!,
qq!<TR><TD ALIGN="center">$message</TD></TR></TABLE></TD>\n!);
$pixels_so_far += $settings{'ThumbNailWidth'};
$columns_so_far++;
if ($settings{'NumberOfColumns'} > 0
? ($columns_so_far >= $settings{'NumberOfColumns'} )
: ($pixels_so_far > $settings{'DefaultBrowserWidth'})) {
$r->print(qq!</TR><TR>!);
$pixels_so_far = $settings{'ThumbNailWidth'};
$columns_so_far = 0;
}
}
}
$r->print("</TR></TABLE></CENTER>\n");
if ($settings{'EditMode'}) {
$r->print(&file_upload());
}
$r->print("<hr>\n$settings{'Footer'}\n<hr>") if $settings{'Footer'};
$r->print(<<EOF);
</BODY>
</HTML>
EOF
return Apache2::Const::OK;
}
# show_albums simply shows the albums under the directory
# it should probably not be called, a "real" web page with
# links to the albums would probably be better, but this
# helps when debugging, or if someone decides to go to this
# directory directly
sub show_albums {
my ($r, $album_dir, $path_info, $settings) = @_;
unless ($r->uri =~ m|/$|) {
$r->log_error("Redirecting -> " . $r->uri . "/");
$r->headers_out->{Location} = $r->uri . "/";
return Apache2::Const::REDIRECT;
}
unless (opendir(IN,$album_dir)) {
$r->log_error("Could not open $album_dir: $!");
return Apache2::Const::SERVER_ERROR;
}
my @dirs = grep { -d "$album_dir/$_" && ! /^\./ } readdir(IN);
closedir(IN);
$r->content_type('text/html');
#$r->send_http_header();
return Apache2::Const::OK if $r->header_only;
$r->print(<<EOF);
<HTML><HEADER><TITLE>$$settings{AlbumTitle}</TITLE></HEADER>
<BODY $$settings{'BodyArgs'}>
<H3>$$settings{AlbumTitle}</H3>
EOF
$r->print($path_info)
if $path_info;
@dirs = sort @dirs;
@dirs = reverse @dirs
if $settings->{'ReverseDirs'};
foreach (@dirs) {
$r->print("\n<dl>\n");
&list_dirs($r, $album_dir, $_, "", $settings );
$r->print("\n</dl>\n");
}
if ($settings->{'EditMode'}) {
$r->print(qq!<FORM METHOD="POST">New Album:<INPUT TYPE="text" NAME="AlbumName"><INPUT TYPE="submit" NAME="New Album" VALUE="New Album"></FORM>!);
unless (@dirs) {
$r->print(&file_upload());
}
}
$r->print(<<EOF);
<HR>
<address>Apache::Album</address>
</BODY>
</HTML>
EOF
return Apache2::Const::OK;
}
# parseArgs is used to turn the array of arguments
( run in 1.102 second using v1.01-cache-2.11-cpan-39bf76dae61 )