\n");
$r->print("\n");
- $r->print("Name \n");
- $r->print("Title \n")
+ $r->print("".&mt('Name')." \n");
+ $r->print("".&mt('Title')." \n")
if ($hash{'display_attrs_0'} == 1);
- $r->print("Size (bytes) ".
+ $r->print(" ".&mt("Size")." (".&mt("bytes").") ".
" \n") if ($hash{'display_attrs_1'} == 1);
- $r->print("Last accessed \n")
+ $r->print("".&mt("Last accessed")." \n")
if ($hash{'display_attrs_2'} == 1);
- $r->print("Last modified \n")
+ $r->print("".&mt("Last modified")." \n")
if ($hash{'display_attrs_3'} == 1);
- $r->print("Author(s) \n")
+ $r->print("".&mt("Author(s)")." \n")
if ($hash{'display_attrs_4'} == 1);
- $r->print("Keywords \n")
+ $r->print("".&mt("Keywords")." \n")
if ($hash{'display_attrs_5'} == 1);
- $r->print("Language \n")
+ $r->print("".&mt("Language")." \n")
if ($hash{'display_attrs_6'} == 1);
- $r->print("Resource \n")
+ $r->print("".&mt("Resource")." \n")
if ($hash{'display_attrs_7'} == 1);
+ $r->print("".&mt("Usage Statistics")." (".
+ &mt("Courses/Network Hits").") \n")
+ if ($hash{'display_attrs_8'} == 1);
$r->print(' ');
# ----------------- read in what directories have previously been set to "open"
@@ -535,18 +597,19 @@ sub scanDir {
my ($strip,$dom,undef,$testdir,undef)=split(/\&/,$line,5);
next if $strip =~ /.*\.meta$/;
my (@fileparts) = split(/\./,$strip);
- if ($hash{'display_attrs_8'} != 1) {
+ if ($hash{'display_attrs_9'} != 1) {
if (scalar(@fileparts) >= 3) {
my $fext = pop @fileparts;
my $ov = pop @fileparts;
my $fname = join ('.',@fileparts,$fext);
- next if (grep /\Q$fname\E/,@list and $ov =~ /\d+/);
+ next if (grep /\Q$fname\E/,@list and $ov =~ /^\d+$/);
}
}
if ($dom eq 'domain') {
- $compuri = join('',$strip,'/'); # dom list has /res/
- $curdir = $compuri;
+ # dom list has full path /res// already
+ $curdir='';
+ $compuri = (split(/\&/,$line))[0];
} else {
# user, dir & file have name only, i.e., w/o path
$compuri = join('',$startdir,$strip,'/');
@@ -574,7 +637,7 @@ sub get_list {
my @list;
(my $luri = $uri) =~ s/\//_/g;
- if ($ENV{'form.attrs'} eq 'Refresh') {
+ if ($ENV{'form.attrs'} eq &mt('Update Display')) {
foreach (keys %hash) {
delete $hash{$_} if ($_ =~ /^dirlist_files_/);
}
@@ -637,7 +700,7 @@ sub match_ext {
push @trimlist,$line;
}
}
- @trimlist = sort (@trimlist);
+ @trimlist = sort {uc($a) cmp uc($b)} (@trimlist);
return @trimlist;
}
@@ -653,13 +716,13 @@ sub display_line {
my @pathcom = split (/\//,$filecom[0]);
my $listname = $pathcom[scalar(@pathcom)-1];
my $fnptr = $filecom[3]&$dirptr;
- my $msg = 'View '.$filecom[0].' resources';
- $msg = 'Close '.$filecom[0].' directory' if $diropen eq 'opened';
+ my $msg = &mt('View').' '.$filecom[0].' '.&mt('resources');
+ $msg = &mt('Close').' '.$filecom[0].' '.&mt('directory') if $diropen eq 'opened';
my $tabtag='';
my $i=0;
- while ($i<=7) {
+ while ($i<=8) {
$tabtag=join('',$tabtag," ")
if $hash{'display_attrs_'.$i} == 1;
$i++;
@@ -669,8 +732,8 @@ sub display_line {
# display uplink arrow
if ($filecom[1] eq 'viewOneUp') {
- $r->print("$extrafield");
- $r->print("\n");
+ $r->print(" $extrafield");
+ $r->print("\n");
$r->print (' \n");
+ $r->print(&mt("Up")." $tabtag\n");
return OK;
}
# Do we have permission to look at this?
@@ -694,10 +757,10 @@ sub display_line {
if ($filecom[1] eq 'domain') {
$r->print (' '."\n")
if ($ENV{'form.dirPointer'} eq "on");
- $r->print("$extrafield");
- $r->print("");
- &begin_form ($r,$filecom[0].'/');
- my $anchor = $filecom[0].'/';
+ $r->print(" $extrafield");
+ $r->print("");
+ &begin_form ($r,$filecom[0]);
+ my $anchor = $filecom[0];
$anchor =~ s/\///g;
$r->print ('');
$r->print (' ');
@@ -706,9 +769,9 @@ sub display_line {
$r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
"\n");
$r->print (' print (' border="0" /> '."\n");
- $r->print ("Domain - $listname ");
+ $r->print (&mt("Domain")." - $listname ");
if ($Apache::lonnet::domaindescription{$listname}) {
$r->print("(".$Apache::lonnet::domaindescription{$listname}.
")");
@@ -719,8 +782,8 @@ sub display_line {
# display user directory
}
if ($filecom[1] eq 'user') {
- $r->print(" $extrafield");
- $r->print("\n");
+ $r->print(" $extrafield");
+ $r->print("\n");
my $curdir = $startdir.$filecom[0].'/';
my $anchor = $curdir;
$anchor =~ s/\///g;
@@ -746,6 +809,7 @@ sub display_line {
# display file
if ($fnptr == 0 and $filecom[3] ne '') {
my $filelink = $startdir.$filecom[0];
+ next if &Apache::lonnet::metadata($filelink,'obsolete');
my @file_ext = split (/\./,$listname);
my $curfext = $file_ext[-1];
if (@Omit) {
@@ -763,7 +827,7 @@ sub display_line {
$iconname = $curfext.".gif" unless
(!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');
#
- $r->print(" ");
+ $r->print(" ");
my $metafile = grep /^\Q$filecom[0]\E\.meta\&/, @list;
my $title;
if ($ENV{'form.catalogmode'} eq 'interactive') {
@@ -777,7 +841,7 @@ sub display_line {
$titleesc,"','",$filelink,"')\">");
$r->print(" ".
"\n");
- $r->print(" ");
+ $r->print(" ");
}
elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
$title=$listname;
@@ -796,7 +860,7 @@ sub display_line {
$r->print(" \n");
$r->print("\n");
- $r->print(" ");
+ $r->print(" ");
$hash{"pre_${fnum}_link"}=$filelink;
$hash{"pre_${fnum}_title"}=$titleesc;
$fnum++;
@@ -824,44 +888,44 @@ sub display_line {
" TARGET=_self>$listname ");
$r->print (" (metadata ) ") if ($metafile == 1);
$r->print(" \n");
if ($hash{'display_attrs_0'} == 1) {
- my $title = &Apache::lonnet::metadata($filelink,'title')
+ my $title = &Apache::lonnet::gettitle($filelink,'title')
if ($metafile == 1);
- $r->print(' '.($title eq '' ? ' ' : $title).
+ $r->print(' '.($title eq '' ? ' ' : $title).
' '."\n");
}
- $r->print(' ',
+ $r->print(' ',
$filecom[8]," \n")
if $hash{'display_attrs_1'} == 1;
- $r->print(' '.
+ $r->print(' '.
(localtime($filecom[9]))." \n")
if $hash{'display_attrs_2'} == 1;
- $r->print(' '.
+ $r->print(' '.
(localtime($filecom[10]))." \n")
if $hash{'display_attrs_3'} == 1;
if ($hash{'display_attrs_4'} == 1) {
my $author = &Apache::lonnet::metadata($filelink,'author')
if ($metafile == 1);
- $r->print(' '.($author eq '' ? ' ' : $author).
+ $r->print(' '.($author eq '' ? ' ' : $author).
" \n");
}
if ($hash{'display_attrs_5'} == 1) {
my $keywords = &Apache::lonnet::metadata($filelink,'keywords')
if ($metafile == 1);
# $keywords = ' ' if (!$keywords);
- $r->print(' '.($keywords eq '' ? ' ' : $keywords).
+ $r->print(' '.($keywords eq '' ? ' ' : $keywords).
" \n");
}
if ($hash{'display_attrs_6'} == 1) {
my $lang = &Apache::lonnet::metadata($filelink,'language')
if ($metafile == 1);
$lang = &Apache::loncommon::languagedescription($lang);
- $r->print(' '.($lang eq '' ? ' ' : $lang).
+ $r->print(' '.($lang eq '' ? ' ' : $lang).
" \n");
}
if ($hash{'display_attrs_7'} == 1) {
@@ -877,9 +941,18 @@ sub display_line {
$Apache::lonnet::hostname{&Apache::lonnet::homeserver($2,$1)}.
'/cgi-bin/thumbnail.gif?url='.$filelink.'" />';
}
- $r->print(' '.($output eq '' ? ' ':$output).
+ $r->print(' '.($output eq '' ? ' ':$output).
" \n");
}
+ if ($hash{'display_attrs_8'} == 1) {
+ my (%stat) = &Apache::lonmeta::dynamicmeta($filelink) if ($metafile == 1);
+ my $stat = (exists($stat{'course'}) ? $stat{'course'} : '').
+ ((exists($stat{'course'}) || exists($stat{'count'})) ? '/' : '').
+ (exists($stat{'count'}) ? $stat{'count'} : '');
+ $r->print(' '.($stat eq '' ? ' ' : $stat).
+ ' '."\n");
+ }
+
$r->print(" \n");
}