'.
- 'Dump Course DOCS to Construction Space: available on other servers';
+ &mt('Dump Course DOCS to Construction Space: available on other servers');
}
}
# -------------------------------------------------------- Actually dump course
sub dumpcourse {
+ my $r=shift;
+ $r->print('Dump DOCS'.
+ &Apache::loncommon::bodytag('Dump Course DOCS to Construction Space').
+ '');
+ }
+}
+
+# ------------------------------------------------------ Generate "export" button
+
+sub exportbutton {
+ return '
'.
+ ''.
+ &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs');
+}
+
+sub exportcourse {
+ my $r=shift;
+ 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 $navmap = Apache::lonnavmaps::navmap->new();
+ my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
+ my $curRes;
+
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+ ['finishexport']);
+ if ($ENV{'form.finishexport'}) {
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+ ['archive','discussion']);
+
+ my @exportitems = ();
+ if (defined($ENV{'form.archive'})) {
+ if (ref($ENV{'form.archive'}) eq 'ARRAY') {
+ @exportitems = @{$ENV{'form.archive'}};
+ } else {
+ $exportitems[0] = $ENV{'form.archive'};
+ }
+ }
+ my @discussions = ();
+ if (defined($ENV{'form.discussion'})) {
+ if (ref($ENV{'form.discussion'}) eq 'ARRAY') {
+ @discussions = $ENV{'form.discussion'};
+ } else {
+ $discussions[0] = $ENV{'form.discussion'};
+ }
+ }
+ my $curRes;
+ my $count;
+ my %symbs;
+ my $display;
+ while ($curRes = $it->next()) {
+ if (ref($curRes)) {
+ $count ++;
+ $symbs{$count} = $curRes->symb();
+ if (grep/^$count$/,@exportitems) {
+ $display.= 'Export content item '.$curRes->title()." \n";
+ }
+ if (grep/^$count$/,@discussions) {
+ $display.= 'Export discussion posts '.$curRes->title()." \n";
+ }
+ }
+ }
+
+ $r->print('Export Course'.
+ &Apache::loncommon::bodytag('Export course to IMS or SCORM content package'
+));
+
+ my $exportfile;
+ $r->print($display);
+ $r->print('');
+ } else {
+ my $display;
+ $display = '