--- loncom/interface/londocs.pm 2007/07/03 00:30:47 1.284
+++ loncom/interface/londocs.pm 2007/07/13 23:08:07 1.291
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.284 2007/07/03 00:30:47 albertel Exp $
+# $Id: londocs.pm,v 1.291 2007/07/13 23:08:07 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,80 @@ sub print_paste_buffer {
return if (!defined($env{'docs.markedcopy_url'}));
$r->print(<
'.$errtext.'
'); return; } - } $r->print($upload_output); if ($env{'form.cmd'}) { @@ -1435,13 +1461,11 @@ sub editor { # Group import/search if ($env{'form.importdetail'}) { my @imports; -# &Apache::lonnet::logthis("imp detail ".$env{'form.importdetail'}); foreach (split(/\&/,$env{'form.importdetail'})) { if (defined($_)) { - my ($name,$url)=split(/\=/,$_); - $name=&unescape($name); - $url=&unescape($url); - push @imports, $name, $url; + my ($name,$url,$residx)= + map {&unescape($_)} split(/\=/,$_); + push(@imports, [$name, $url, $residx]); } } # Store the changed version @@ -1489,7 +1513,7 @@ sub editor { if ($randompick>=0) { $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('+ |
![]() |
+ |
![]() |