--- loncom/interface/londocs.pm 2005/11/04 21:36:56 1.209
+++ loncom/interface/londocs.pm 2006/11/11 18:36:43 1.246
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.209 2005/11/04 21:36:56 albertel Exp $
+# $Id: londocs.pm,v 1.246 2006/11/11 18:36:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,15 +33,16 @@ use Apache::Constants qw(:common :http);
use Apache::imsexport;
use Apache::lonnet;
use Apache::loncommon;
-use Apache::lonratedt;
-use Apache::lonratsrv;
+use LONCAPA::map();
+use Apache::lonratedt();
use Apache::lonxml;
-use Apache::loncreatecourse;
+use Apache::lonclonecourse;
use Apache::lonnavmaps;
use HTML::Entities;
use GDBM_File;
use Apache::lonlocal;
use Cwd;
+use LONCAPA;
my $iconpath;
@@ -56,7 +57,7 @@ my $hadchanges;
my %help=();
-# Mapread read maps into lonratedt::global arrays
+# Mapread read maps into LONCAPA::map:: global arrays
# @order and @resources, determines status
# sets @order - pointer to resources in right order
# sets @resources - array with the resources with correct idx
@@ -65,15 +66,15 @@ my %help=();
sub mapread {
my ($coursenum,$coursedom,$map)=@_;
return
- &Apache::lonratedt::mapread('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
- $map);
+ &LONCAPA::map::mapread('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
+ $map);
}
sub storemap {
my ($coursenum,$coursedom,$map)=@_;
my ($outtext,$errtext)=
- &Apache::lonratedt::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
- $map,1);
+ &LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'.
+ $map,1);
if ($errtext) { return ($errtext,2); }
$hadchanges=1;
@@ -119,16 +120,18 @@ sub authorhosts {
sub dumpbutton {
my ($home,$other,%outhash)=&authorhosts();
+ my $type = &Apache::loncommon::course_type();
if ($home+$other==0) { return ''; }
my $output='
';
if ($home) {
return '
'.
''.
+ &mt('Dump '.$type.' DOCS to Construction Space').'" />'.
&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs');
} else {
return'
'.
- &mt('Dump Course DOCS to Construction Space: available on other servers');
+ &mt('Dump '.$type.
+ ' DOCS to Construction Space: available on other servers');
}
}
@@ -140,10 +143,9 @@ sub clean {
# -------------------------------------------------------- Actually dump course
sub dumpcourse {
- my $r=shift;
- my $html=&Apache::lonxml::xmlbegin();
- $r->print($html.'Dump DOCS'.
- &Apache::loncommon::bodytag('Dump Course DOCS to Construction Space').
+ my ($r) = @_;
+ my $type = &Apache::loncommon::course_type();
+ $r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space').
'');
+ '');
}
}
# ------------------------------------------------------ Generate "export" button
sub exportbutton {
+ my $type = &Apache::loncommon::course_type();
return '
'.
''.
+ &mt('Export '.$type.' to IMS').'" />'.
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs');
}
sub exportcourse {
my $r=shift;
+ my $type = &Apache::loncommon::course_type();
my %discussiontime = &Apache::lonnet::dump('discussiontimes',
$env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'});
my $numdisc = keys %discussiontime;
@@ -300,7 +306,7 @@ sub exportcourse {
open(OUTPUT, "zip -r $imszip * 2> /dev/null |");
close(OUTPUT);
chdir $cwd;
- $outcome .= 'Download the zip file from IMS course archive ';
+ $outcome .= &mt('Download the zip file from IMS '.lc($type).' archive ',$imszipfile,);
if ($copyresult) {
$outcome .= 'The following errors occurred during export - '.$copyresult;
}
@@ -308,15 +314,13 @@ sub exportcourse {
$outcome = ' Unfortunately you will not be able to retrieve an IMS archive of this posts at this time, because there was a problem creating a manifest file. ';
}
}
- my $html=&Apache::lonxml::xmlbegin();
- $r->print($html.'Export Course'.
- &Apache::loncommon::bodytag('Export course to IMS content package'));
+ $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'));
$r->print($outcome);
- $r->print('