version 1.573, 2004/12/04 18:35:27
|
version 1.574, 2004/12/06 18:08:39
|
Line 3824 sub save_selected_files {
|
Line 3824 sub save_selected_files {
|
foreach (@files) { |
foreach (@files) { |
&logthis("current dir file $_"); |
&logthis("current dir file $_"); |
} |
} |
open OUT, '>'.$Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/'.$filename; |
open (OUT, '>'.$Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/'.$filename); |
foreach my $file (@files) { |
foreach my $file (@files) { |
print OUT $ENV{'form.currentpath'}.$file."\n"; |
print (OUT $ENV{'form.currentpath'}.$file."\n"); |
} |
} |
foreach my $file (@other_files) { |
foreach my $file (@other_files) { |
print OUT $file."\n"; |
print (OUT $file."\n"); |
} |
} |
close OUT; |
close (OUT); |
return 'ok'; |
return 'ok'; |
} |
} |
|
|
|
sub clear_selected_files { |
|
my ($user) = @_; |
|
my $filename = $user."savedfiles"; |
|
open (OUT, '>'.$Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/'.$filename); |
|
print (OUT undef); |
|
close (OUT); |
|
return ("ok"); |
|
} |
|
|
sub files_in_path { |
sub files_in_path { |
my ($user, $path) = @_; |
my ($user, $path) = @_; |
my $filename = $user."savedfiles"; |
my $filename = $user."savedfiles"; |
my %return_files; |
my %return_files; |
open IN, '<'.$Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/'.$filename; |
open (IN, '<'.$Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/'.$filename); |
while (my $line_in = <IN>) { |
while (my $line_in = <IN>) { |
chomp $line_in; |
chomp ($line_in); |
my @paths_and_file = split m!/!, $line_in; |
my @paths_and_file = split (m!/!, $line_in); |
my $file_part = pop @paths_and_file; |
my $file_part = pop (@paths_and_file); |
my $path_part = join '/', @paths_and_file; |
my $path_part = join ('/', @paths_and_file); |
$path_part.='/'; |
$path_part.='/'; |
my $path_and_file = $path_part.$file_part; |
my $path_and_file = $path_part.$file_part; |
if ($path_part eq $path) { |
if ($path_part eq $path) { |
$return_files{$file_part}= 'selected'; |
$return_files{$file_part}= 'selected'; |
} |
} |
} |
} |
close IN; |
close (IN); |
return \%return_files; |
return (\%return_files); |
} |
} |
|
|
# called in portfolio select mode, to show files selected NOT in current directory |
# called in portfolio select mode, to show files selected NOT in current directory |
Line 3861 sub files_not_in_path {
|
Line 3870 sub files_not_in_path {
|
my $filename = $user."savedfiles"; |
my $filename = $user."savedfiles"; |
my @return_files; |
my @return_files; |
my $path_part; |
my $path_part; |
open IN, '<'.$Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/'.$filename; |
open (IN, '<'.$Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/'.$filename); |
while (<IN>) { |
while (<IN>) { |
#ok, I know it's clunky, but I want it to work |
#ok, I know it's clunky, but I want it to work |
my @paths_and_file = split m!/!, $_; |
my @paths_and_file = split m!/!, $_; |
my $file_part = pop @paths_and_file; |
my $file_part = pop (@paths_and_file); |
chomp $file_part; |
chomp ($file_part); |
my $path_part = join '/', @paths_and_file; |
my $path_part = join ('/', @paths_and_file); |
$path_part .= '/'; |
$path_part .= '/'; |
my $path_and_file = $path_part.$file_part; |
my $path_and_file = $path_part.$file_part; |
if ($path_part ne $path) { |
if ($path_part ne $path) { |
push @return_files, ($path_and_file); |
push (@return_files, ($path_and_file)); |
} |
} |
} |
} |
close OUT; |
close (OUT); |
return @return_files; |
return (@return_files); |
} |
} |
|
|
#--------------------------------------------------------------Get Marked as Read Only |
#--------------------------------------------------------------Get Marked as Read Only |