version 1.1536, 2025/02/18 19:30:43
|
version 1.1538, 2025/04/02 23:44:03
|
Line 3734 sub ssi_body {
|
Line 3734 sub ssi_body {
|
$output=~s|//(\s*<!--)? BEGIN LON-CAPA Internal.+?// END LON-CAPA Internal\s*(-->)?\s||gs; |
$output=~s|//(\s*<!--)? BEGIN LON-CAPA Internal.+?// END LON-CAPA Internal\s*(-->)?\s||gs; |
$output=~s/^.*?\<body[^\>]*\>//si; |
$output=~s/^.*?\<body[^\>]*\>//si; |
$output=~s/\<\/body\s*\>.*?$//si; |
$output=~s/\<\/body\s*\>.*?$//si; |
|
$output=~s{\Q<div class="LC_landmark" role="main">\E}{<div>}gs; |
if (wantarray) { |
if (wantarray) { |
return ($output, $response); |
return ($output, $response); |
} else { |
} else { |
Line 13215 my %cachedmaps=();
|
Line 13216 my %cachedmaps=();
|
# When this was last done |
# When this was last done |
my $cachedmaptime=''; |
my $cachedmaptime=''; |
|
|
|
# Cache (5 seconds) of mapsymb hierarchy for speedup of reservations display |
|
# |
|
# The course for which we cache |
|
my $cachedmapsymbkey=''; |
|
# The cached recursive map symbs for this course |
|
my %cachedmapsymbs=(); |
|
# When this was last done |
|
my $cachedmapsymbtime=''; |
|
|
sub clear_EXT_cache_status { |
sub clear_EXT_cache_status { |
&delenv('cache.EXT.'); |
&delenv('cache.EXT.'); |
} |
} |
Line 13406 sub EXT {
|
Line 13416 sub EXT {
|
|
|
#print '<br>'.$space.' - '.$qualifier.' - '.$spacequalifierrest; |
#print '<br>'.$space.' - '.$qualifier.' - '.$spacequalifierrest; |
|
|
|
# --------------------------------------------- Special handling for encrypturl |
|
|
|
if ($spacequalifierrest eq '0.encrypturl') { |
|
unless ($recursed) { |
|
my ($map_from_symb,@mapsymbs); |
|
if ($symbparm =~ /\.(page|sequence)$/) { |
|
push(@mapsymbs,$symbparm); |
|
$map_from_symb = &deversion((&decode_symb($symbparm))[2]); |
|
} else { |
|
$map_from_symb = &deversion((&decode_symb($symbparm))[0]); |
|
} |
|
if (($map_from_symb ne '') && ($map_from_symb !~ /default\.sequence$/)) { |
|
my @parents = &get_mapsymb_hierarchy($map_from_symb,$courseid); |
|
if (@parents) { |
|
push(@mapsymbs,@parents); |
|
} |
|
} |
|
if (@mapsymbs) { |
|
my $earlyout; |
|
my %parmhash=(); |
|
if (tie(%parmhash,'GDBM_File', |
|
$env{'request.course.fn'}.'_parms.db', |
|
&GDBM_READER(),0640)) { |
|
foreach my $mapsymb (@mapsymbs) { |
|
if ((exists($parmhash{$mapsymb.'.'.$spacequalifierrest})) && |
|
(lc($parmhash{$mapsymb.'.'.$spacequalifierrest}) eq 'yes')) { |
|
$earlyout = $parmhash{$mapsymb.'.'.$spacequalifierrest}; |
|
last; |
|
} |
|
} |
|
untie(%parmhash); |
|
} |
|
if ($earlyout) { return &get_reply([$earlyout,'map']); } |
|
} |
|
} |
|
} |
|
|
# ----------------------------------------------------- Cascading lookup scheme |
# ----------------------------------------------------- Cascading lookup scheme |
my $symbp=$symbparm; |
my $symbp=$symbparm; |
$mapp=&deversion((&decode_symb($symbp))[0]); |
$mapp=&deversion((&decode_symb($symbp))[0]); |
Line 13607 sub get_map_hierarchy {
|
Line 13654 sub get_map_hierarchy {
|
} |
} |
} |
} |
return @recurseup; |
return @recurseup; |
|
} |
|
|
|
sub get_mapsymb_hierarchy { |
|
my ($mapname,$courseid) = @_; |
|
my @recurseup; |
|
if ($mapname) { |
|
if (($cachedmapsymbkey eq $courseid) && |
|
(abs($cachedmapsymbtime-time)<5)) { |
|
if (ref($cachedmapsymbs{$mapname}) eq 'ARRAY') { |
|
return @{$cachedmapsymbs{$mapname}}; |
|
} |
|
} |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (ref($navmap)) { |
|
my $getsymb = 1; |
|
my $inclusive = 1; |
|
@recurseup = $navmap->recurseup_maps($mapname,$getsymb,$inclusive); |
|
undef($navmap); |
|
$cachedmapsymbs{$mapname} = \@recurseup; |
|
$cachedmapsymbtime=time; |
|
$cachedmapsymbkey=$courseid; |
|
} |
|
} |
|
return @recurseup; |
} |
} |
|
|
} |
} |