--- loncom/interface/londocs.pm 2004/12/10 20:47:33 1.153 +++ loncom/interface/londocs.pm 2005/01/30 12:51:21 1.165 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.153 2004/12/10 20:47:33 albertel Exp $ +# $Id: londocs.pm,v 1.165 2005/01/30 12:51:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,6 +30,7 @@ package Apache::londocs; use strict; use Apache::Constants qw(:common :http); +use Apache::imsexport; use Apache::lonnet; use Apache::loncommon; use Apache::lonratedt; @@ -131,6 +132,11 @@ sub dumpbutton { } } +sub clean { + my ($title)=@_; + $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs; + return $title; +} # -------------------------------------------------------- Actually dump course sub dumpcourse { @@ -148,7 +154,7 @@ sub dumpcourse { my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'}); $r->print('
'.&mt('Internal Filename').' | '.&mt('Title').' | '.&mt('Save as ...').' | '.($title?$title:' ').' | '); unless ($title) { $title=$_; } $title=~s/\.(\w+)$//; - $title=~s/[^\w\/]+/\_/gs; + $title=&clean($title); $title.='.'.$ext; $r->print("\n\n"); } @@ -241,6 +248,7 @@ sub dumpcourse { # ------------------------------------------------------ Generate "export" button sub exportbutton { + return ''; return ' | '.
''.
@@ -283,7 +291,6 @@ sub exportcourse {
$outcome = ' As you did not select any content items or discussions for export, an IMS package has not been created. Please go back to select either content items or discussions for export'; } else { my $now = time; - my $count = 0; my %symbs; my $manifestok = 0; my $imsresources; @@ -291,7 +298,7 @@ sub exportcourse { my $copyresult; my $ims_manifest = &create_ims_store($now,\$manifestok,\$outcome,\$tempexport); if ($manifestok) { - &build_package($now,$navmap,\@exportitems,\@discussions,\$outcome,\$tempexport,\$copyresult,$ims_manifest); + &build_package($now,$navmap,\@exportitems,\@discussions,\$outcome,$tempexport,\$copyresult,$ims_manifest); close($ims_manifest); #Create zip file in prtspool @@ -320,7 +327,7 @@ sub exportcourse { } $r->print(' |
---|