Diff for /loncom/interface/lonwishlist.pm between versions 1.5 and 1.6

version 1.5, 2010/08/17 12:32:58 version 1.6, 2010/08/20 08:13:41
Line 1066  sub JSforWishlist { Line 1066  sub JSforWishlist {
        newWin.focus();         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() {      function checkAll() {
         var checkboxes = document.getElementsByName('check');          var checkboxes = document.getElementsByName('check');
         for (var i = 0; i < checkboxes.length; i++) {          for (var i = 0; i < checkboxes.length; i++) {
Line 1098  JAVASCRIPT Line 1084  JAVASCRIPT
    return $js;     return $js;
 }  }
   
   sub JSforImport{
       my $rat = shift;
   
       my $js;
       if ($rat eq 'simple' || $rat eq '') {
           $js = &Apache::lonhtmlcommon::scripttag(<<JAVASCRIPT);
           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();
           }
   JAVASCRIPT
       }
       else {
           $js = &Apache::lonhtmlcommon::scripttag(<<JAVASCRIPT);
           function finish_import() {
               var linkflag=false;
               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") != '') {
                       insertRowInLastRow();
                       placeResourceInLastRow(
                           eval("document.forms.groupsort.title"+num+".value"),
                           eval("document.forms.groupsort.filelink"+num+".value"),
                           eval("document.forms.groupsort.id"+num+".value"),
                           linkflag
                           );
                       linkflag=true;
                   }
               }
               opener.editmode=0;
               opener.notclear=0;
               opener.linkmode=0;
               opener.draw();
               self.close();
           }
   
           function insertRowInLastRow() {
               opener.insertrow(opener.maxrow);
               opener.addobj(opener.maxrow,'e&2');
           }
   
           function placeResourceInLastRow (title,url,id,linkflag) {
               opener.mostrecent=opener.newresource(opener.maxrow,2,opener.unescape(title),
                                 opener.unescape(url),'false','normal',id);
               opener.save();
               if (linkflag) {
                   opener.joinres(opener.linkmode,opener.mostrecent,0);
               }
               opener.linkmode=opener.mostrecent;
           }
   JAVASCRIPT
       }
       return $js;
   }
   
 # HTML-Markup for table if in view-mode  # HTML-Markup for table if in view-mode
 my $wishlistHTMLview;  my $wishlistHTMLview;
Line 1599  sub makePageSet { Line 1647  sub makePageSet {
   
 # Returns the HTML-Markup for the page, shown when links should be imported into a course  # Returns the HTML-Markup for the page, shown when links should be imported into a course
 sub makePageImport {  sub makePageImport {
       my $rat = shift;
     # start_page       # start_page 
     my $startPage = &Apache::loncommon::start_page('Wishlist',undef,      my $startPage = &Apache::loncommon::start_page('Wishlist',undef,
                                                    {'only_body' => 1});                                                     {'only_body' => 1});
           
     # get javascript-code for wishlist-interactions      # get javascript-code for wishlist-interactions
     my $js = &JSforWishlist();      my $js = &JSforWishlist();
       $js .= &JSforImport($rat);
   
     my $inner = '<h1>'.&mt('Import Resources from Wishlist').'</h1>';      my $inner = '<h1>'.&mt('Import Resources from Wishlist').'</h1>';
     $inner .= '<p><span class="LC_info">'.&mt("Please note that you  can use the checkboxes corresponding to a folder to ".      if (!$rat) {
                                               "easily check all links within this folder. The folder structure itself can't be imported. ".          $inner .= '<p><span class="LC_info">'.&mt("Please note that you  can use the checkboxes corresponding to a folder to ".
                                               "All checked links will be imported into the current folder of your course.").'</span></p>';                                                    "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.").'</span></p>';
       }
       else {
           $inner .= '<p><span class="LC_info">'.&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. ")
                                                     .'</span></p>';
       }
     my %wishlist = &getWishlist();      my %wishlist = &getWishlist();
     my $fnum = (keys %wishlist)-1;      my $fnum = (keys %wishlist)-1;
   
Line 1688  sub handler { Line 1744  sub handler {
         }          }
   
         # get unprocessed_cgi (i.e. marked entries, mode ...)           # 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          # change the order of entries within a level, that means sorting the entries
         my $changeOrder = 0;          my $changeOrder = 0;
Line 1775  sub handler { Line 1831  sub handler {
             $page = &makePage("move", \@marked);              $page = &makePage("move", \@marked);
         }          }
         elsif ($env{'form.mode'} eq 'import') {          elsif ($env{'form.mode'} eq 'import') {
             $page = &makePageImport();              $page = &makePageImport($env{'form.rat'});
         }          }
         elsif ($env{'form.mode'} eq 'set') {          elsif ($env{'form.mode'} eq 'set') {
             $page = &makePageSet();              $page = &makePageSet();

Removed from v.1.5  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>