Diff for /loncom/interface/portfolio.pm between versions 1.18 and 1.19

version 1.18, 2004/07/28 19:00:19 version 1.19, 2004/07/28 22:30:31
Line 218  sub handler { Line 218  sub handler {
     # as well as information about the home server directory structure, specifically      # as well as information about the home server directory structure, specifically
     # the path to the users userfiles directory.          # the path to the users userfiles directory.    
     #       # 
       $r->print('/userfiles/portfolio'.$currentPath.'<br>');
     my $portfolio_root = &Apache::loncommon::propath($ENV{'user.domain'},      my $portfolio_root = &Apache::loncommon::propath($ENV{'user.domain'},
      $ENV{'user.name'}).       $ENV{'user.name'}).
        '/userfiles/portfolio'.$currentPath;         '/userfiles/portfolio';
     @dirList = &Apache::lonnet::dirlist($currentPath,  $ENV{'user.domain'}, $ENV{'user.name'}, $portfolio_root);      @dirList = &Apache::lonnet::dirlist($currentPath,  $ENV{'user.domain'}, $ENV{'user.name'}, $portfolio_root);
           
     if (@dirList == 2) { # need to know if directory is empty so it can be removed if desired      if (@dirList == 2) { # need to know if directory is empty so it can be removed if desired
Line 250  sub handler { Line 251  sub handler {
     # Display begins here      # Display begins here
     #      #
     ##############################      ##############################
       my @tree = split (/\//,$currentPath);
       $r->print('<font size="+2">'.makeAnchor('portfolio','/').'/');
       if (@tree > 1){
           my $newCurrentPath = '';
           for (my $i = 1; $i< @tree; $i++){
               $newCurrentPath .= $tree[$i].'/';
               $r->print(makeAnchor($tree[$i],'/'.$newCurrentPath).'/');
           }
       }
       $r->print('</font>');
     $r->print('<table border="0" cellspacing="2" cellpadding="2">'.      $r->print('<table border="0" cellspacing="2" cellpadding="2">'.
             '<tr><th>&nbsp;</th><th>Actions</th><th>Name</th><th>Title</th><th>Status</th><th>Last Modified</th></tr>');              '<tr><th>&nbsp;</th><th>Actions</th><th>Name</th><th>Title</th><th>Status</th><th>Last Modified</th></tr>');
     foreach my $line (@dirList) {      foreach my $line (@dirList) {
     #$strip holds directory/file name      #$strip holds directory/file name
     #$dom       #$dom 
     my ($fileName,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);       my ($fileName,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); 
         if ($dirptr&$testdir){      if (($fileName ne '.') && ($fileName ne '..')){
             $r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'folder_closed.gif"></td></tr>');               if ($dirptr&$testdir){
         }else{                  $r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'folder_closed.gif"></td>');
             $r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'doc.gif"></td></tr>');                  $r->print('<td>Go to ...</td>');
                   $r->print('<td>'.makeAnchor($fileName.'/',$currentPath.$fileName.'/').'</td>'); 
                   $r->print('</tr>'); 
               }else{
                   $r->print('<tr bgcolor="#CCCCFF"><td><img src="'.$iconpath.'unknown.gif"></td>');
                   $r->print('<td>Edit</td>');
                   $r->print('<td>'.$fileName.'</td>'); 
                   $r->print('<td>Title Here</td>');
                   $r->print('<td>Status Here</td>');
                   $r->print('<td>Modified Here</td>');
                   $r->print('</tr>'); 
               }
         }          }
     }      }
 #   <tr bgcolor="#FFAA99"> pink bg   #   <tr bgcolor="#FFAA99"> pink bg 

Removed from v.1.18  
changed lines
  Added in v.1.19


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