--- loncom/interface/lonwishlist.pm 2010/08/16 15:14:37 1.4 +++ 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.4 2010/08/16 15:14:37 wenzelju Exp $ +# $Id: lonwishlist.pm,v 1.6 2010/08/20 08:13:41 wenzelju Exp $ # # Copyright Michigan State University Board of Trustees # @@ -637,6 +637,9 @@ sub JSforWishlist { else if (action == 'saveOK') { r = linksOK(); } + else if (action == 'move') { + r = selectDestinationFolder(); + } document.getElementsByName('list')[0].setAttribute("action", "/adm/wishlist?mode="+mode); if (r) { document.getElementsByName('list')[0].submit(); @@ -1063,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++) { @@ -1095,6 +1084,68 @@ JAVASCRIPT return $js; } +sub JSforImport{ + my $rat = shift; + + my $js; + if ($rat eq 'simple' || $rat eq '') { + $js = &Apache::lonhtmlcommon::scripttag(<

'; &wishlistMove(\@childrenRt, $marked); $inner .= ''.$wishlistHTMLmove.'


'; - $inner .= ''. + $inner .= ''. ''; $wishlistHTMLmove =''. @@ -1596,18 +1647,26 @@ sub makePageSet { # Returns the HTML-Markup for the page, shown when links should be imported into a course sub makePageImport { + my $rat = shift; # start_page my $startPage = &Apache::loncommon::start_page('Wishlist',undef, {'only_body' => 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; @@ -1685,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; @@ -1772,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();