Diff for /loncom/interface/portfolio.pm between versions 1.16 and 1.17

version 1.16, 2004/07/23 01:25:56 version 1.17, 2004/07/27 05:29:00
Line 56  sub displayDirectory { Line 56  sub displayDirectory {
             $upPath = $1;              $upPath = $1;
         }          }
                   
         $displayOut = $displayOut.'<a href="/adm/portfolio?selectfile='.$upPath.'&currentpath='.$upPath.'">..</a><br />';          # $displayOut = $displayOut.'<a href="/adm/portfolio?selectfile='.$upPath.'&currentpath='.$upPath.'">..</a><br />';
     } else {      } else {
         $displayOut = $displayOut.'at root '.$currentPath.'<br />';          # $displayOut = $displayOut.'at root '.$currentPath.'<br />';
     }      }
     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,$path)=split(/\&/,$line,17);       my ($fileName,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef,$path,$debug)=split(/\&/,$line,18); 
     $path =~ m:/:;      $path =~ m:/:;
     my $dirDepth = @-;      my $dirDepth = @-;
         if (($fileName ne '.') && ($fileName ne '..')){          if (($fileName ne '.') && ($fileName ne '..')){
Line 73  sub displayDirectory { Line 73  sub displayDirectory {
             if ($testdir =~ m:^1:){              if ($testdir =~ m:^1:){
                 # handle directories different from files                  # handle directories different from files
                 if ($fileName eq $currentFile){ #checks to bold the selected file                  if ($fileName eq $currentFile){ #checks to bold the selected file
                     $displayOut.= '<strong>'.(makeAnchor($fileName.'/', $path.$fileName.'/').'</strong><br />'."\n");                      $displayOut.= $debug.'<strong>'.(makeAnchor($fileName.'/', $path.$fileName.'/').'</strong><br />'."\n");
                 }else{                  }else{
                     $displayOut.= (makeAnchor($fileName.'/', $path.$fileName.'/').'<br />'."\n");                      $displayOut.= $debug.(makeAnchor($fileName.'/', $path.$fileName.'/').'<br />'."\n");
                 }                  }
             }else{              }else{
                 if ($fileName eq $currentFile){ #checks to bold the selected file                  if ($fileName eq $currentFile){ #checks to bold the selected file
                     $displayOut.='<strong>'.(makeAnchor($fileName, $currentPath).'</strong><br />'."\n");                      $displayOut.=$debug.'<strong>'.(makeAnchor($fileName, $currentPath).'</strong><br />'."\n");
                 }else{                  }else{
                     $displayOut.=(makeAnchor($fileName, $currentPath).'<br />'."\n");                      $displayOut.=$debug.(makeAnchor($fileName, $currentPath).'<br />'."\n");
                 }                  }
             }              }
         for (my $i = 0; $i <= $dirDepth; $i += 1){          for (my $i = 0; $i <= $dirDepth; $i += 1){
Line 243  sub handler { Line 243  sub handler {
         if ($readDirectory){ # is true the first time through, then true if dirlist line is a subdir          if ($readDirectory){ # is true the first time through, then true if dirlist line is a subdir
             # $r->print('<br />reading '.$portfolio_root.$subdir);              # $r->print('<br />reading '.$portfolio_root.$subdir);
             my @list = &Apache::lonnet::dirlist($currentPath,  $ENV{'user.domain'}, $ENV{'user.name'}, $portfolio_root.$subdir);              my @list = &Apache::lonnet::dirlist($currentPath,  $ENV{'user.domain'}, $ENV{'user.name'}, $portfolio_root.$subdir);
             foreach my $line(@list){              $r->print('value in @list = '.@list);
                 $line = $line.'&'.$subdir; # append the subdirectory information              for (my $i = 0; $i <= @list; $i++ ){
                   my $line = pop @list;
                   $line = $line.'&'.$subdir.'&'.$loopCounter; # append the subdirectory information and loopcounter for debug
                 my ($fileName,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef,$subpath)=split(/\&/,$line,17);                   my ($fileName,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef,$subpath)=split(/\&/,$line,17); 
                 if (($fileName ne '.') && ($fileName ne '..')){ # we throw away the current and parent directories                  if (($fileName ne '.') && ($fileName ne '..')){ # we throw away the current and parent directories
                     $r->print('<br />'.$line);                      $r->print('<br />'.$line); #for debugging
                     # should this be shift?                      unshift @workinglist, $line; # add the line to the working list array
                     push @workinglist, $line; # add the line to the working list array                      
                   }else{
                       $r->print('<br /> parent or current '.$line); #for debugging
                 }                  }
             }              }
         }          }
           $r->print('<br />'.@workinglist.' lines in workinglist');
         my $line = shift @workinglist; #take one off the working list          my $line = shift @workinglist; #take one off the working list
           $r->print('<br />'.@workinglist.' lines in workinglist');
         if ($line eq '') { # if the working list is empty          if ($line eq '') { # if the working list is empty
             $done = 1;              $done = 1;
         }else{          }else{
               my ($fileName,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef,$subpath,$debug)=split(/\&/,$line,18); 
               $r->print('<br />'.$fileName.' is '.$testdir);
             push @dirList, $line; # and put it in the display list              push @dirList, $line; # and put it in the display list
             my ($fileName,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef,$subpath)=split(/\&/,$line,17);   
             if ($testdir =~ m:^1:) { # true if this is a directory              if ($testdir =~ m:^1:) { # true if this is a directory
                 # $r->print('<br />added subdir '.$fileName);                  # $r->print('<br />added subdir '.$fileName);
                 $subdir = $subpath.'/'.$fileName;                   $subdir = $subpath.'/'.$fileName; 

Removed from v.1.16  
changed lines
  Added in v.1.17


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