--- loncom/interface/lonwishlist.pm 2010/08/17 12:32:58 1.5 +++ loncom/interface/lonwishlist.pm 2010/08/20 10:38:41 1.7 @@ -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.7 2010/08/20 10:38: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(< 'javascript:onLoadAction('."'".$mode."'".');', 'onunload' => 'javascript:window.name = '."'loncapaclient'"}}); - my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Wishlist '.&Apache::loncommon::help_open_topic('Wishlist')); + my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(&mt('Wishlist').&Apache::loncommon::help_open_topic('Wishlist')); # get javascript-code for wishlist-interactions my $js = &JSforWishlist(); @@ -1599,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; @@ -1652,10 +1708,7 @@ sub makeErrorPage { text => 'Wishlist'}); my $startPage = &Apache::loncommon::start_page('Wishlist'); - my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Wishlist '. - ''. - ''.&mt('Help').''); + my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(&mt('Wishlist').&Apache::loncommon::help_open_topic('Wishlist')); &Apache::lonhtmlcommon::clear_breadcrumbs(); # error-message @@ -1688,7 +1741,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 +1828,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();