--- loncom/interface/londocs.pm 2007/07/03 00:17:42 1.283
+++ loncom/interface/londocs.pm 2007/07/12 01:04:36 1.288
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.283 2007/07/03 00:17:42 albertel Exp $
+# $Id: londocs.pm,v 1.288 2007/07/12 01:04:36 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -908,9 +908,7 @@ sub group_import {
my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_;
while (@files) {
- my $name = shift(@files);
- my $url = shift(@files);
- #FIXME check if file exists before overwriting, might be restoring it
+ my ($name, $url, $residx) = @{ shift(@files) };
if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$})
&& ($caller eq 'londocs')
&& (!&Apache::lonnet::stat_file($url))) {
@@ -934,14 +932,17 @@ sub group_import {
}
}
if ($url) {
- my $idx = &LONCAPA::map::getresidx($url);
- $LONCAPA::map::order[$#LONCAPA::map::order+1]=$idx;
+ if (!$residx
+ || defined($LONCAPA::map::zombies[$residx])) {
+ $residx = &LONCAPA::map::getresidx($url,$residx);
+ push(@LONCAPA::map::order, $residx);
+ }
my $ext = 'false';
if ($url=~m{^http://} || $url=~m{^https://}) { $ext = 'true'; }
$url = &LONCAPA::map::qtunescape($url);
$name = &LONCAPA::map::qtunescape($name);
- $LONCAPA::map::resources[$idx] =
- join ':', ($name, $url, $ext, 'normal', 'res');
+ $LONCAPA::map::resources[$residx] =
+ join(':', ($name, $url, $ext, 'normal', 'res'));
}
}
return &storemap($coursenum, $coursedom, $folder.'.'.$container);
@@ -1199,6 +1200,8 @@ sub update_paste_buffer {
if (&is_supplemental_title($title)) {
($title) = &parse_supplemental_title($title);
}
+ $url=~s{http(:|:)//https(:|:)//}{https$2//};
+
&Apache::lonnet::appenv('docs.markedcopy_title' => $title,
'docs.markedcopy_url' => $url);
delete($env{'form.markcopy'});
@@ -1209,32 +1212,34 @@ sub print_paste_buffer {
return if (!defined($env{'docs.markedcopy_url'}));
$r->print(<
'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'
'); } - $r->print('+ | |
+ |