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

version 1.152, 2006/08/09 17:47:26 version 1.155, 2006/08/12 22:41:53
Line 169  sub display_directory_line { Line 169  sub display_directory_line {
  $href_location, $url, $current_path, $access_admin_text, $versions)=@_;   $href_location, $url, $current_path, $access_admin_text, $versions)=@_;
     # 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') {
Line 474  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 615  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 661  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 886  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 1583  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).                                $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'}));
                   } elsif ($$array_item[(@$array_item - 1)] eq 'handback') {
                       $r->print(&mt('[_1] was handed back 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'}));
                       
                   }
                 # $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.152  
changed lines
  Added in v.1.155


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