Diff for /loncom/interface/loncourserespicker.pm between versions 1.13 and 1.14

version 1.13, 2015/06/09 21:22:56 version 1.14, 2016/10/16 21:49:51
Line 75  select items.  Checking a folder causes Line 75  select items.  Checking a folder causes
 within the folder. Unchecking a resource causing unchecking of folders  within the folder. Unchecking a resource causing unchecking of folders
 containing the item back up to the top level.  containing the item back up to the top level.
   
 Inputs: 9.  Inputs: 11.
    - $navmap  -- Reference to LON-CAPA navmap object      - $navmap  -- Reference to LON-CAPA navmap object 
                 (encapsulates information about resources in the course).                   (encapsulates information about resources in the course). 
   
Line 106  Inputs: 9. Line 106  Inputs: 9.
   
    - $uploadedfiles -- Reference to hash: keys are paths to files in     - $uploadedfiles -- Reference to hash: keys are paths to files in
                        /home/httpd/lonUsers/$cdom/$1/$2/$3/$cnum/userfiles.                         /home/httpd/lonUsers/$cdom/$1/$2/$3/$cnum/userfiles.
      
      - $readonly -- if true, no "check all" or "uncheck all" buttons will
                     be displayed, and checkboxes will be disabled, if this 
                     is for an exam block.
   
   
 Output: $output is the HTML mark-up for display/selection of content  Output: $output is the HTML mark-up for display/selection of content
Line 206  use Apache::lonlocal; Line 210  use Apache::lonlocal;
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
   
 sub create_picker {  sub create_picker {
     my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,$numhome,$uploadedfiles) = @_;      my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,
           $numhome,$uploadedfiles,$readonly) = @_;
     return unless (ref($navmap));      return unless (ref($navmap));
     my ($it,$output,$numdisc,%maps,%resources,%discussiontime,%currmaps,%currresources,%files);      my ($it,$output,$numdisc,%maps,%resources,%discussiontime,%currmaps,%currresources,%files);
     $it = $navmap->getIterator(undef,undef,undef,1,undef,undef);      $it = $navmap->getIterator(undef,undef,undef,1,undef,undef);
Line 236  sub create_picker { Line 241  sub create_picker {
     my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};      my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
     my $crsprefix = &propath($cdom,$cnum).'/userfiles/';      my $crsprefix = &propath($cdom,$cnum).'/userfiles/';
   
     my ($info,$display,$onsubmit,$togglebuttons);      my ($info,$display,$onsubmit,$togglebuttons,$disabled);
     if ($context eq 'examblock') {      if ($context eq 'examblock') {
         my $maps_elem = 'docs_maps_'.$block;          my $maps_elem = 'docs_maps_'.$block;
         my $res_elem = 'docs_resources_'.$block;          my $res_elem = 'docs_resources_'.$block;
         $onsubmit = ' onsubmit="return writeToOpener('."'$maps_elem','$res_elem'".');"';          $onsubmit = ' onsubmit="return writeToOpener('."'$maps_elem','$res_elem'".');"';
         $info = &mt('Items in '.lc($crstype).' for which access will be blocked.');          $info = &mt('Items in '.lc($crstype).' for which access will be blocked.');
           if ($readonly) {
               $disabled = ' disabled="disabled"';
           }
     }      }
     if ($context eq 'dumpdocs') {      if ($context eq 'dumpdocs') {
         $info = '<span class="LC_fontsize_medium">'.          $info = '<span class="LC_fontsize_medium">'.
Line 253  sub create_picker { Line 261  sub create_picker {
         $info = &mt('Choose which items you wish to export from your '.$crstype.'.');          $info = &mt('Choose which items you wish to export from your '.$crstype.'.');
         $startcount = 5;          $startcount = 5;
     }      }
     $togglebuttons = '<input type="button" value="'.&mt('check all').'" '.      if ($disabled) {
                      'onclick="javascript:checkAll(document.'.$formname.'.archive)" />'.          $togglebuttons = '<br />';
                      '&nbsp;&nbsp;<input type="button" value="'.&mt('uncheck all').'"'.      } else {
                      ' onclick="javascript:uncheckAll(document.'.$formname.'.archive)" />';          $togglebuttons = '<input type="button" value="'.&mt('check all').'" '.
                            'onclick="javascript:checkAll(document.'.$formname.'.archive)" />'.
                            '&nbsp;&nbsp;<input type="button" value="'.&mt('uncheck all').'"'.
                            ' onclick="javascript:uncheckAll(document.'.$formname.'.archive)" />';
       }
     $display = '<form name="'.$formname.'" action="" method="post"'.$onsubmit.'>'."\n";      $display = '<form name="'.$formname.'" action="" method="post"'.$onsubmit.'>'."\n";
     if ($context eq 'imsexport') {      if ($context eq 'imsexport') {
         $display .= $info.          $display .= $info.
Line 353  sub create_picker { Line 365  sub create_picker {
                     $display .= 'checked="checked"';                      $display .= 'checked="checked"';
                 }                  }
             }              }
             $display .= ' />'."\n";              $display .= $disabled.' />'."\n";
             if ($context eq 'dumpdocs') {              if ($context eq 'dumpdocs') {
                 $display .= '</td><td valign="top">';                  $display .= '</td><td valign="top">';
             }              }
Line 450  sub create_picker { Line 462  sub create_picker {
            &mt('Export').'" /></p>';             &mt('Export').'" /></p>';
         $numcount = $count + $boards + $startcount;          $numcount = $count + $boards + $startcount;
     } elsif ($context eq 'examblock') {      } elsif ($context eq 'examblock') {
         $display .=          unless ($readonly) {
             '<p>'.              $display .=
             '<input type="submit" name="resourceblocks" value="'.                  '<p>'.
             &mt('Copy Choices to Main Window').'" /></p>';                  '<input type="submit" name="resourceblocks" value="'.
                   &mt('Copy Choices to Main Window').'" /></p>';
           }
         $numcount = $count + $startcount;          $numcount = $count + $startcount;
     } elsif ($context eq 'dumpdocs') {      } elsif ($context eq 'dumpdocs') {
         $display .= '</fieldset>'.          $display .= '</fieldset>'.

Removed from v.1.13  
changed lines
  Added in v.1.14


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