--- loncom/interface/londocs.pm 2005/01/08 06:34:30 1.163
+++ loncom/interface/londocs.pm 2005/04/04 23:51:54 1.173
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.163 2005/01/08 06:34:30 albertel Exp $
+# $Id: londocs.pm,v 1.173 2005/04/04 23:51:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -132,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').
'";
@@ -1391,7 +1501,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);
@@ -1403,23 +1513,20 @@ sub checkonthis {
$r->print(' ');
}
$r->print('- '.&mt('Rendering').': ');
- my $oldpath=$ENV{'request.filename'};
- $ENV{'request.filename'}=&Apache::lonnet::filelocation('',$url);
- &Apache::lonxml::xmlparse($r,'web',
- &Apache::lonnet::getfile(
- &Apache::lonnet::filelocation('',$url)));
- undef($Apache::lonhomework::parsing_a_problem);
- $ENV{'request.filename'}=$oldpath;
- if (($Apache::lonxml::errorcount) ||
- ($Apache::lonxml::warningcount)) {
- if ($Apache::lonxml::errorcount) {
+ my ($errorcount,$warningcount)=split(/:/,
+ &Apache::lonnet::ssi_body($url,
+ ('grade_target'=>'web',
+ 'return_only_error_and_warning_counts' => 1)));
+ if (($errorcount) ||
+ ($warningcount)) {
+ if ($errorcount) {
$r->print(''.
- $Apache::lonxml::errorcount.' '.
+ $errorcount.' '.
&mt('error(s)').' ');
}
- if ($Apache::lonxml::warningcount) {
+ if ($warningcount) {
$r->print(''.
- $Apache::lonxml::warningcount.' '.
+ $warningcount.' '.
&mt('warning(s)').'');
}
} else {
@@ -1434,9 +1541,9 @@ sub checkonthis {
&checkonthis($r,$_,$level+1);
}
}
- } elsif ($result==HTTP_SERVICE_UNAVAILABLE) {
+ } elsif ($result eq 'unavailable') {
$r->print(''.&mt('connection down').'');
- } elsif ($result==HTTP_NOT_FOUND) {
+ } elsif ($result eq 'not_found') {
unless ($url=~/\$/) {
$r->print(''.&mt('not found').'');
} else {
@@ -1457,8 +1564,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;
@@ -1486,7 +1593,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='';
@@ -1821,7 +1929,7 @@ sub handler {
my $containertag;
my $uploadtag;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['folderpath','pagepath','pagesymb']);
+ ['folderpath','pagepath','pagesymb','markedcopy_url','markedcopy_title']);
if ($ENV{'form.folderpath'}) {
my (@folderpath)=split('&',$ENV{'form.folderpath'});
$ENV{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
@@ -1877,8 +1985,9 @@ sub handler {
my $now=time;
# print screen
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(<
+$html
The LearningOnline Network with CAPA
ENDNEWSCRIPT
@@ -2021,7 +2161,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',
@@ -2070,6 +2212,7 @@ ENDNEWSCRIPT