--- loncom/imspackages/imsexport.pm 2012/01/29 19:51:01 1.8
+++ loncom/imspackages/imsexport.pm 2012/03/31 12:02:29 1.9
@@ -1,6 +1,6 @@
# The LearningOnline Network
#
-# $Id: imsexport.pm,v 1.8 2012/01/29 19:51:01 raeburn Exp $
+# $Id: imsexport.pm,v 1.9 2012/03/31 12:02:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -32,6 +32,7 @@ use Apache::lonnet;
use Apache::loncommon;
use Apache::lonhtmlcommon;
use Apache::lonnavmaps;
+use Apache::loncourserespicker;
use Apache::lonlocal;
use Cwd;
use LONCAPA qw(:DEFAULT :match);
@@ -39,40 +40,18 @@ use LONCAPA qw(:DEFAULT :match);
sub exportcourse {
my $r=shift;
my $crstype = &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);
- my $numprobs = 0;
- my $navmap = Apache::lonnavmaps::navmap->new();
- if (!defined($navmap)) {
- $r->print(&Apache::loncommon::start_page('Export '.$crstype.' to IMS Package').
- '
'.&mt('IMS Export Failed').'
'.
- '');
- if ($crstype eq 'Community') {
- $r->print(&mt('Unable to retrieve information about community contents'));
- } else {
- $r->print(&mt('Unable to retrieve information about course contents'));
- }
- $r->print('
');
- if ($crstype eq 'Community') {
- $r->print(&mt('Return to Community Editor'));
- } else {
- $r->print(&mt('Return to Course Editor'));
- }
- $r->print('');
- &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
+ my ($navmap,$errormsg) =
+ &Apache::loncourserespicker::get_navmap_object($crstype,'imsexport');
+ unless (ref($navmap)) {
+ $r->print($errormsg);
return;
}
- my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
- my $curRes;
- my $outcome;
-
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['finishexport']);
if ($env{'form.finishexport'}) {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['archive','discussion']);
-
+ my $outcome;
my $format = $env{'form.format'};
my @exportitems = &Apache::loncommon::get_env_multiple('form.archive');
my @discussions = &Apache::loncommon::get_env_multiple('form.discussion');
@@ -138,181 +117,10 @@ sub exportcourse {
$r->print($outcome);
$r->print(&Apache::loncommon::end_page());
} else {
- my $display='');
+ $r->print(&Apache::loncourserespicker::create_picker($navmap,'imsexport',
+ 'exportdoc',$crstype));
}
-}
-
-sub export_javascript {
- my ($startcount,$numitems,%children) = @_;
- my $scripttag = <<"START";
-
-
-END
- return $scripttag;
+ return;
}
sub create_ims_store {
@@ -1075,8 +883,6 @@ described at http://www.lon-capa.org.
=item exportcourse()
-=item export_javascript()
-
=item create_ims_store()
=item build_package()