--- loncom/publisher/lonpubdir.pm 2003/09/21 03:30:02 1.38
+++ 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.38 2003/09/21 03:30:02 taceyjo1 Exp $
+# $Id: lonpubdir.pm,v 1.47 2003/12/05 14:26:25 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,6 +48,7 @@ use File::Copy;
use Apache::Constants qw(:common :http :methods);
use Apache::loncacc;
use Apache::loncommon();
+use Apache::lonlocal;
sub handler {
@@ -103,14 +104,16 @@ sub handler {
# Start off the diretory table.
$r->print('
'.
- 'Actions | Name | Title | '.
- 'Status | Last Modified |
');
+ ''.&mt('Actions').' | '.&mt('Name').' | '.
+ &mt('Title').' | '.
+ ''.&mt('Status').' | '.&mt('Last Modified').
+ ' |
');
my $filename;
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,
@@ -182,7 +185,7 @@ sub getEffectiveUrl {
sub startpage {
my ($r, $uname, $udom, $thisdisfn) = @_;
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
$r->print('LON-CAPA Construction Space');
@@ -210,7 +213,7 @@ parent.lastknownpriv='/~$uname/$thisdisf
ENDPUBDIRSCRIPT
- $r->print('Construction Space Directory '.
+ $r->print(''.&mt('Construction Space Directory').' '.
$thisdisfn.'/
'.
''.
@@ -218,14 +221,17 @@ ENDPUBDIRSCRIPT
'');
+ $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('Co-Author: '.$uname.' at '.$udom.
+ $r->print(''.&mt('Co-Author').': '.$uname.' at '.$udom.
'
');
}
}
@@ -244,7 +250,7 @@ sub getTitleString {
my $title = &Apache::lonnet::metadata($fullname, 'title');
unless ($title) {
- $title = "[untitled]";
+ $title = "[".&mt('untitled')."]";
}
return $title;
}
@@ -266,17 +272,17 @@ sub putdirectory {
my $disfilename = $dirname;
if ($dirname eq '..') {
- $disfilename = 'Parent Directory';
+ $disfilename = ''.&mt('Parent Directory').'';
}
unless (( ($dirname eq '..') && ($reqfile eq '')) ||
($dirname eq '.')) {
$r->print(''.
- 'Go to ... | '.
+ ''.&mt('Go to ...').' | '.
''.
$disfilename.' | '.
' | '.
' | '.
- ''.localtime($modtime).' | '.
+ ''.&Apache::lonlocal::locallocaltime($modtime).' | '.
"
\n");
}
return OK;
@@ -289,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) {
@@ -298,37 +304,45 @@ 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='';
if ($filename=~/\.(xml|html|htm|xhtml|xhtm|sty)$/) {
- $editlink=' (Edit)';
+ $editlink=' ('.&mt('Edit').')';
}
if ($filename=~/\.(problem|exam|quiz|assess|survey|form|library)$/) {
- $editlink=' (EditXML)';
- $editlink2=' (Edit)';
+ $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').''.
' | '.
''.
''.
@@ -336,7 +350,7 @@ sub putresource {
' | '.
''.$title.' | '.
''.$status.' | '.
- ''.localtime($cmtime).' | '.
+ ''.&Apache::lonlocal::locallocaltime($cmtime).' | '.
"
\n");
return OK;
}