--- loncom/interface/londocs.pm 2004/09/18 17:04:03 1.145
+++ loncom/interface/londocs.pm 2005/03/02 22:26:36 1.169
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.145 2004/09/18 17:04:03 albertel Exp $
+# $Id: londocs.pm,v 1.169 2005/03/02 22:26:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -30,6 +30,7 @@ package Apache::londocs;
use strict;
use Apache::Constants qw(:common :http);
+use Apache::imsexport;
use Apache::lonnet;
use Apache::loncommon;
use Apache::lonratedt;
@@ -131,11 +132,17 @@ sub dumpbutton {
}
}
+sub clean {
+ my ($title)=@_;
+ $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs;
+ return $title;
+}
# -------------------------------------------------------- Actually dump course
sub dumpcourse {
my $r=shift;
- $r->print('
Dump DOCS'.
+ my $html=&Apache::lonxml::xmlbegin();
+ $r->print($html.'Dump DOCS'.
&Apache::loncommon::bodytag('Dump Course DOCS to Construction Space').
'";
@@ -1242,7 +1489,7 @@ sub checkonthis {
if ($url=~/^\/res\//) {
my $result=&Apache::lonnet::repcopy(
&Apache::lonnet::filelocation('',$url));
- if ($result==OK) {
+ if ($result eq 'OK') {
$r->print(''.&mt('ok').'');
$r->rflush();
&Apache::lonnet::countacc($url);
@@ -1285,9 +1532,9 @@ sub checkonthis {
&checkonthis($r,$_,$level+1);
}
}
- } elsif ($result==HTTP_SERVICE_UNAVAILABLE) {
+ } elsif ($result eq 'HTTP_SERVICE_UNAVAILABLE') {
$r->print(''.&mt('connection down').'');
- } elsif ($result==HTTP_NOT_FOUND) {
+ } elsif ($result eq 'HTTP_NOT_FOUND') {
unless ($url=~/\$/) {
$r->print(''.&mt('not found').'');
} else {
@@ -1308,8 +1555,8 @@ sub verifycontent {
my $r=shift;
my $loaderror=&Apache::lonnet::overloaderror($r);
if ($loaderror) { return $loaderror; }
-
- $r->print('Verify Content'.
+ my $html=&Apache::lonxml::xmlbegin();
+ $r->print($html.'Verify Content'.
&Apache::loncommon::bodytag('Verify Course Documents'));
$hashtied=0;
undef %alreadyseen;
@@ -1337,7 +1584,8 @@ sub verifycontent {
sub checkversions {
my $r=shift;
- $r->print('Check Versions'.
+ my $html=&Apache::lonxml::xmlbegin();
+ $r->print($html.'Check Versions'.
&Apache::loncommon::bodytag('Check Course Document Versions'));
my $header='';
my $startsel='';
@@ -1602,11 +1850,18 @@ sub is_hash_old {
sub changewarning {
my ($r,$postexec)=@_;
if (!&is_hash_old()) { return; }
+ my $pathvar='folderpath';
+ my $path=&Apache::lonnet::escape($ENV{'form.folderpath'});
+ if (defined($ENV{'form.pagepath'})) {
+ $pathvar='pagepath';
+ $path=&Apache::lonnet::escape($ENV{'form.pagepath'});
+ $path.='&symb='.&Apache::lonnet::escape($ENV{'form.pagesymb'});
+ }
$r->print(
''.
'
'.
-'
'.
&mt('Changes will become active for your current session after').
' ';
- $uploadtag = '';
+ $containertag = ''.
+ '';
+ $uploadtag = ''.
+ '';
}
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
$showdoc='/'.$1;
}
unless ($showdoc) { # got called from remote
- $forcestandard=($ENV{'form.folder'}=~/^default_/);
+ if (($ENV{'form.folder'}=~/^default_/) ||
+ ($ENV{'form.folder'} =~ m#^\d+/(pages|sequences)/#)) {
+ $forcestandard = 1;
+ }
$forcesupplement=($ENV{'form.folder'}=~/^supplemental_/);
# does this user have privileges to post, etc?
@@ -1716,8 +1976,9 @@ sub handler {
my $now=time;
# print screen
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(<
+$html
The LearningOnline Network with CAPA
ENDNEWSCRIPT
@@ -1858,7 +2137,9 @@ ENDNEWSCRIPT
my %lt=&Apache::lonlocal::texthash(
'uplm' => 'Upload a new main course document',
'upls' => 'Upload a new supplemental course document',
- 'impp' => 'Import a published document',
+ 'impp' => 'Import a document',
+ 'pubd' => 'Published documents',
+ 'copm' => 'All documents out of a published map',
'spec' => 'Special documents',
'upld' => 'Upload Document',
'srch' => 'Search',
@@ -1907,6 +2188,7 @@ ENDNEWSCRIPT