--- loncom/publisher/lonpubdir.pm 2001/07/12 21:23:12 1.10
+++ loncom/publisher/lonpubdir.pm 2001/11/29 20:03:03 1.15
@@ -10,7 +10,7 @@
# 03/23 Guy Albertelli
# 03/24,03/29 Gerd Kortemeyer)
#
-# 03/31,04/03,05/09,06/23 Gerd Kortemeyer
+# 03/31,04/03,05/09,06/23,08/18,08/20 Gerd Kortemeyer
package Apache::lonpubdir;
@@ -86,21 +86,34 @@ sub handler {
my $linkdir='/~'.$uname.$thisdisfn;
$r->print('
'.
- 'Filename | Modified | Status |
');
+ 'Filename | Modified | Status | |
');
my $filename;
my $dirptr=16384;
opendir(DIR,$fn);
my @files=sort(readdir(DIR));
- foreach my$filename (@files) {
+ foreach my $filename (@files) {
my ($cdev,$cino,$cmode,$cnlink,
$cuid,$cgid,$crdev,$csize,
$catime,$cmtime,$cctime,
$cblksize,$cblocks)=stat($fn.'/'.$filename);
+
my $extension='';
if ($filename=~/\.(\w+)$/) { $extension=$1; }
- if (($extension ne 'meta') && (&Apache::lonnet::fileembstyle($extension))) {
+ if ($cmode&$dirptr) {
+ my $disfilename=$filename;
+ if ($filename eq '..') {
+ $disfilename='Parent Directory';
+ }
+ unless ((($filename eq '..') && ($thisdisfn eq '')) ||
+ ($filename eq '.')) {
+ $r->print(''.$disfilename.
+ ' | '.localtime($cmtime).' | | |
'
+ );
+ }
+ } elsif (&Apache::lonnet::fileembstyle($extension) ne 'hdn') {
my $status='Unpublished';
my $bgcol='#FFBBBB';
if (-e $resdir.'/'.$filename) {
@@ -117,28 +130,21 @@ sub handler {
if
(&Apache::lonnet::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') {
$status.='
Diffs';
}
}
+ $status.='
Retrieve';
}
$r->print(''.$filename.
- ' | '.localtime($cmtime).' | '.$status.' |
');
- } elsif ($cmode&$dirptr) {
- my $disfilename=$filename;
- if ($filename eq '..') {
- $disfilename='Parent Directory';
- }
- unless ((($filename eq '..') && ($thisdisfn eq '')) ||
- ($filename eq '.')) {
- $r->print(''.$disfilename.
- ' | '.localtime($cmtime).' | |
');
- }
+ ''.localtime($cmtime).' | '.$status.' | '.
+ ''.
+ 'Publish | ');
} else {
- #no extension that we know of and not a directory
- #just hide it away
+ # "hidden" extension and not a directory, so hide it away.
}
}
closedir(DIR);