--- loncom/interface/londocs.pm 2013/05/11 00:01:52 1.484.2.31
+++ loncom/interface/londocs.pm 2012/10/01 12:06:46 1.496
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.31 2013/05/11 00:01:52 raeburn Exp $
+# $Id: londocs.pm,v 1.496 2012/10/01 12:06:46 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,7 +40,7 @@ use Apache::lonxml;
use Apache::lonclonecourse;
use Apache::lonnavmaps;
use Apache::lonnavdisplay();
-use Apache::lonextresedit();
+use Apache::lonuserstate();
use HTML::Entities;
use HTML::TokeParser;
use GDBM_File;
@@ -152,7 +152,7 @@ sub dumpcourse {
$r->print(&endContentScreen());
return '';
}
- my ($ca,$cd)=split(/\:/,$env{'form.authorspace'});
+ my ($ca,$cd)=split(/\@/,$env{'form.authorspace'});
$r->print('
'.&mt('Copying Files').'
');
my $title=$env{'form.authorfolder'};
$title=&clean($title);
@@ -270,9 +270,7 @@ sub dumpcourse {
sub group_import {
my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_;
- my ($donechk,$allmaps,%hierarchy,%titles,%addedmaps,%removefrommap,
- %removeparam,$importuploaded,$fixuperrors);
- $allmaps = {};
+
while (@files) {
my ($name, $url, $residx) = @{ shift(@files) };
if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$})
@@ -289,7 +287,7 @@ sub group_import {
$env{'form.output'}=$newmapstr;
my $result=&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,
'output',$1.$2);
- if ($result !~ m{^/uploaded/}) {
+ if ($result != m|^/uploaded/|) {
$errtext.='Map not saved: A network error occurred when trying to save the new map. ';
$fatal = 2;
}
@@ -298,24 +296,6 @@ sub group_import {
}
}
if ($url) {
- if (($caller eq 'londocs') &&
- ($folder =~ /^default/)) {
- if (($url =~ /\.(page|sequence)$/) && (!$donechk)) {
- my $chome = &Apache::lonnet::homeserver($coursenum,$coursedom);
- my $cid = $coursedom.'_'.$coursenum;
- $allmaps =
- &Apache::loncommon::allmaps_incourse($coursedom,$coursenum,
- $chome,$cid);
- $donechk = 1;
- }
- if ($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$}) {
- &contained_map_check($url,$folder,\%removefrommap,\%removeparam,
- \%addedmaps,\%hierarchy,\%titles,$allmaps);
- $importuploaded = 1;
- } elsif ($url =~ m{^/res/.+\.(page|sequence)$}) {
- next if ($allmaps->{$url});
- }
- }
if (!$residx
|| defined($LONCAPA::map::zombies[$residx])) {
$residx = &LONCAPA::map::getresidx($url,$residx);
@@ -323,86 +303,69 @@ sub group_import {
}
my $ext = 'false';
if ($url=~m{^http://} || $url=~m{^https://}) { $ext = 'true'; }
+ $url = &LONCAPA::map::qtunescape($url);
$name = &LONCAPA::map::qtunescape($name);
- if ($name eq '') {
- $name = &LONCAPA::map::qtunescape(&mt('Web Page'));
- }
- if ($url =~ m{^/uploaded/$coursedom/$coursenum/((?:docs|supplemental)/(?:default|\d+))/new\.html$}) {
- my $filepath = $1;
- my $fname = $name;
- if ($fname =~ /^\W+$/) {
- $fname = 'web';
- } else {
- $fname =~ s/\W/_/g;
- }
- if (length($fname > 15)) {
- $fname = substr($fname,0,14);
- }
- my $initialtext = &mt('Replace with your own content.');
- my $newhtml = <
-
-$name
-
-
-$initialtext
-
-