version 1.254.2.6.2.2, 2024/08/19 01:32:58
|
version 1.271, 2024/09/07 19:13:00
|
Line 237 sub display_directory_line {
|
Line 237 sub display_directory_line {
|
if ($lock_info) { |
if ($lock_info) { |
my %anchor_fields = ('lockinfo' => $fullpath); |
my %anchor_fields = ('lockinfo' => $fullpath); |
if ($versions) { # hold the folder open |
if ($versions) { # hold the folder open |
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($fullpath); |
my ($fname,$version,$extension) = &Apache::lonnet::file_name_version_ext($fullpath); |
$fname =~ s|^/||; |
$fname =~ s|^/||; |
$anchor_fields{'showversions'} = $fname.'.'.$extension; |
$anchor_fields{'showversions'} = $fname.'.'.$extension; |
} |
} |
Line 267 sub display_directory_line {
|
Line 267 sub display_directory_line {
|
|
|
sub display_directory { |
sub display_directory { |
my ($r,$url,$current_path,$is_empty,$dir_list,$group,$can_upload, |
my ($r,$url,$current_path,$is_empty,$dir_list,$group,$can_upload, |
$can_modify,$can_delete,$can_setacl,$can_viewacl)=@_; |
$can_modify,$can_delete,$can_setacl,$can_viewacl,$caller)=@_; |
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
my $select_mode; |
my $select_mode; |
my $checked_files; |
my $checked_files; |
Line 314 sub display_directory {
|
Line 314 sub display_directory {
|
&mt('Using the portfolio file list')) |
&mt('Using the portfolio file list')) |
.'</p>' |
.'</p>' |
); |
); |
|
my ($acl_helpfile,$acl_helplink); |
|
if ($caller eq 'coursegrp_portfolio') { |
|
$acl_helpfile = 'Portfolio ShareFile Group'; |
|
} elsif ($can_setacl) { |
|
$acl_helpfile = 'Portfolio ShareFile'; |
|
} |
|
unless ($can_setacl || $can_viewacl) { |
|
$acl_helpfile = 'Portfolio ShareFile Off'; |
|
} |
|
if ($acl_helpfile) { |
|
$acl_helplink = &Apache::loncommon::help_open_topic($acl_helpfile); |
|
} |
$r->print(&Apache::loncommon::start_data_table() |
$r->print(&Apache::loncommon::start_data_table() |
.&Apache::loncommon::start_data_table_header_row() |
.&Apache::loncommon::start_data_table_header_row() |
.'<th colspan="2">'.&mt('Actions'). &Apache::loncommon::help_open_topic('Portfolio FileAction').'</th>' |
.'<th colspan="2">'.&mt('Actions'). &Apache::loncommon::help_open_topic('Portfolio FileAction').'</th>' |
Line 323 sub display_directory {
|
Line 335 sub display_directory {
|
.'<th>'.&mt('Size').'</th>' |
.'<th>'.&mt('Size').'</th>' |
.'<th>'.&mt('Last Modified').'</th>' |
.'<th>'.&mt('Last Modified').'</th>' |
.'<th> </th>' |
.'<th> </th>' |
.'<th>'.&mt('Current Access Status').&Apache::loncommon::help_open_topic('Portfolio ShareFile').'</th>' |
.'<th>'.&mt('Current Access Status').$acl_helplink.'</th>' |
.&Apache::loncommon::end_data_table_header_row()); |
.&Apache::loncommon::end_data_table_header_row()); |
} |
} |
|
|
Line 373 sub display_directory {
|
Line 385 sub display_directory {
|
} (@{$dir_list})) { |
} (@{$dir_list})) { |
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$dir_line,16); |
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$dir_line,16); |
$filename =~ s/\s+$//; |
$filename =~ s/\s+$//; |
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); |
my ($fname,$version,$extension) = &Apache::lonnet::file_name_version_ext($filename); |
if ($version) { |
if ($version) { |
my $fullpath = &prepend_group($current_path.$fname.'.'.$extension); |
my $fullpath = &prepend_group($current_path.$fname.'.'.$extension); |
push(@{ $versioned{$fullpath} }, |
push(@{ $versioned{$fullpath} }, |
Line 386 sub display_directory {
|
Line 398 sub display_directory {
|
my $zerobyte; |
my $zerobyte; |
foreach my $dir_line (@dir_lines) { |
foreach my $dir_line (@dir_lines) { |
my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$dir_line; |
my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$dir_line; |
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); |
my ($fname,$version,$extension) = &Apache::lonnet::file_name_version_ext($filename); |
if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { |
if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { |
my $version_flag; |
my $version_flag; |
my $show_versions; |
my $show_versions; |
Line 490 sub display_directory {
|
Line 502 sub display_directory {
|
my $cond_access = 0; |
my $cond_access = 0; |
foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) { |
foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) { |
my ($num,$scope,$end,$start) = &unpack_acc_key($key); |
my ($num,$scope,$end,$start) = &unpack_acc_key($key); |
next if ($scope eq 'ip'); |
next if ($scope eq 'ip'); |
if (($now > $start) && (!$end || $end > $now)) { |
if (($now > $start) && (!$end || $end > $now)) { |
if ($scope eq 'public') { |
if ($scope eq 'public') { |
$pub_access = 1; |
$pub_access = 1; |
Line 2752 sub handler {
|
Line 2764 sub handler {
|
$can_modify = 1; |
$can_modify = 1; |
$can_delete = 1; |
$can_delete = 1; |
$can_upload = 1; |
$can_upload = 1; |
if (&Apache::lonnet::usertools_access('','','portaccess', |
if (&Apache::lonnet::usertools_access($uname,$udom,'portaccess', |
undef,'tools')) { |
undef,'tools')) { |
$can_viewacl = 1; |
$can_viewacl = 1; |
$can_setacl = 1; |
$can_setacl = 1; |
Line 2768 sub handler {
|
Line 2780 sub handler {
|
|
|
my $js = '<script type="text/javascript" |
my $js = '<script type="text/javascript" |
src="/res/adm/includes/file_upload.js"></script>'; |
src="/res/adm/includes/file_upload.js"></script>'; |
|
|
if ($env{"form.mode"} eq 'selectfile'){ |
if ($env{"form.mode"} eq 'selectfile'){ |
$r->print(&Apache::loncommon::start_page($title, $js, |
$r->print(&Apache::loncommon::start_page($title, $js, |
{'only_body' => 1})); |
{'only_body' => 1})); |
Line 3019 sub handler {
|
Line 3031 sub handler {
|
$can_upload,$group); |
$can_upload,$group); |
&display_directory($r,$url,$current_path,$is_empty,$dirlistref,$group, |
&display_directory($r,$url,$current_path,$is_empty,$dirlistref,$group, |
$can_upload,$can_modify,$can_delete,$can_setacl, |
$can_upload,$can_modify,$can_delete,$can_setacl, |
$can_viewacl); |
$can_viewacl,$caller); |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |