Diff for /loncom/interface/portfolio.pm between versions 1.121.2.3 and 1.122

version 1.121.2.3, 2006/06/28 19:57:44 version 1.122, 2006/06/27 15:37:17
Line 1 Line 1
 # The LearningOnline Network  
 # portfolio browser  
 #  
 # $Id$  
 #  
 # Copyright Michigan State University Board of Trustees  # Copyright Michigan State University Board of Trustees
 #  #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).  # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
Line 224  sub display_directory { Line 219  sub display_directory {
                 }                  }
                my $fullpath = $current_path.$filename;                 my $fullpath = $current_path.$filename;
                 $fullpath = &prepend_group($fullpath,$group);                  $fullpath = &prepend_group($fullpath,$group);
                 if ($select_mode eq 'true') {                  if ($select_mode eq 'true'){
                     $line='<td><input type="checkbox" name="checkfile" value="'.$filename.'"';                      $line='<td><input type="checkbox" name="checkfile" value="'.$filename.'"';
     if ($$checked_files{$filename} eq 'selected') {      if ($$checked_files{$filename} eq 'selected') {
                         $line.=" checked ";                          $line.=" checked ";
Line 251  sub display_directory { Line 246  sub display_directory {
                         }                          }
                         $line .= '</td>';                          $line .= '</td>';
                     }                      }
       $r->print('<tr class="'.$css_class.'">');
       $r->print($line);
                   }
                   my $curr_access;
                   my $pub_access = 0;
                   my $guest_access = 0;
                   my $cond_access = 0;
                   foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) {
                       my ($num,$scope,$end,$start) = &unpack_acc_key($key);
                       if (($now > $start) && (!$end || $end > $now)) {
                           if ($scope eq 'public')  {
                               $pub_access = 1;
                           } elsif ($scope eq 'guest') {
                               $guest_access = 1;
                           } else {
                               $cond_access = 1;
                           }
                       }
                   }
                   if (!$pub_access && !$guest_access && !$cond_access) {
                       $curr_access = &mt('Private');
                   } else {
                       my @allaccesses; 
                       if ($pub_access) {
                           push(@allaccesses,&mt('Public'));
                       }
                       if ($guest_access) {
                           push(@allaccesses,&mt('Passphrase-protected'));
                       }
                       if ($cond_access) {
                           push(@allaccesses,&mt('Conditional'));
                       }
                       $curr_access = join('+ ',@allaccesses);
                 }                  }
  $r->print('<tr class="'.$css_class.'">');                  $r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');
  $r->print($line);                  $r->print('<td><a href="'.$href_location.$filename.'">'.
  my $curr_access;      $filename.'</a></td>'); 
  if ($select_mode ne 'true') {                  $r->print('<td>'.$size.'</td>');
     my $pub_access = 0;                  $r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');
     my $guest_access = 0;                  $r->print('<td><span style="white-space: nowrap">'.
     my $cond_access = 0;                            &mt($curr_access).'&nbsp;&nbsp;&nbsp;');
     foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) {                  $r->print('<a href="'.$url.'?access='.$filename.
  my ($num,$scope,$end,$start) = &unpack_acc_key($key);                                '&amp;currentpath='.$current_path.$groupecho.
  if (($now > $start) && (!$end || $end > $now)) {                                '">'.$access_admin_text.'</a>');
     if ($scope eq 'public')  {                  $r->print('</span></td></tr>');
  $pub_access = 1;  
     } elsif ($scope eq 'guest') {  
  $guest_access = 1;  
     } else {  
  $cond_access = 1;  
     }  
  }  
     }  
     if (!$pub_access && !$guest_access && !$cond_access) {  
  $curr_access = &mt('Private');  
     } else {  
  my @allaccesses;   
  if ($pub_access) {  
     push(@allaccesses,&mt('Public'));  
  }  
  if ($guest_access) {  
     push(@allaccesses,&mt('Passphrase-protected'));  
  }  
  if ($cond_access) {  
     push(@allaccesses,&mt('Conditional'));  
  }  
  $curr_access = join('+ ',@allaccesses);  
     }  
  }  
  $r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');  
  $r->print('<td><a href="'.$href_location.$filename.'">'.  
   $filename.'</a></td>');   
  $r->print('<td>'.$size.'</td>');  
  $r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');  
  if ($select_mode ne 'true') {  
     $r->print('<td><span style="white-space: nowrap">'.  
       &mt($curr_access).'&nbsp;&nbsp;&nbsp;');  
     $r->print('<a href="'.$url.'?access='.$filename.  
       '&amp;currentpath='.$current_path.$groupecho.  
       '">'.$access_admin_text.'</a></span>');  
  }  
  $r->print('</td></tr>'.$/);  
             }              }
         }          }
     }      }

Removed from v.1.121.2.3  
changed lines
  Added in v.1.122


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