version 1.146, 2010/03/29 12:21:38
|
version 1.148, 2011/10/17 12:41:30
|
Line 452 sub in_course {
|
Line 452 sub in_course {
|
$cdom = $env{'course.'.$cid.'.domain'}; |
$cdom = $env{'course.'.$cid.'.domain'}; |
$cnum = $env{'course.'.$cid.'.num'}; |
$cnum = $env{'course.'.$cid.'.num'}; |
} |
} |
my %roles = &Apache::lonnet::dump('roles',$udom,$uname); |
my $typesref; |
my @course_roles = grep(m{^/\Q$cdom\E/\Q$cnum\E[/_]}, keys(%roles)); |
if ($type eq 'all') { |
return 0 if (!@course_roles); |
$typesref = ['active','previous','future']; |
return 1 if ($type eq 'any'); |
} elsif ($type eq 'previous' || $type eq 'future') { |
my $now = time(); |
$typesref = [$type]; |
foreach my $role (@course_roles) { |
} |
my (undef,$role_end,$role_start)=split(/\_/,$roles{$role}); |
my %roles = &Apache::lonnet::get_my_roles($uname,$udom,'userroles', |
my $status = 'active'; |
$typesref,undef,[$cdom]); |
if ($role_start > 0 && $now < $role_start) { |
my ($tmp) = keys(%roles); |
$status = 'future'; |
return 0 if ($tmp =~ /^(con_lost|error|no_such_host)/i); |
} |
my @course_roles = grep(/^\Q$cnum\E:\Q$cdom\E:/, keys(%roles)); |
if ($role_end > 0 && $now > $role_end) { |
if (@course_roles > 0) { |
$status = 'previous'; |
return 1; |
} |
|
return 1 if ($status eq $type); |
|
} |
} |
return 0; |
return 0; |
} |
} |
Line 779 sub parse_directory {
|
Line 777 sub parse_directory {
|
my $portfolio_root = &Apache::portfolio::get_portfolio_root($cdom,$cnum, |
my $portfolio_root = &Apache::portfolio::get_portfolio_root($cdom,$cnum, |
$group); |
$group); |
my $getpropath = 1; |
my $getpropath = 1; |
my %dirlist = map { |
my ($listref,$listerror) = |
((split('&',$_,2))[0],1) |
&Apache::lonnet::dirlist($portfolio_root.$path,$cdom,$cnum,$getpropath); |
} &Apache::lonnet::dirlist($portfolio_root.$path,$cdom,$cnum,$getpropath); |
my %dirlist; |
|
if (ref($listref) eq 'ARRAY') { |
|
%dirlist = map { ((split('&',$_,2))[0],1) } @{$listref}; |
|
} |
foreach my $item (sort(keys(%{$currhash}))) { |
foreach my $item (sort(keys(%{$currhash}))) { |
$output .= &Apache::loncommon::start_data_table_row(); |
$output .= &Apache::loncommon::start_data_table_row(); |
$output .= '<td style="padding-left: '.($depth*25).'px">'; |
$output .= '<td style="padding-left: '.($depth*25).'px">'; |