8 |
|
|
9 |
=cut |
=cut |
10 |
|
|
11 |
unless ($main::ENV{PATH_TRANSLATED}) { |
my $dir = $main::ENV{PATH_TRANSLATED} |
12 |
die "BAD PATH_TRANSLATED"; |
or die "BAD PATH_TRANSLATED: $ENV{PATH_TRANSLATED}"; |
|
} |
|
13 |
|
|
14 |
my %Opt; |
my %Opt; |
15 |
|
|
16 |
my $dir = $main::ENV{PATH_TRANSLATED}; |
if ($dir =~ s#/[^/]+$##) { |
|
if ($dir =~ s#/LIST$##) { |
|
17 |
for (split /[&;]/, $ENV{QUERY_STRING}) { |
for (split /[&;]/, $ENV{QUERY_STRING}) { |
18 |
my ($name, $val) = split /=/, $_, 2; |
my ($name, $val) = split /=/, $_, 2; |
19 |
$Opt{$name} = defined $val ? $val : 1; |
$Opt{$name} = defined $val ? $val : 1; |
54 |
} |
} |
55 |
} |
} |
56 |
|
|
57 |
|
unless (-d $dir) { |
58 |
|
# $dir =~ s#/+[^/]+$##; |
59 |
|
} |
60 |
|
|
61 |
opendir DIR, $dir or die "$dir: $!"; |
opendir DIR, $dir or die "$dir: $!"; |
62 |
my @all_files = sort grep {not /^\./ and /^[A-Za-z0-9._-]+$/} |
my @all_files = sort grep {not /^\./ and /^[A-Za-z0-9._-]+$/} |
63 |
(readdir DIR)[0..1000]; |
(readdir DIR)[0..1000]; |
79 |
my $title = '画像一覧'; |
my $title = '画像一覧'; |
80 |
my $dirpath = escape $ENV{REQUEST_URI}; |
my $dirpath = escape $ENV{REQUEST_URI}; |
81 |
$dirpath =~ s/\?.*$//; |
$dirpath =~ s/\?.*$//; |
82 |
$dirpath =~ s#/LIST$##; |
$dirpath =~ s#/[^/]+$##; |
83 |
$dirpath ||= '/'; |
$dirpath ||= '/'; |
84 |
|
|
85 |
print STDOUT "Content-Type: text/html; charset=euc-jp\n\n"; |
print STDOUT "Content-Type: text/html; charset=euc-jp\n\n"; |
104 |
if ($Opt{cframe}) { |
if ($Opt{cframe}) { |
105 |
my $LISTqt = ($LISTq eq 'LIST' ? $LISTq . '?' : $LISTq . ';') . 'target=view'; |
my $LISTqt = ($LISTq eq 'LIST' ? $LISTq . '?' : $LISTq . ';') . 'target=view'; |
106 |
print qq{<frameset cols="25%,*"> |
print qq{<frameset cols="25%,*"> |
107 |
<frame src="$LISTqt" name="list"> |
<frame src="$LISTqt" name="list" /> |
108 |
<frame src="./" name="view"> |
<frame src="./" name="view" /> |
109 |
<noframes>}; |
<noframes>}; |
110 |
} |
} |
111 |
|
|
132 |
shift @cls; |
shift @cls; |
133 |
print q{<div class="image-with-desc">}; |
print q{<div class="image-with-desc">}; |
134 |
print qq{<a href="$uri"$viewtarget>}; |
print qq{<a href="$uri"$viewtarget>}; |
135 |
print qq{<img src="$uri" alt="" class="@{[join ' ', @cls, 's']}"></a>}; |
print qq{<img src="$uri" alt="" class="@{[join ' ', @cls, 's']}" /></a>}; |
136 |
print qq{<dl><dt>URI</dt><dd>}; |
print qq{<dl><dt>URI</dt><dd>}; |
137 |
print qq{<code class="uri"><<a href="$uri"$viewtarget>$uri</a>></code></dd>}; |
print qq{<code class="uri"><<a href="$uri"$viewtarget>$uri</a>></code></dd>}; |
138 |
print qq{<dt>ファイル名</dt><dd>}; |
print qq{<dt>ファイル名</dt><dd>}; |
150 |
my $uri = $efile; |
my $uri = $efile; |
151 |
$uri =~ s/\..+//g; |
$uri =~ s/\..+//g; |
152 |
print q{<div class="image-with-desc">}; |
print q{<div class="image-with-desc">}; |
153 |
print qq{<a href="$uri"$viewtarget><img src="/~wakaba/archive/2005/movie-1" alt=""></a>}; |
print qq{<a href="$uri"$viewtarget><img src="/~wakaba/archive/2005/movie-1" alt="" /></a>}; |
154 |
print qq{<dl><dt>URI</dt><dd>}; |
print qq{<dl><dt>URI</dt><dd>}; |
155 |
print qq{<code class="uri"><<a href="$uri"$viewtarget>$uri</a>></code></dd>}; |
print qq{<code class="uri"><<a href="$uri"$viewtarget>$uri</a>></code></dd>}; |
156 |
print qq{<dt>ファイル名</dt><dd>}; |
print qq{<dt>ファイル名</dt><dd>}; |
170 |
print q{<div class="dir dir-with-desc">}; |
print q{<div class="dir dir-with-desc">}; |
171 |
if (-f $dir . '/' . $dir_name . '/favicon.png' or |
if (-f $dir . '/' . $dir_name . '/favicon.png' or |
172 |
-f $dir . '/' . $dir_name . '/favicon.ico') { |
-f $dir . '/' . $dir_name . '/favicon.ico') { |
173 |
print qq{<img src="$edir/favicon" alt="" class="mini-icon">}; |
print qq{<img src="$edir/favicon" alt="" class="mini-icon" />}; |
174 |
} else { |
} else { |
175 |
print qq{<img src="/icons/folder" alt="" class="mini-icon">}; |
print qq{<img src="/icons/folder" alt="" class="mini-icon" />}; |
176 |
} |
} |
177 |
print qq{<code class="file"><a href="$edir/$LISTq"$listtarget>$edir/</a></code>}; |
print qq{<code class="file"><a href="$edir/$LISTq"$listtarget>$edir/</a></code>}; |
178 |
print q{</div>}; |
print q{</div>}; |
190 |
['current', '現行版']) { |
['current', '現行版']) { |
191 |
if (has_file $_->[0]) { |
if (has_file $_->[0]) { |
192 |
print q{<div class="file file-with-desc">}; |
print q{<div class="file file-with-desc">}; |
193 |
print q{<img src="/icons/layout" alt="" class="mini-icon">}; |
print q{<img src="/icons/layout" alt="" class="mini-icon" />}; |
194 |
print qq{<a href="$_->[0]" rel="$_->[2]"$viewtarget>$_->[1]</a>}; |
print qq{<a href="$_->[0]" rel="$_->[2]"$viewtarget>$_->[1]</a>}; |
195 |
print q{</div>}; |
print q{</div>}; |
196 |
} |
} |
197 |
} |
} |
198 |
|
|
199 |
print q{<div class="dir-up dir-with-desc">}; |
print q{<div class="dir-up dir-with-desc">}; |
200 |
print q{<img src="/icons/forward" alt="" class="mini-icon">}; |
print q{<img src="/icons/forward" alt="" class="mini-icon" />}; |
201 |
print qq{<a href="../$LISTq" rel="up"$listtarget>上の階層</a>}; |
print qq{<a href="../$LISTq" rel="up"$listtarget>上の階層</a>}; |
202 |
print q{</div>}; |
print q{</div>}; |
203 |
|
|
233 |
if (-d $dir . '/CVS') { |
if (-d $dir . '/CVS') { |
234 |
if (-f $dir . '/CVS/Root') { |
if (-f $dir . '/CVS/Root') { |
235 |
open my $root, '<', $dir . '/CVS/Root'; |
open my $root, '<', $dir . '/CVS/Root'; |
236 |
if (<$root> =~ m#^(/home/cvs|/home/wakaba/pub/cvs)$#) { |
if (<$root> =~ m#^(/home/cvs|/home/wakaba/pub/cvs)/?$#) { |
237 |
my $rpath = $1; |
my $rpath = $1; |
238 |
if (-f $dir . '/CVS/Repository') { |
if (-f $dir . '/CVS/Repository') { |
239 |
open my $repo, '<', $dir . '/CVS/Repository'; |
open my $repo, '<', $dir . '/CVS/Repository'; |