--- loncom/interface/londocs.pm 2017/08/27 02:23:02 1.636
+++ loncom/interface/londocs.pm 2017/08/27 02:36:49 1.637
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.636 2017/08/27 02:23:02 raeburn Exp $
+# $Id: londocs.pm,v 1.637 2017/08/27 02:36:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4588,7 +4588,7 @@ sub untiehash {
sub checkonthis {
- my ($r,$url,$level,$title)=@_;
+ my ($r,$url,$level,$title,$checkstale)=@_;
$url=&unescape($url);
$alreadyseen{$url}=1;
$r->rflush();
@@ -4603,10 +4603,22 @@ sub checkonthis {
$r->print(''.
($title?$title:$url).' ');
if ($url=~/^\/res\//) {
+ my $updated;
+ if (($checkstale) && ($url !~ m{^/res/lib/templates/}) &&
+ ($url !~ /\.\d+\.\w+$/)) {
+ $updated = &Apache::lonnet::remove_stale_resfile($url);
+ }
my $result=&Apache::lonnet::repcopy(
&Apache::lonnet::filelocation('',$url));
if ($result eq 'ok') {
$r->print(''.&mt('ok').'');
+ if ($updated) {
+ $r->print('
');
+ for (my $i=0;$i<=$level*5;$i++) {
+ $r->print(' ');
+ }
+ $r->print('- '.&mt('Outdated copy removed'));
+ }
$r->rflush();
&Apache::lonnet::countacc($url);
$url=~/\.(\w+)$/;
@@ -4640,7 +4652,7 @@ sub checkonthis {
&Apache::lonnet::metadata($url,'dependencies');
foreach my $dep (split(/\,/,$dependencies)) {
if (($dep=~/^\/res\//) && (!$alreadyseen{$dep})) {
- &checkonthis($r,$dep,$level+1);
+ &checkonthis($r,$dep,$level+1,'',$checkstale);
}
}
} elsif ($result eq 'unavailable') {
@@ -4654,6 +4666,9 @@ sub checkonthis {
} else {
$r->print(''.&mt('access denied').'');
}
+ if (($updated) && ($result ne 'ok')) {
+ $r->print('
'.&mt('Outdated copy removed'));
+ }
}
}
}
@@ -4706,9 +4721,29 @@ sub list_symbs {
$r->print(&endContentScreen());
}
+sub contentverifyform {
+ my ($r) = @_;
+ my $crstype = &Apache::loncommon::course_type();
+ $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Content'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Content'));
+ $r->print(&startContentScreen('tools'));
+ $r->print('