--- loncom/interface/portfolio.pm 2005/02/20 20:39:30 1.76 +++ loncom/interface/portfolio.pm 2005/03/15 23:11:08 1.80 @@ -83,7 +83,14 @@ sub display_directory { my ($r,$current_path,$is_empty,$dir_list)=@_; my $iconpath= $r->dir_config('lonIconsURL') . "/"; my $display_out; + my $select_mode; + my $checked_files; my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($ENV{'user.domain'},$ENV{'user.name'}); + if ($ENV{"form.mode"} eq 'selectfile'){ + &select_files($r); + $checked_files =&Apache::lonnet::files_in_path($ENV{'user.name'},$ENV{'form.currentpath'}); + $select_mode = 'true'; + } if ($is_empty && ($current_path ne '/')) { $display_out = '
'); + } } sub open_form { @@ -473,7 +444,11 @@ sub upload { } } } - +sub lock_info { + my ($r) = @_; + $r->print("lock info here"); + return 'ok'; +} sub createdir { my ($r)=@_; my $newdir=&Apache::lonnet::clean_filename($ENV{'form.newdir'}); @@ -521,7 +496,7 @@ sub handler { $ENV{'user.name'}). '/userfiles/portfolio'; &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['selectfile','currentpath','meta', + ['selectfile','currentpath','meta','lockinfo', 'currentfile','action','fieldname','mode','rename']); &Apache::loncommon::no_cache($r); &Apache::loncommon::content_type($r,'text/html'); @@ -569,6 +544,8 @@ sub handler { &rename($r); } elsif ($ENV{'form.createdir'}) { &createdir($r); + } elsif ($ENV{'form.lockinfo'}) { + &lock_info($r); } else { my $current_path='/'; if ($ENV{'form.currentpath'}) { @@ -599,12 +576,7 @@ sub handler { # need to know if directory is empty so it can be removed if desired my $is_empty=(@dir_list == 2); &display_common($r,$current_path,$is_empty,\@dir_list); - if ($ENV{"form.mode"} eq 'selectfile'){ - &select_files($r); - &display_file_select($r,$current_path,$is_empty,\@dir_list); - } else { - &display_directory($r,$current_path,$is_empty,\@dir_list); - } + &display_directory($r,$current_path,$is_empty,\@dir_list); $r->print("