--- loncom/publisher/lonpubdir.pm 2003/09/25 22:30:06 1.40
+++ loncom/publisher/lonpubdir.pm 2003/12/05 14:26:25 1.47
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.40 2003/09/25 22:30:06 www Exp $
+# $Id: lonpubdir.pm,v 1.47 2003/12/05 14:26:25 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -113,7 +113,7 @@ sub handler {
my $dirptr=16384; # Mask indicating a directory in stat.cmode.
opendir(DIR,$fn);
- my @files=sort(readdir(DIR));
+ my @files=sort {uc($a) cmp uc($b)} (readdir(DIR));
foreach my $filename (@files) {
my ($cdev,$cino,$cmode,$cnlink,
$cuid,$cgid,$crdev,$csize,
@@ -277,12 +277,12 @@ sub putdirectory {
unless (( ($dirname eq '..') && ($reqfile eq '')) ||
($dirname eq '.')) {
$r->print('
'.
- 'Go to ... | '.
+ ''.&mt('Go to ...').' | '.
''.
$disfilename.' | '.
' | '.
' | '.
- ''.localtime($modtime).' | '.
+ ''.&Apache::lonlocal::locallocaltime($modtime).' | '.
"
\n");
}
return OK;
@@ -295,7 +295,7 @@ sub putresource {
$resdir, $targetdir, $linkdir,
$cmtime) = @_;
- my $status='Unpublished';
+ my $status=&mt('Unpublished');
my $bgcolor='#FFCCCC';
my $title=' ';
if (-e $resdir.'/'.$filename) {
@@ -304,28 +304,28 @@ sub putresource {
$ratime,$rmtime,$rctime,
$rblksize,$rblocks)=stat($resdir.'/'.$filename);
if ($rmtime>=$cmtime) {
- $status='Published';
+ $status=&mt('Published');
$bgcolor='#CCFFCC';
if (&Apache::lonnet::metadata($targetdir.'/'.$filename,'obsolete')) {
- $status='Obsolete';
+ $status=&mt('Obsolete');
$bgcolor='#AAAAAA';
}
$title=''.
getTitleString($targetdir.'/'.$filename, 'title').'';
} else {
- $status='Modified';
+ $status=&mt('Modified');
$bgcolor='#FFFFCC';
$title=''.
getTitleString($targetdir.'/'.$filename,'title').'';
if (&Apache::loncommon::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') {
$status.='
Diffs';
+ '&versiontwo=priv" target=cat>'.&mt('Diffs').'';
}
}
$status.='
Retrieve';
+ $thisdisfn.'/'.$filename.'" target=cat>'.&mt('Retrieve').'';
}
my $editlink='';
my $editlink2='';
@@ -336,6 +336,10 @@ sub putresource {
$editlink=' ('.&mt('EditXML').')';
$editlink2=' ('.&mt('Edit').')';
}
+ if ($filename=~/\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/) {
+ $editlink=' ('.&mt('Decompress').')';
+ }
$r->print(''.
''.&mt('Publish').''.
@@ -345,8 +349,8 @@ sub putresource {
$filename.''.$editlink2.$editlink.
' | '.
''.$title.' | '.
- ''.&mt($status).' | '.
- ''.localtime($cmtime).' | '.
+ ''.$status.' | '.
+ ''.&Apache::lonlocal::locallocaltime($cmtime).' | '.
"
\n");
return OK;
}