version 1.438, 2007/09/02 02:10:31
|
version 1.439, 2007/09/07 00:07:30
|
Line 56 my %bubble_lines_per_response; # no.
|
Line 56 my %bubble_lines_per_response; # no.
|
# --- Retrieve the parts from the metadata file.--- |
# --- Retrieve the parts from the metadata file.--- |
sub getpartlist { |
sub getpartlist { |
my ($symb) = @_; |
my ($symb) = @_; |
my (undef,undef,$url) = &Apache::lonnet::decode_symb($symb); |
|
my $partorder = &Apache::lonnet::metadata($url, 'partorder'); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my @parts; |
my $res = $navmap->getBySymb($symb); |
if ($partorder) { |
my $partlist = $res->parts(); |
for my $part (split (/,/,$partorder)) { |
my $url = $res->src(); |
if (!&Apache::loncommon::check_if_partid_hidden($part,$symb)) { |
my @metakeys = split(/,/,&Apache::lonnet::metadata($url,'keys')); |
push(@parts, $part); |
|
} |
|
} |
|
} else { |
|
my $metadata = &Apache::lonnet::metadata($url, 'packages'); |
|
foreach (split(/\,/,$metadata)) { |
|
if ($_ =~ /^part_(.*)$/) { |
|
if (!&Apache::loncommon::check_if_partid_hidden($1,$symb)) { |
|
push(@parts, $1); |
|
} |
|
} |
|
} |
|
} |
|
my @stores; |
my @stores; |
foreach my $part (@parts) { |
foreach my $part (@{ $partlist }) { |
my (@metakeys) = split(/,/,&Apache::lonnet::metadata($url,'keys')); |
|
foreach my $key (@metakeys) { |
foreach my $key (@metakeys) { |
if ($key =~ m/^stores_\Q$part\E_/) { push(@stores,$key); } |
if ($key =~ m/^stores_\Q$part\E_/) { push(@stores,$key); } |
} |
} |
Line 3413 sub split_part_type {
|
Line 3400 sub split_part_type {
|
my ($partstr) = @_; |
my ($partstr) = @_; |
my ($temp,@allparts)=split(/_/,$partstr); |
my ($temp,@allparts)=split(/_/,$partstr); |
my $type=pop(@allparts); |
my $type=pop(@allparts); |
my $part=join('.',@allparts); |
my $part=join('_',@allparts); |
return ($part,$type); |
return ($part,$type); |
} |
} |
|
|