--- loncom/imspackages/imsimport.pm 2012/10/29 17:38:59 1.38 +++ loncom/imspackages/imsimport.pm 2023/07/23 13:33:52 1.49 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: imsimport.pm,v 1.38 2012/10/29 17:38:59 raeburn Exp $ +# $Id: imsimport.pm,v 1.49 2023/07/23 13:33:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,6 +38,7 @@ use HTML::Entities(); use Apache::lonlocal; use Apache::lonupload; use File::Basename(); +use File::Path(); use LONCAPA; # ---------------------------------------------------------------- Jscript One @@ -57,22 +58,26 @@ sub jscript_one { my $end_page = &Apache::loncommon::end_page({'js_ready' => 1,}); - my %lt = &Apache::lonlocal::texthash( + my %js_lt = &Apache::lonlocal::texthash( ddir => 'You must choose a destination directory for the import', cmss => 'You must choose the Course Management System from which the IMS package was exported', + ); + my %html_lt = &Apache::lonlocal::texthash( loca => 'Location:', newd => 'New Directory', nndi => 'Enter the name of the new directory where you will store the contents of your IMS package.', go => 'Go', ); + &js_escape(\%js_lt); + &html_escape(\%html_lt); return <<"END_OF_ONE"; function verify() { if ((document.forms.$formname.newdir.value == '') || (!document.forms.$formname.newdir.value)) { - alert('$lt{'ddir'}') + alert('$js_lt{'ddir'}') return false } if (document.forms.$formname.source.selectedIndex == 0) { - alert('$lt{'cmss'}'); + alert('$js_lt{'cmss'}'); return false } return true @@ -92,15 +97,15 @@ function createWin() { newWindow.document.write("\\n\\n") newWindow.document.write("
\\n") - newWindow.document.write(" | $lt{'loca'} $fullpath$lt{'newd'} | $html_lt{'loca'} $fullpath$html_lt{'newd'} | \\n")
newWindow.document.write("
\\n") newWindow.document.write(" |