version 1.411, 2003/09/11 07:57:03
|
version 1.413, 2003/09/16 17:54:50
|
Line 246 sub critical {
|
Line 246 sub critical {
|
return $answer; |
return $answer; |
} |
} |
|
|
|
# |
# -------------- Remove all key from the env that start witha lowercase letter |
# -------------- Remove all key from the env that start witha lowercase letter |
# (Which is alweways a lon-capa value) |
# (Which is always a lon-capa value) |
|
|
sub cleanenv { |
sub cleanenv { |
|
# unless (defined(&Apache::exists_config_define("MODPERL2"))) { return; } |
|
# unless (&Apache::exists_config_define("MODPERL2")) { return; } |
foreach my $key (keys(%ENV)) { |
foreach my $key (keys(%ENV)) { |
if ($key =~ /^[a-z]/) { |
if ($key =~ /^[a-z]/) { |
delete($ENV{$key}); |
delete($ENV{$key}); |
Line 2602 sub is_on_map {
|
Line 2606 sub is_on_map {
|
if ($match) { |
if ($match) { |
return (1,$1); |
return (1,$1); |
} else { |
} else { |
return (0,0); |
my ($name,$ext)=($filename=~/^(.+)\.(\w+)$/); |
|
$ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~ |
|
/\&(\Q$name\E\.\d+\.$ext)\:([\d\|]+)\&/; |
|
return (0,$2,$pathname.'/'.$1); |
} |
} |
} |
} |
|
|
Line 3875 sub symbclean {
|
Line 3882 sub symbclean {
|
# ---------------------------------------------- Split symb to find map and url |
# ---------------------------------------------- Split symb to find map and url |
|
|
sub decode_symb { |
sub decode_symb { |
return split(/\_\_\_/,shift); |
my ($map,$resid,$url)=split(/\_\_\_/,shift); |
|
return (&fixversion($map),$resid,&fixversion($url)); |
|
} |
|
|
|
sub fixversion { |
|
my $fn=shift; |
|
if ($fn=~/^(adm|uploaded|public)/) { return $fn; } |
|
my ($match,$cond,$versioned)=&is_on_map($fn); |
|
unless ($match) { |
|
$fn=$versioned; |
|
} |
|
return $fn; |
} |
} |
|
|
# ------------------------------------------------------ Return symb list entry |
# ------------------------------------------------------ Return symb list entry |