--- loncom/publisher/lonpubdir.pm 2003/09/22 03:02:06 1.39
+++ loncom/publisher/lonpubdir.pm 2003/12/22 19:30:25 1.48
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.39 2003/09/22 03:02:06 www Exp $
+# $Id: lonpubdir.pm,v 1.48 2003/12/22 19:30:25 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,19 +25,6 @@
#
# http://www.lon-capa.org/
#
-#
-# (TeX Content Handler
-#
-# YEAR=2000
-# 05/29/00,05/30,10/11 Gerd Kortemeyer)
-#
-# 11/28,11/29,11/30,12/01,12/02,12/04,12/23 Gerd Kortemeyer
-# YEAR=2001
-# 03/23 Guy Albertelli
-# 03/24,03/29 Gerd Kortemeyer)
-# 03/31,04/03,05/09,06/23,08/18,08/20 Gerd Kortemeyer
-# 12/28 Gerd Kortemeyer
-#
###
package Apache::lonpubdir;
@@ -48,6 +35,7 @@ use File::Copy;
use Apache::Constants qw(:common :http :methods);
use Apache::loncacc;
use Apache::loncommon();
+use Apache::lonhtmlcommon();
use Apache::lonlocal;
sub handler {
@@ -113,7 +101,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,
@@ -213,24 +201,28 @@ parent.lastknownpriv='/~$uname/$thisdisf
ENDPUBDIRSCRIPT
- $r->print('
'.&mt('Construction Space Directory').' '.
- $thisdisfn.'/
'.
+ $r->print(''.&mt('Construction Space Directory').'
'.
''.
$pubdirscript.
'');
+ $uname.$thisdisfn."/default.meta'".'" value="'.
+&mt('Edit Directory Catalog Information').'" /> '.&mt('Force publication of unmodified files').'. | |
');
if (($uname ne $ENV{'user.name'}) || ($udom ne $ENV{'user.domain'})) {
$r->print(''.&mt('Co-Author').': '.$uname.' at '.$udom.
'
');
}
+ $r->print(
+ &Apache::lonhtmlcommon::crumbs($thisdisfn,'_top','/priv/'.$uname));
}
#
@@ -247,7 +239,7 @@ sub getTitleString {
my $title = &Apache::lonnet::metadata($fullname, 'title');
unless ($title) {
- $title = "[untitled]";
+ $title = "[".&mt('untitled')."]";
}
return $title;
}
@@ -274,12 +266,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;
@@ -292,7 +284,7 @@ sub putresource {
$resdir, $targetdir, $linkdir,
$cmtime) = @_;
- my $status='Unpublished';
+ my $status=&mt('Unpublished');
my $bgcolor='#FFCCCC';
my $title=' ';
if (-e $resdir.'/'.$filename) {
@@ -301,24 +293,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=&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='';
@@ -329,9 +325,13 @@ sub putresource {
$editlink=' ('.&mt('EditXML').')';
$editlink2=' ('.&mt('Edit').')';
}
+ if ($filename=~/\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/) {
+ $editlink=' ('.&mt('Decompress').')';
+ }
$r->print(''.
''.'Publish'.
+ $uname.$thisdisfn.'/'.$filename.'">'.&mt('Publish').''.
' | '.
''.
''.
@@ -339,7 +339,7 @@ sub putresource {
' | '.
''.$title.' | '.
''.$status.' | '.
- ''.localtime($cmtime).' | '.
+ ''.&Apache::lonlocal::locallocaltime($cmtime).' | '.
"
\n");
return OK;
}