70 lines
1.9 KiB
Text
70 lines
1.9 KiB
Text
$NetBSD: patch-aa,v 1.5 2004/07/10 22:21:40 kim Exp $
|
|
|
|
--- lib/Apache/Gallery.pm.orig 2003-09-07 13:28:42.000000000 -0400
|
|
+++ lib/Apache/Gallery.pm 2004-07-10 18:10:49.000000000 -0400
|
|
@@ -206,9 +206,28 @@
|
|
|
|
# Combine directories and files to one listing
|
|
my @listing;
|
|
- push (@listing, @directories);
|
|
- push (@listing, @files);
|
|
- push (@listing, @downloadable_files);
|
|
+ if (!defined($r->dir_config('GallerySortReverse'))
|
|
+ || $r->dir_config('GallerySortReverse') eq '0') {
|
|
+ push (@listing, @directories);
|
|
+ push (@listing, @files);
|
|
+ push (@listing, @downloadable_files);
|
|
+ } else {
|
|
+ if ($r->dir_config('GallerySortReverse') & 1) {
|
|
+ push (@listing, reverse @directories);
|
|
+ } else {
|
|
+ push (@listing, @directories);
|
|
+ }
|
|
+ if ($r->dir_config('GallerySortReverse') & 2) {
|
|
+ push (@listing, reverse @files);
|
|
+ } else {
|
|
+ push (@listing, @files);
|
|
+ }
|
|
+ if ($r->dir_config('GallerySortReverse') & 4) {
|
|
+ push (@listing, reverse @downloadable_files);
|
|
+ } else {
|
|
+ push (@listing, @downloadable_files);
|
|
+ }
|
|
+ }
|
|
|
|
if (@listing) {
|
|
|
|
@@ -272,7 +291,7 @@
|
|
if (-d $thumbfilename) {
|
|
my $dirtitle = '';
|
|
if (-e $thumbfilename . ".folder") {
|
|
- $dirtitle = get_filecontent($thumbfilename . ".folder");
|
|
+ $dirtitle = get_filecontent($thumbfilename . ".folder", 1);
|
|
}
|
|
|
|
$tpl->assign(FILEURL => uri_escape($fileurl, $escape_rule), FILE => ($dirtitle ? $dirtitle : $file));
|
|
@@ -1041,6 +1060,7 @@
|
|
|
|
sub get_filecontent {
|
|
my $file = shift;
|
|
+ my $fold = shift;
|
|
open(FH, $file) or return undef;
|
|
my $content = '';
|
|
{
|
|
@@ -1048,6 +1068,7 @@
|
|
$content = <FH>;
|
|
}
|
|
close(FH);
|
|
+ $content =~ s/\n/<BR>\n/g if $fold;
|
|
return $content;
|
|
}
|
|
|
|
@@ -1145,7 +1166,7 @@
|
|
$dirname = File::Spec->catdir($dirname, $link);
|
|
|
|
if (-e $dirname . ".folder") {
|
|
- $linktext = get_filecontent($dirname . ".folder");
|
|
+ $linktext = get_filecontent($dirname . ".folder", 0);
|
|
}
|
|
}
|
|
|