--- loncom/interface/londocs.pm 2013/03/17 18:49:16 1.484.2.28
+++ loncom/interface/londocs.pm 2013/01/09 04:31:57 1.529
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.28 2013/03/17 18:49:16 raeburn Exp $
+# $Id: londocs.pm,v 1.529 2013/01/09 04:31:57 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -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);
@@ -289,7 +289,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;
}
@@ -300,7 +300,7 @@ sub group_import {
if ($url) {
if (($caller eq 'londocs') &&
($folder =~ /^default/)) {
- if (($url =~ /\.(page|sequence)$/) && (!$donechk)) {
+ unless ($donechk) {
my $chome = &Apache::lonnet::homeserver($coursenum,$coursedom);
my $cid = $coursedom.'_'.$coursenum;
$allmaps =
@@ -325,48 +325,6 @@ sub group_import {
if ($url=~m{^http://} || $url=~m{^https://}) { $ext = 'true'; }
$url = &LONCAPA::map::qtunescape($url);
$name = &LONCAPA::map::qtunescape($name);
- if ($name eq '') {
- $name = &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
-
-
-END
- $env{'form.output'}=$newhtml;
- my $result =
- &Apache::lonnet::finishuserfileupload($coursenum,$coursedom,
- 'output',
- "$filepath/$residx/$fname.html");
- if ($result =~ m{^/uploaded/}) {
- $url = $result;
- if ($filepath =~ /^supplemental/) {
- $name = time.'___&&&___'.$env{'user.name'}.'___&&&___'.
- $env{'user.domain'}.'___&&&___'.$name;
- }
- } else {
- return (&mt('Failed to save new web page.'),1);
- }
- }
$LONCAPA::map::resources[$residx] =
join(':', ($name, $url, $ext, 'normal', 'res'));
}
@@ -377,10 +335,9 @@ END
removefrommap => \%removefrommap,
removeparam => \%removeparam,
);
- my ($result,$msgsarray,$lockerror) =
- &apply_fixups($folder,1,$coursedom,$coursenum,\%import_errors,\%updated);
+ &apply_fixups($folder,1,$coursedom,$coursenum,\%import_errors,\%updated);
if (keys(%import_errors) > 0) {
- $fixuperrors =
+ $fixuperrors =
''."\n".
&mt('The following files are either dependencies of a web page or references within a folder and/or composite page for which errors occurred during import:')."\n".
'
'."\n";
@@ -389,18 +346,6 @@ END
}
$fixuperrors .= '
'."\n";
}
- if (ref($msgsarray) eq 'ARRAY') {
- if (@{$msgsarray} > 0) {
- $fixuperrors .= ''.
- join('
',@{$msgsarray}).
- '
';
- }
- }
- if ($lockerror) {
- $fixuperrors .= ''.
- $lockerror.
- '
';
- }
}
my ($errtext,$fatal) =
&storemap($coursenum, $coursedom, $folder.'.'.$container,1);
@@ -790,7 +735,7 @@ sub print_paste_buffer {
$buffer = $type.': '.
&LONCAPA::map::qtescape($env{'docs.markedcopy_title'}).' ('.
&LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')';
- } else {
+ } else {
my $icon = &Apache::loncommon::icon($extension);
if ($extension eq 'sequence' &&
$env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {
@@ -802,36 +747,19 @@ sub print_paste_buffer {
}
if ($canpaste) {
$r->print('