--- rat/lonpage.pm 2004/08/29 18:34:36 1.57
+++ rat/lonpage.pm 2004/09/14 01:21:49 1.60
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Page Handler
#
-# $Id: lonpage.pm,v 1.57 2004/08/29 18:34:36 raeburn Exp $
+# $Id: lonpage.pm,v 1.60 2004/09/14 01:21:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -74,7 +74,7 @@ sub tracetable {
my ($sofar,$rid,$beenhere)=@_;
my $further=$sofar;
my $randomout=0;
- if ($ENV{'request.role'} =~ /^st/) {
+ unless ($ENV{'request.role.adv'}) {
$randomout = $hash{'randomout_'.$rid};
}
unless ($beenhere=~/\&$rid\&/) {
@@ -351,7 +351,17 @@ sub handler {
unless ($contents) {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
- $r->print('
'.&mt('Empty page').'.');
+ $r->print(''."\n".
+ ''."\n".
+ &Apache::lonmenu::registerurl(1,undef)."\n".
+ ''."\n".
+ ''.
+ &Apache::lonmenu::menubuttons(undef,$target,1)
+ );
+ $r->print(&mt('This page is either empty or it only contains resources that are currently hidden').'. ');
+ $r->print('
'.&mt('Please use the LON-CAPA navigation arrows to move to another item in the course').'.');
} else {
# ------------------------------------------------------------------ Build page
@@ -414,19 +424,24 @@ sub handler {
my $avespan=$lcm/($#colcont+1);
for ($j=0;$j<=$#colcont;$j++) {
my $rid=$colcont[$j];
- my $metainfo=''.
- ''.
- '
'.
- ''.
- '
'.
- '';
+ my $metainfo = '';
+ print STDERR "src is $hash{'src_'.$rid}\n";
+ unless ($hash{'src_'.$rid} =~ m-^/uploaded/-) {
+ $metainfo =''.
+ ''.
+ '
'.
+ '';
+ }
+ $metainfo .= ''.
+ '
'.
+ '';
if (
($hash{'src_'.$rid}=~/\.(problem|exam|quiz|assess|survey|form)$/) &&
- (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}))) {
+ (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) &&
+ ($hash{'src_'.$rid} !~ m-^/uploaded/-)) {
my ($mapid,$resid)=split(/\./,$rid);
my $symb=
&Apache::lonnet::declutter($hash{'map_id_'.$mapid}).
@@ -494,6 +509,10 @@ sub handler {
} elsif ($cellemb{$rid} eq 'emb') {
$r->print('>'.$metainfo.'');
+ } elsif (&Apache::lonnet::declutter($hash{'src_'.$rid}) !~/\.(sequence|page)$/) {
+ $r->print($metainfo.''.$hash{'title_'.$rid}.'
'.
+ &mt('It is recommended that you use an up-to-date virus scanner before handling this file.').''.
+ &Apache::londocs::entryline(0,&mt("Click to download or use your browser's Save Link function"),'/'.&Apache::lonnet::declutter($hash{'src_'.$rid})).'
');
}
unless ($target eq 'tex') {
$r->print('');