version 1.482, 2004/04/01 14:55:18
|
version 1.483, 2004/04/01 15:12:26
|
Line 4076 sub metadata {
|
Line 4076 sub metadata {
|
# the next is the end of "start tag" |
# the next is the end of "start tag" |
} |
} |
} |
} |
|
my ($extension) = ($uri =~ /\.(\w+)$/); |
|
foreach my $key (sort(keys(%packagetab))) { |
|
#&logthis("extsion1 $extension $key !!"); |
|
#no specific packages #how's our extension |
|
if ($key!~/^extension_\Q$extension\E&/) { next; } |
|
&metadata_create_pacakge_def($uri,$key,'extension_'.$extension, |
|
\%metathesekeys); |
|
} |
|
if (!exists($metacache{$uri}->{':packages'})) { |
|
foreach my $key (sort(keys(%packagetab))) { |
|
#no specific packages well let's get default then |
|
if ($key!~/^default&/) { next; } |
|
&metadata_create_pacakge_def($uri,$key,'default', |
|
\%metathesekeys); |
|
} |
|
} |
# are there custom rights to evaluate |
# are there custom rights to evaluate |
if ($metacache{$uri}->{':copyright'} eq 'custom') { |
if ($metacache{$uri}->{':copyright'} eq 'custom') { |
|
|
Line 4104 sub metadata {
|
Line 4120 sub metadata {
|
return $metacache{$uri}->{':'.$what}; |
return $metacache{$uri}->{':'.$what}; |
} |
} |
|
|
|
sub metadata_create_pacakge_def { |
|
my ($uri,$key,$package,$metathesekeys)=@_; |
|
my ($pack,$name,$subp)=split(/\&/,$key); |
|
if ($subp eq 'default') { next; } |
|
|
|
if (defined($metacache{$uri}->{':packages'})) { |
|
$metacache{$uri}->{':packages'}.=','.$package; |
|
} else { |
|
$metacache{$uri}->{':packages'}=$package; |
|
} |
|
my $value=$packagetab{$key}; |
|
my $unikey; |
|
$unikey='parameter_0_'.$name; |
|
$metacache{$uri}->{':'.$unikey.'.part'}=0; |
|
$$metathesekeys{$unikey}=1; |
|
unless (defined($metacache{$uri}->{':'.$unikey.'.'.$subp})) { |
|
$metacache{$uri}->{':'.$unikey.'.'.$subp}=$value; |
|
} |
|
if (defined($metacache{$uri}->{':'.$unikey.'.default'})) { |
|
$metacache{$uri}->{':'.$unikey}= |
|
$metacache{$uri}->{':'.$unikey.'.default'}; |
|
} |
|
} |
|
|
sub metadata_generate_part0 { |
sub metadata_generate_part0 { |
my ($metadata,$metacache,$uri) = @_; |
my ($metadata,$metacache,$uri) = @_; |
my %allnames; |
my %allnames; |
Line 4909 BEGIN {
|
Line 4949 BEGIN {
|
open(my $config,"<$perlvar{'lonTabDir'}/packages.tab"); |
open(my $config,"<$perlvar{'lonTabDir'}/packages.tab"); |
|
|
while (my $configline=<$config>) { |
while (my $configline=<$config>) { |
|
if ($configline !~ /\S/ || $configline=~/^#/) { next; } |
chomp($configline); |
chomp($configline); |
my ($short,$plain)=split(/:/,$configline); |
my ($short,$plain)=split(/:/,$configline); |
my ($pack,$name)=split(/\&/,$short); |
my ($pack,$name)=split(/\&/,$short); |