Diff for /loncom/interface/portfolio.pm between versions 1.45 and 1.46

version 1.45, 2004/09/10 20:48:33 version 1.46, 2004/09/10 21:33:48
Line 379  sub handler { Line 379  sub handler {
  my @dir_list=&Apache::lonnet::dirlist($current_path,   my @dir_list=&Apache::lonnet::dirlist($current_path,
     $ENV{'user.domain'},      $ENV{'user.domain'},
     $ENV{'user.name'},$portfolio_root);      $ENV{'user.name'},$portfolio_root);
     if ($dir_list[0] eq 'no_such_dir'){   if ($dir_list[0] eq 'no_such_dir'){
         # two main reasons for this: 1) never been here, so directory structure not created      # two main reasons for this:
         #                            2) back-button navigation after deleting a directory              #    1) never been here, so directory structure not created
         if ($current_path eq '/'){      #    2) back-button navigation after deleting a directory
       if ($current_path eq '/'){
         &Apache::lonnet::mkdiruserfile($ENV{'user.name'},          &Apache::lonnet::mkdiruserfile($ENV{'user.name'},
         $ENV{'user.domain'},'portfolio');         $ENV{'user.domain'},'portfolio');
         } else { # some directory that snuck in      } else {
             # get rid of the directory from the recent pulldown, just in case                  # some directory that snuck in get rid of the directory
             &Apache::lonhtmlcommon::remove_recent('portfolio',[$current_path]);                  # from the recent pulldown, just in case
             $current_path = '/'; # force it back to the root           &Apache::lonhtmlcommon::remove_recent('portfolio',
         }        [$current_path]);
         # now grab the directory list again, for the first time   $current_path = '/'; # force it back to the root        
         @dir_list=&Apache::lonnet::dirlist($current_path,      }
     $ENV{'user.domain'},      # now grab the directory list again, for the first time
     $ENV{'user.name'},$portfolio_root);      @dir_list=&Apache::lonnet::dirlist($current_path,
               $ENV{'user.domain'},
       $ENV{'user.name'},$portfolio_root);
         }          }
     # need to know if directory is empty so it can be removed if desired   # need to know if directory is empty so it can be removed if desired
     my $is_empty=(@dir_list == 2);   my $is_empty=(@dir_list == 2);
     &display_directory($r,$current_path,$is_empty,\@dir_list);   &display_directory($r,$current_path,$is_empty,\@dir_list);
     $r->print("</body>\n</html>\n");   $r->print("</body>\n</html>\n");
     return OK;   return OK;
     }      }
 }  }
 1;  1;

Removed from v.1.45  
changed lines
  Added in v.1.46


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