--- loncom/interface/lonwishlist.pm 2010/08/17 12:32:58 1.5 +++ loncom/interface/lonwishlist.pm 2010/08/20 08:13:41 1.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the wishlist # -# $Id: lonwishlist.pm,v 1.5 2010/08/17 12:32:58 wenzelju Exp $ +# $Id: lonwishlist.pm,v 1.6 2010/08/20 08:13:41 wenzelju Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1066,20 +1066,6 @@ sub JSforWishlist { newWin.focus(); } - function finish_import() { - opener.document.forms.simpleedit.importdetail.value=''; - for (var num = 0; num < document.forms.groupsort.fnum.value; num++) { - if (eval("document.forms.groupsort.check"+num+".checked") && eval("document.forms.groupsort.filelink"+num+".value") != '') { - opener.document.forms.simpleedit.importdetail.value+='&'+ - eval("document.forms.groupsort.title"+num+".value")+'='+ - eval("document.forms.groupsort.filelink"+num+".value")+'='+ - eval("document.forms.groupsort.id"+num+".value"); - } - } - opener.document.forms.simpleedit.submit(); - self.close(); - } - function checkAll() { var checkboxes = document.getElementsByName('check'); for (var i = 0; i < checkboxes.length; i++) { @@ -1098,6 +1084,68 @@ JAVASCRIPT return $js; } +sub JSforImport{ + my $rat = shift; + + my $js; + if ($rat eq 'simple' || $rat eq '') { + $js = &Apache::lonhtmlcommon::scripttag(< 1}); # get javascript-code for wishlist-interactions my $js = &JSforWishlist(); + $js .= &JSforImport($rat); my $inner = '

'.&mt('Import Resources from Wishlist').'

'; - $inner .= '

'.&mt("Please note that you can use the checkboxes corresponding to a folder to ". - "easily check all links within this folder. The folder structure itself can't be imported. ". - "All checked links will be imported into the current folder of your course.").'

'; - + if (!$rat) { + $inner .= '

'.&mt("Please note that you can use the checkboxes corresponding to a folder to ". + "easily check all links within this folder. The folder structure itself can't be imported. ". + "All checked links will be imported into the current folder of your course.").'

'; + } + else { + $inner .= '

'.&mt("Please note that you can use the checkboxes corresponding to a folder to ". + "easily check all links within this folder. The folder structure itself can't be imported. ") + .'

'; + } my %wishlist = &getWishlist(); my $fnum = (keys %wishlist)-1; @@ -1688,7 +1744,7 @@ sub handler { } # get unprocessed_cgi (i.e. marked entries, mode ...) - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action','mark','markedToMove','mode','newtitle','note']); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action','mark','markedToMove','mode','newtitle','note','rat']); # change the order of entries within a level, that means sorting the entries my $changeOrder = 0; @@ -1775,7 +1831,7 @@ sub handler { $page = &makePage("move", \@marked); } elsif ($env{'form.mode'} eq 'import') { - $page = &makePageImport(); + $page = &makePageImport($env{'form.rat'}); } elsif ($env{'form.mode'} eq 'set') { $page = &makePageSet();