--- loncom/imspackages/imsimport.pm 2008/08/24 13:48:40 1.23 +++ loncom/imspackages/imsimport.pm 2017/11/05 20:04:30 1.48 @@ -1,3 +1,7 @@ +# The LearningOnline Network with CAPA +# +# $Id: imsimport.pm,v 1.48 2017/11/05 20:04:30 raeburn Exp $ +# # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). @@ -25,7 +29,6 @@ package Apache::imsimport; use strict; use Apache::Constants qw(:common :http :methods); -use Apache::loncacc; use Apache::loncommon(); use Apache::lonnet; use Apache::imsprocessor; @@ -35,11 +38,12 @@ use HTML::Entities(); use Apache::lonlocal; use Apache::lonupload; use File::Basename(); +use File::Path(); use LONCAPA; # ---------------------------------------------------------------- Jscript One sub jscript_one { - my ($fullpath,$jsref,$formname) = @_; + my ($fullpath,$formname) = @_; my %body_layout = ('rightmargin' => "0", 'leftmargin' => "0", @@ -54,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', ); - $$jsref = <<"END_OF_ONE"; + &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 @@ -86,18 +94,18 @@ function createWin() { newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes") newWindow.document.open() newWindow.document.write('$start_page') - newWindow.document.write("\\n\\n") + 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(" |