--- loncom/interface/londocs.pm 2012/02/28 02:02:16 1.477
+++ loncom/interface/londocs.pm 2013/08/05 12:56:58 1.555
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.477 2012/02/28 02:02:16 raeburn Exp $
+# $Id: londocs.pm,v 1.555 2013/08/05 12:56:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,7 +40,9 @@ use Apache::lonxml;
use Apache::lonclonecourse;
use Apache::lonnavmaps;
use Apache::lonnavdisplay();
+use Apache::lonextresedit();
use HTML::Entities;
+use HTML::TokeParser;
use GDBM_File;
use Apache::lonlocal;
use Cwd;
@@ -67,10 +69,14 @@ sub mapread {
}
sub storemap {
- my ($coursenum,$coursedom,$map)=@_;
+ my ($coursenum,$coursedom,$map,$contentchg)=@_;
+ my $report;
+ if (($contentchg) && ($map =~ /^default/)) {
+ $report = 1;
+ }
my ($outtext,$errtext)=
&LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
- $map,1);
+ $map,1,$report);
if ($errtext) { return ($errtext,2); }
$hadchanges=1;
@@ -100,12 +106,17 @@ sub authorhosts {
my $allowed=0;
my $myhome=&Apache::lonnet::homeserver($ca,$cd);
my @ids=&Apache::lonnet::current_machine_ids();
- foreach my $id (@ids) { if ($id eq $myhome) { $allowed=1; } }
+ foreach my $id (@ids) {
+ if ($id eq $myhome) {
+ $allowed=1;
+ last;
+ }
+ }
if ($allowed) {
$home++;
- $outhash{'home_'.$ca.'@'.$cd}=1;
+ $outhash{'home_'.$ca.':'.$cd}=1;
} else {
- $outhash{'otherhome_'.$ca.'@'.$cd}=$myhome;
+ $outhash{'otherhome_'.$ca.':'.$cd}=$myhome;
$other++;
}
}
@@ -114,27 +125,6 @@ sub authorhosts {
}
-sub dumpbutton {
- my ($home,$other,%outhash)=&authorhosts();
- my $crstype = &Apache::loncommon::course_type();
- if ($home+$other==0) { return ''; }
- if ($home) {
- my $link =
- ""
- .&mt('Dump '.$crstype.' Documents to Construction Space')
- .'';
- return
- $link.' '
- .&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs')
- .'
';
- } else {
- return
- &mt('Dump '.$crstype.' Documents to Construction Space: available on other servers');
- }
-}
-
sub clean {
my ($title)=@_;
$title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs;
@@ -146,17 +136,23 @@ sub clean {
sub dumpcourse {
my ($r) = @_;
my $crstype = &Apache::loncommon::course_type();
- $r->print(&Apache::loncommon::start_page('Dump '.$crstype.' Documents to Construction Space').
- '