Diff for /loncom/interface/portfolio.pm between versions 1.151 and 1.155

version 1.151, 2006/08/08 21:34:05 version 1.155, 2006/08/12 22:41:53
Line 167  sub display_directory_line { Line 167  sub display_directory_line {
     my ($r,$select_mode,$fullpath, $filename, $mtime, $size, $css_class,      my ($r,$select_mode,$fullpath, $filename, $mtime, $size, $css_class,
  $line, $access_controls, $curr_access, $now, $version_flag,   $line, $access_controls, $curr_access, $now, $version_flag,
  $href_location, $url, $current_path, $access_admin_text, $versions)=@_;   $href_location, $url, $current_path, $access_admin_text, $versions)=@_;
     my %anchor_fields;  
     # my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);       # my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); 
     $r->print('<tr class="'.$css_class.'">');      $r->print('<tr class="'.$css_class.'">');
     $r->print($line);      $r->print($line); # contains first two cells of table
     $r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');      $filename = $filename;
     $r->print('<td>'.$$version_flag{$filename}.'</td><td>');      $filename = &prepend_group($filename);
     $r->print(&make_anchor($href_location.$filename,undef,$filename).'</td>');       my $lock_info;
       if ($$version_flag{$filename}) { # versioned can't be versioned, so TRUE when root file
           $r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');
           $r->print('<td>'.$$version_flag{$filename}.'</td>');
       } else { # this is a graded or handed back file
           my ($user,$domain) = &get_name_dom();
           my $permissions_hash = &Apache::lonnet::get_portfile_permissions($domain,$user);
           if (defined($filename) && defined($$permissions_hash{'/'.$filename})) {
               foreach my $array_item (@{$$permissions_hash{'/'.$filename}}) {
                   if (ref($array_item) eq 'ARRAY') {
                       if ($$array_item[(@$array_item - 1)] eq 'handback') {
                           $lock_info = 'Handback';
                       } elsif ($$array_item[(@$array_item - 1)] eq 'graded') {
                           $lock_info = 'Graded';
                       }
                    }
               }
           }
               if ($lock_info) {
                   my %anchor_fields = (
                       'lockinfo' => '/'.$filename
                   );
                   $lock_info = &make_anchor(undef,\%anchor_fields,$lock_info);
               }
               $r->print('<td colspan="2">'.$lock_info.'</td>');
       }
       # $r->print('<td>'.$$version_flag{$filename}.'</td><td>');
       $r->print('<td>'.&make_anchor($href_location.$filename,undef,$filename).'</td>'); 
     $r->print('<td>'.$size.'</td>');      $r->print('<td>'.$size.'</td>');
     $r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');      $r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');
     if ($select_mode ne 'true') {      if ($select_mode ne 'true') {
  $r->print('<td><span style="white-space: nowrap">'.   $r->print('<td><span style="white-space: nowrap">'.
   &mt($curr_access).'&nbsp;&nbsp;&nbsp;');    &mt($curr_access).'&nbsp;&nbsp;&nbsp;');
         %anchor_fields = (          my %anchor_fields = (
             'access' => $filename,              'access' => $filename,
             'currentpath' => $current_path              'currentpath' => $current_path
         );          );
Line 192  sub display_directory { Line 218  sub display_directory {
     my ($r,$url,$current_path,$is_empty,$dir_list,$group,$can_upload,      my ($r,$url,$current_path,$is_empty,$dir_list,$group,$can_upload,
         $can_modify,$can_delete,$can_setacl)=@_;          $can_modify,$can_delete,$can_setacl)=@_;
     my $iconpath= $r->dir_config('lonIconsURL') . "/";      my $iconpath= $r->dir_config('lonIconsURL') . "/";
     my %anchor_fields;  
     my $display_out;      my $display_out;
     my $select_mode;      my $select_mode;
     my $checked_files;      my $checked_files;
Line 270  sub display_directory { Line 295  sub display_directory {
            $show_versions = 'true';             $show_versions = 'true';
        }         }
        if (exists($versioned{$filename})) {         if (exists($versioned{$filename})) {
            %anchor_fields = (             my %anchor_fields = (
                'selectfile' => $filename,                 'selectfile' => $filename,
                'continue' => 'false',                 'continue' => 'false',
                'currentpath' => $current_path,                 'currentpath' => $current_path,
Line 293  sub display_directory { Line 318  sub display_directory {
                 }                  }
  $r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>');   $r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>');
                 $r->print('<td>Go to ...</td>');                  $r->print('<td>Go to ...</td>');
                 %anchor_fields = (                  my %anchor_fields = (
                     'selectfile'    => $filename.'/',                      'selectfile'    => $filename.'/',
                     'currentpath'   => $current_path.$filename.'/',                      'currentpath'   => $current_path.$filename.'/',
                     'mode'          => $env{"form.mode"},                      'mode'          => $env{"form.mode"},
Line 315  sub display_directory { Line 340  sub display_directory {
     $line.=' /></td>';      $line.=' /></td>';
                 } else {                  } else {
                     if (exists $locked_files{$fullpath}) {                      if (exists $locked_files{$fullpath}) {
                         %anchor_fields = (                          my %anchor_fields = (
                             'lockinfo' => $current_path.$filename                              'lockinfo' => $current_path.$filename
                         );                          );
                         $line.='<td colspan="2">'.&make_anchor($url,\%anchor_fields,'Locked').'</td>';                          $line.='<td colspan="2">'.&make_anchor($url,\%anchor_fields,'Locked').'</td>';
Line 332  sub display_directory { Line 357  sub display_directory {
                         if ($can_modify) {                          if ($can_modify) {
                             my $cat='<img class="LC_icon" alt="'.&mt('Catalog Information').                              my $cat='<img class="LC_icon" alt="'.&mt('Catalog Information').
                             '" src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />';                              '" src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />';
                             %anchor_fields = (                              my %anchor_fields = (
                                 'rename' => $filename,                                  'rename' => $filename,
                                 currentpath => $current_path                                  currentpath => $current_path
                             );                              );
Line 476  sub done { Line 501  sub done {
     unless (defined $message) {      unless (defined $message) {
         $message='Done';          $message='Done';
     }      }
     my $result = '<h3><a href="'.$url.'?currentpath='.      my %anchor_fields = (
          $env{'form.currentpath'}.          'currentpath' => $env{'form.currentpath'},
          '&fieldname='.$env{'form.fieldname'}.          'fieldname' => $env{'form.fieldname'},
          '&mode='.$env{'form.mode'}.          'mode'      => $env{'form.mode'}
  &group_args();      );
     $result .= '">'.&mt($message).'</a></h3>';      my $result = '<h3>'.&make_anchor($url,\%anchor_fields,&mt($message)).'</h3>';
     return $result;      return $result;
 }  }
   
Line 617  sub display_access { Line 642  sub display_access {
     my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group,$file_name);      my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group,$file_name);
     my $aclcount = keys(%access_controls);      my $aclcount = keys(%access_controls);
     my $header = '<h3>'.&mt('Allowing others to retrieve file: [_1]',$port_path.$env{'form.currentpath'}.$env{'form.access'}).'</h3>';      my $header = '<h3>'.&mt('Allowing others to retrieve file: [_1]',$port_path.$env{'form.currentpath'}.$env{'form.access'}).'</h3>';
     my $info .= &mt('Access to this file by others can be set to be one or more of the following types: public, passphrase-protected or conditional.').'<br /><ul><li>'.&mt('Public files are available to anyone without the need for login.').'</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.').'</li><li>'.&mt('Conditional files are accessible to logged-in users with accounts in the LON-CAPA network, who satisfy the conditions you set.').'<br />'.&mt('The conditions can include affiliation with a particular course or group, or a user account in a specific domain.').'<br />'.&mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.').'</li></ul>';      my $info .= &mt('Access to this file by others can be set to be one or more of the following types: public, passphrase-protected or conditional.');
       $info .= '<br /><ul><li>'.&mt('Public files are available to anyone without the need for login.');
       $info .= '</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.');
       $info .= '</li><li>'.&mt('Conditional files are accessible to logged-in users with accounts in the LON-CAPA network, who satisfy the conditions you set.').'<br />';
       $info .= &mt('The conditions can include affiliation with a particular course or group, or a user account in a specific domain.').'<br />';
       $info .= &mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.').'</li></ul>';
     if ($group eq '') {      if ($group eq '') {
         $info .= (&mt("Direct others to the 'Display file listing' link (shown when there are viewable files) on your personal information page:<br /><a href='/adm/$udom/$uname/aboutme'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a>"));          $info .= (&mt("Direct others to the 'Display file listing' link (shown when there are viewable files) on your personal information page:<br /><a href='/adm/$udom/$uname/aboutme'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a>"));
     }      }
Line 663  sub view_access_settings { Line 692  sub view_access_settings {
     } else {      } else {
         $r->print(&mt('No access control settings currently exist for this file.<br />' ));          $r->print(&mt('No access control settings currently exist for this file.<br />' ));
     }      }
     $r->print('<br /><a href="'.$url.'?currentpath='.$env{'form.currentpath'}.      my %anchor_fields = (
               &group_args().'">'.&mt('Return to directory listing').'</a>');          'currentpath' => $env{'form.currentpath'}
       );
       $r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Return to directory listing')));
     return;      return;
 }  }
   
Line 888  sub update_access { Line 919  sub update_access {
         }          }
         &close_form($r,$url);          &close_form($r,$url);
     } else {      } else {
         $r->print('<br /><a href="'.$url.'?access='.$env{'form.selectfile'}.          my %anchor_fields = (
                   '&amp;currentpath='.$env{'form.currentpath'}.&group_args().'">'.              'currentpath' => $env{'form.currentpath'},
                    &mt('Display all access settings for this file').'</a>'.              'access' => $env{'form.selectfile'}
                   '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.          );
                   '<a href="'.$url.'?currentpath='.$env{'form.currentpath'}.          $r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Display all access settings for this file')));
                   &group_args().'">'.&mt('Return to directory listing').'</a>');          delete $anchor_fields{'access'};
           $r->print('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&make_anchor($url,\%anchor_fields,&mt('Return to directory listing')));
     }      }
     return;      return;
 }  }
Line 1585  sub lock_info { Line 1617  sub lock_info {
                 } else {                  } else {
                     $filetext = '<strong>'.$file_name.'</strong>';                      $filetext = '<strong>'.$file_name.'</strong>';
                 }                   } 
                 $r->print(&mt('[_1] was submitted in response to problem: ',                  if ($$array_item[(@$array_item - 1)] eq 'graded') {
                       $r->print(&mt('[_1] was submitted in response to problem: ',
                                 $filetext).
                             '<strong>'.&Apache::lonnet::gettitle($$array_item[0]).
                             '</strong><br />');
                       my %course_description = &Apache::lonnet::coursedescription($$array_item[1]);
                       $r->print(&mt('In the course: <strong>[_1]</strong><br />',
                                 $course_description{'description'}));
                   } elsif ($$array_item[(@$array_item - 1)] eq 'handback') {
                       $r->print(&mt('[_1] was handed back in response to problem: ',
                               $filetext).                                $filetext).
                           '<strong>'.&Apache::lonnet::gettitle($$array_item[0]).                            '<strong>'.&Apache::lonnet::gettitle($$array_item[0]).
                           '</strong><br />');                            '</strong><br />');
                 my %course_description = &Apache::lonnet::coursedescription($$array_item[1]);                      my %course_description = &Apache::lonnet::coursedescription($$array_item[1]);
                 $r->print(&mt('In the course: <strong>[_1]</strong><br />',                      $r->print(&mt('In the course: <strong>[_1]</strong><br />',
                               $course_description{'description'}));                                $course_description{'description'}));
                       
                   }
                 # $r->print('the third is '.$$array_item[2].'<br>');                  # $r->print('the third is '.$$array_item[2].'<br>');
                 # $r->print("item is $$array_item[0]<br> and $$array_item[0]");                  # $r->print("item is $$array_item[0]<br> and $$array_item[0]");
             }              }

Removed from v.1.151  
changed lines
  Added in v.1.155


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