--- loncom/interface/londocs.pm 2004/12/10 20:47:33 1.153
+++ loncom/interface/londocs.pm 2005/02/21 00:32:45 1.168
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.153 2004/12/10 20:47:33 albertel Exp $
+# $Id: londocs.pm,v 1.168 2005/02/21 00:32:45 www 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').
'";
@@ -1328,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;
@@ -1357,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='';
@@ -1627,6 +1855,7 @@ sub changewarning {
if (defined($ENV{'form.pagepath'})) {
$pathvar='pagepath';
$path=&Apache::lonnet::escape($ENV{'form.pagepath'});
+ $path.='&symb='.&Apache::lonnet::escape($ENV{'form.pagesymb'});
}
$r->print(
''.
@@ -1682,7 +1911,7 @@ sub handler {
# is this a standard course?
my $standard=($ENV{'request.course.uri'}=~/^\/uploaded\//);
- my $forcestandard;
+ my $forcestandard = 0;
my $forcesupplement;
my $script='';
my $allowed;
@@ -1691,7 +1920,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));
@@ -1701,14 +1930,19 @@ sub handler {
my (@pagepath)=split('&',$ENV{'form.pagepath'});
$ENV{'form.pagename'}=&Apache::lonnet::unescape(pop(@pagepath));
$ENV{'form.folder'}=pop(@pagepath);
- $containertag = '';
- $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?
@@ -1742,8 +1976,9 @@ sub handler {
my $now=time;
# print screen
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(<
+$html
The LearningOnline Network with CAPA
ENDNEWSCRIPT
@@ -1884,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',
@@ -1933,6 +2188,7 @@ ENDNEWSCRIPT