--- loncom/interface/londocs.pm 2006/12/05 02:55:52 1.264
+++ loncom/interface/londocs.pm 2007/07/03 00:17:42 1.283
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.264 2006/12/05 02:55:52 albertel Exp $
+# $Id: londocs.pm,v 1.283 2007/07/03 00:17:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -122,16 +122,17 @@ sub dumpbutton {
my ($home,$other,%outhash)=&authorhosts();
my $type = &Apache::loncommon::course_type();
if ($home+$other==0) { return ''; }
- my $output='
';
if ($home) {
- return ' | '.
+ return ' '.
''.
- &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs');
+ &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').
+ ' ';
} else {
- return' | '.
+ return ' '.
&mt('Dump '.$type.
- ' DOCS to Construction Space: available on other servers');
+ ' DOCS to Construction Space: available on other servers').
+ ' ';
}
}
@@ -199,9 +200,9 @@ sub dumpcourse {
$fail=1;
}
if ($fail) {
- $r->print('fail');
+ $r->print(''.&mt('fail').'');
} else {
- $r->print('ok');
+ $r->print(''.&mt('ok').'');
}
}
} else {
@@ -235,7 +236,6 @@ sub dumpcourse {
my ($ext)=($_=~/\.(\w+)$/);
my $title=$hash{'title_'.$hash{
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}};
- $title=~s/:/:/g;
$r->print(' | '.($title?$title:' ').' | ');
if (!$title) {
$title=$_;
@@ -258,10 +258,10 @@ sub dumpcourse {
sub exportbutton {
my $type = &Apache::loncommon::course_type();
- return ''.
+ return ' '.
''.
- &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs');
+ &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').' ';
}
sub exportcourse {
@@ -380,7 +380,7 @@ sub exportcourse {
}
$display .= ' />'."\n";
for (my $i=0; $i<$depth; $i++) {
- $display .= '![](/adm/lonIcons/whitespace1.gif) '."\n";
+ $display .= '![](/adm/lonIcons/whitespace1.gif) '."\n";
}
if ($curRes->is_sequence()) {
$display .= ' '."\n";
@@ -905,15 +905,16 @@ sub store_template {
# Imports the given (name, url) resources into the course
# coursenum, coursedom, and folder must precede the list
sub group_import {
- my $coursenum = shift;
- my $coursedom = shift;
- my $folder = shift;
- my $container = shift;
- my $caller = shift;
- while (@_) {
- my $name = shift;
- my $url = shift;
- if (($url =~ m#^/uploaded/$coursedom/$coursenum/(default_\d+\.)(page|sequence)$#) && ($caller eq 'londocs')) {
+ 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
+ if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$})
+ && ($caller eq 'londocs')
+ && (!&Apache::lonnet::stat_file($url))) {
+
my $errtext = '';
my $fatal = 0;
my $newmapstr = ' |