--- loncom/lonnet/perl/lonnet.pm 2001/08/07 14:33:53 1.141 +++ loncom/lonnet/perl/lonnet.pm 2001/08/09 16:43:06 1.146 @@ -122,7 +122,7 @@ # 5/30 H. K. Ng # 6/1 Gerd Kortemeyer # July Guy Albertelli -# 8/4,8/7 Gerd Kortemeyer +# 8/4,8/7,8/8,8/9 Gerd Kortemeyer package Apache::lonnet; @@ -896,7 +896,7 @@ sub rolesinit { my $author=0; map { %thesepriv=(); - if (($_!~/^st/) && ($_!~/^ta/)) { $adv=1; } + if (($_!~/^st/) && ($_!~/^ta/) && ($_!~/^cm/)) { $adv=1; } if (($_=~/^au/) || ($_=~/^ca/)) { $author=1; } map { if ($_ ne '') { @@ -1735,6 +1735,10 @@ sub EXT { $spacequalifierrest}; } elsif ($realm eq 'resource') { if ($ENV{'request.course.id'}) { + +# print '
'.$space.' - '.$qualifier.' - '.$spacequalifierrest; + + # ----------------------------------------------------- Cascading lookup scheme my $symbp=&symbread(); my $mapp=(split(/\_\_\_/,$symbp))[0]; @@ -1824,6 +1828,19 @@ sub EXT { 'parameter_'.$spacequalifierrest); if ($metadata) { return $metadata; } +# ------------------------------------------------------------------ Cascade up + + unless ($space eq '0') { + my ($part,$id)=split(/\_/,$space); + if ($id) { + my $partgeneral=&EXT('resource.'.$part.'.'.$qualifierrest); + if ($partgeneral) { return $partgeneral; } + } else { + my $resourcegeneral=&EXT('resource.0.'.$qualifierrest); + if ($resourcegeneral) { return $resourcegeneral; } + } + } + # ---------------------------------------------------- Any other user namespace } elsif ($realm eq 'environment') { # ----------------------------------------------------------------- environment @@ -1872,13 +1889,14 @@ sub metadata { if ($_=~/^$package\&/) { my ($pack,$name,$subp)=split(/\&/,$_); my $value=$packagetab{$_}; + my $part=$keyroot; + $part=~s/^\_//; if ($subp eq 'display') { - my $part=$keyroot; - $part=~s/^\_//; $value.=' [Part: '.$part.']'; } my $unikey='parameter'.$keyroot.'_'.$name; $metathesekeys{$unikey}=1; + $metacache{$uri.':'.$unikey.'.part'}=$part; unless (defined($metacache{$uri.':'.$unikey.'.'.$subp})) { $metacache{$uri.':'.$unikey.'.'.$subp}=$value; @@ -2197,7 +2215,11 @@ if ($readit ne 'done') { while (my $configline=<$config>) { chomp($configline); my ($short,$plain)=split(/:/,$configline); - if ($plain ne '') { $packagetab{$short}=$plain; } + my ($pack,$name)=split(/\&/,$short); + if ($plain ne '') { + $packagetab{$pack.'&'.$name.'&name'}=$name; + $packagetab{$short}=$plain; + } } }