-
- $text{'upload_label'}
- |
-
+ my $escuri = &HTML::Entities::encode($r->uri,'&<>"');
+ $r->print(<<"TABLE");
+
+
+
+ $text{'upload_label'}
+ |
+
+ |
-
-
-
+
+
+
TABLE
+ }
my @tree = split (/\//,$current_path);
- $r->print(''.&make_anchor('portfolio','/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"}).'/');
+ my %anchor_fields = (
+ 'selectfile' => $port_path,
+ 'currentpath' => '/',
+ 'mode' => $env{"form.mode"},
+ 'fieldname' => $env{"form.fieldname"},
+ 'continue' => $env{"form.continue"}
+ );
+ $r->print(''.&make_anchor($url,\%anchor_fields,$port_path).'/');
if (@tree > 1){
my $newCurrentPath = '';
for (my $i = 1; $i< @tree; $i++){
$newCurrentPath .= $tree[$i].'/';
- $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath, $env{"form.mode"},$env{"form.fieldname"}, $env{"form.continue"}).'/');
+ my %anchor_fields = (
+ 'selectfile' => $tree[$i],
+ 'currentpath' => '/',
+ 'mode' => $env{"form.mode"},
+ 'fieldname' => $env{"form.fieldname"},
+ 'continue' => $env{"form.continue"}
+ );
+ $r->print(&make_anchor($url,\%anchor_fields,$tree[$i]).'/');
}
}
- $r->print('');
- &Apache::lonhtmlcommon::store_recent('portfolio',$current_path,$current_path);
- $r->print(' ");
}
+
+sub display_directory_line {
+ my ($r,$select_mode,$fullpath, $filename, $mtime, $size, $css_class,
+ $line, $access_controls, $curr_access, $now, $version_flag,
+ $href_location, $url, $current_path, $access_admin_text, $versions)=@_;
+ # my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);
+ $r->print(' |
');
+ $r->print($line); # contains first two cells of table
+ if ($$version_flag{$filename}) { # versioned can't be versioned, so TRUE when root file
+ $r->print('![]('.&Apache::loncommon::icon($filename).') | ');
+ $r->print(''.$$version_flag{$filename}.' | ');
+ } else { # this is a graded or handed back file
+ my ($user,$domain) = &get_name_dom();
+ my $permissions_hash = &Apache::lonnet::get_portfile_permissions($domain,$user);
+ my $lock_info;
+ foreach my $key (keys(%$permissions_hash)) {
+ $key =~ s|^/||;
+ if ($key =~ /$filename/) {
+ &Apache::lonnet::logthis("filename match");
+ my $value = $$permissions_hash{$key};
+ if (ref($value) eq 'ARRAY') {
+ my $info = pop(@$value);
+ my $info2 = pop(@$info);
+ &Apache::lonnet::logthis("the info2 is $info2");
+ $lock_info = $info2;
+ #foreach my $key2(keys(%hash)){
+ # &Apache::lonnet::logthis("a key2 is $key2");
+ #}
+ foreach my $value_element (@$value) {
+ #&Apache::lonnet::logthis("and the array element is $value_element");
+ foreach my $sub_value (@$value_element) {
+ #&Apache::lonnet::logthis("subvalue is $sub_value");
+ }
+ }
+ }
+ }
+ }
+ $r->print(''.$lock_info.' | ');
+ }
+ # $r->print(''.$$version_flag{$filename}.' | ');
+ $r->print(' | '.&make_anchor($href_location.$filename,undef,$filename).' | ');
+ $r->print(''.$size.' | ');
+ $r->print(''.&Apache::lonlocal::locallocaltime($mtime).' | ');
+ if ($select_mode ne 'true') {
+ $r->print(''.
+ &mt($curr_access).' ');
+ my %anchor_fields = (
+ 'access' => $filename,
+ 'currentpath' => $current_path
+ );
+ $r->print(&make_anchor($url, \%anchor_fields, $access_admin_text).' | ');
+ }
+ $r->print('
'.$/);
+}
+
sub display_directory {
- my ($r,$current_path,$is_empty,$dir_list)=@_;
+ my ($r,$url,$current_path,$is_empty,$dir_list,$group,$can_upload,
+ $can_modify,$can_delete,$can_setacl)=@_;
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'});
+ my $port_path = &get_port_path();
+ my ($uname,$udom) = &get_name_dom();
+ my $access_admin_text = &mt('View Status');
+ if ($can_setacl) {
+ $access_admin_text = &mt('View/Change Status');
+ }
+
+ my $current_permissions = &Apache::lonnet::get_portfile_permissions($udom,
+ $uname);
+ my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash(
+ $current_permissions,$group);
+ my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group);
+ my $now = time;
if ($env{"form.mode"} eq 'selectfile'){
&select_files($r);
- $checked_files =&Apache::lonnet::files_in_path($env{'user.name'},$env{'form.currentpath'});
+ $checked_files =&Apache::lonnet::files_in_path($uname,$env{'form.currentpath'});
$select_mode = 'true';
}
- if ($is_empty && ($current_path ne '/')) {
- $display_out = '