Revision 7e2bf6ca
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/Common.pm | ||
---|---|---|
260 | 260 |
|
261 | 261 |
my ($path, $number); |
262 | 262 |
|
263 |
$form->{WEBDAV} = {};
|
|
263 |
$form->{WEBDAV} = [];
|
|
264 | 264 |
|
265 | 265 |
if ($form->{type} eq "sales_quotation") { |
266 | 266 |
($path, $number) = ("angebote", $form->{quonumber}); |
... | ... | |
293 | 293 |
$base_path =~ s|/$||; |
294 | 294 |
|
295 | 295 |
if (opendir $dir, $path) { |
296 |
foreach my $file (readdir $dir) { |
|
296 |
foreach my $file (sort { lc $a cmp lc $b } readdir $dir) {
|
|
297 | 297 |
next if (($file eq '.') || ($file eq '..')); |
298 | 298 |
|
299 | 299 |
my $fname = $file; |
300 | 300 |
$fname =~ s|.*/||; |
301 | 301 |
|
302 |
my $physical_file = "$path/$file";
|
|
302 |
my $is_directory = -d "$path/$file";
|
|
303 | 303 |
|
304 | 304 |
$file = join('/', map { $form->escape($_) } grep { $_ } split m|/+|, "$path/$file"); |
305 |
$file .= '/' if (-d $physical_file);
|
|
305 |
$file .= '/' if ($is_directory);
|
|
306 | 306 |
|
307 |
$form->{WEBDAV}->{$fname} = ($ENV{"HTTPS"} ? "https://" : "http://") . $ENV{'SERVER_NAME'} . "/$base_path/$file"; |
|
307 |
push @{ $form->{WEBDAV} }, { |
|
308 |
'name' => $fname, |
|
309 |
'link' => ($ENV{"HTTPS"} ? "https://" : "http://") . $ENV{'SERVER_NAME'} . "/$base_path/$file", |
|
310 |
'type' => $is_directory ? $main::locale->text('Directory') : $main::locale->text('File'), |
|
311 |
}; |
|
308 | 312 |
} |
309 | 313 |
|
310 | 314 |
closedir $dir; |
Auch abrufbar als: Unified diff
Webdav: Die Links werden nicht mehr wortwörtlich angezeigt, sondern der Typ (Datei oder Verzeichnis) wird ausgegeben und als Link hinterlegt.