version 1.154, 2003/03/08 20:52:41
|
version 1.156, 2003/03/13 17:05:36
|
Line 188 sub real_handler {
|
Line 188 sub real_handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
# See if there's only one map in the top-level... if so, |
|
# automatically display it |
|
my $iterator = $navmap->getIterator(undef, undef, undef, 0); |
|
my $depth = 1; |
|
$iterator->next(); |
|
my $curRes = $iterator->next(); |
|
my $sequenceCount = 0; |
|
my $sequenceId; |
|
while ($depth > 0) { |
|
if ($curRes == $iterator->BEGIN_MAP()) { $depth++; } |
|
if ($curRes == $iterator->END_MAP()) { $depth--; } |
|
|
|
if (ref($curRes) && $curRes->is_sequence()) { |
|
$sequenceCount++; |
|
$sequenceId = $curRes->map_pc(); |
|
} |
|
|
|
$curRes = $iterator->next(); |
|
} |
|
|
|
if ($sequenceCount == 1) { |
|
# The automatic iterator creation in the render call |
|
# will pick this up. |
|
$ENV{'form.filter'} = "$sequenceId"; |
|
} |
|
|
# renderer call |
# renderer call |
my $render = render({ 'cols' => [0,1,2,3], |
my $render = render({ 'cols' => [0,1,2,3], |
'url' => '/adm/navmaps', |
'url' => '/adm/navmaps', |
Line 594 sub render_resource {
|
Line 620 sub render_resource {
|
my $icon = "<img src='/adm/lonIcons/html.gif' alt='' border='0' />"; |
my $icon = "<img src='/adm/lonIcons/html.gif' alt='' border='0' />"; |
|
|
if ($resource->is_problem()) { |
if ($resource->is_problem()) { |
if ($part eq "0" || $params->{'condensed'}) { |
if ($part eq "" || $params->{'condensed'}) { |
$icon = '<img src="/adm/lonIcons/problem.gif" alt="" border="0" />'; |
$icon = '<img src="/adm/lonIcons/problem.gif" alt="" border="0" />'; |
} else { |
} else { |
$icon = $params->{'indentString'}; |
$icon = $params->{'indentString'}; |
Line 666 sub render_resource {
|
Line 692 sub render_resource {
|
$curMarkerEnd = '<font color="red" size="+2"><</font>'; |
$curMarkerEnd = '<font color="red" size="+2"><</font>'; |
} |
} |
|
|
if ($resource->is_problem() && $part ne "0" && |
if ($resource->is_problem() && $part ne "" && |
!$params->{'condensed'}) { |
!$params->{'condensed'}) { |
$partLabel = " (Part $part)"; |
$partLabel = " (Part $part)"; |
$title = ""; |
$title = ""; |
Line 1081 sub render {
|
Line 1107 sub render {
|
|
|
# If this has been filtered out, continue on |
# If this has been filtered out, continue on |
if (!(&$filterFunc($curRes))) { |
if (!(&$filterFunc($curRes))) { |
$curRes = $it->next(); |
|
$args->{'isNewBranch'} = 0; # Don't falsely remember this |
$args->{'isNewBranch'} = 0; # Don't falsely remember this |
next; |
next; |
} |
} |
|
|
# If we're suppressing navmaps and this is a navmap, continue on |
# If we're suppressing navmaps and this is a navmap, continue on |
if ($suppressNavmap && $curRes->src() =~ /^\/adm\/navmaps/) { |
if ($suppressNavmap && $curRes->src() =~ /^\/adm\/navmaps/) { |
$curRes = $it->next(); |
|
next; |
next; |
} |
} |
|
|
Line 1142 sub render {
|
Line 1166 sub render {
|
|
|
} |
} |
} |
} |
|
|
} else { |
|
# Not showing parts |
|
@parts = ("0"); # show main part only |
|
} |
} |
|
|
# If the multipart problem was condensed, "forget" it was multipart |
# If the multipart problem was condensed, "forget" it was multipart |
if (scalar(@parts) == 1) { |
if (scalar(@parts) == 1) { |
$args->{'multipart'} = 0; |
$args->{'multipart'} = 0; |
} |
} |
|
|
# In the event of a network error, display one part. |
|
# If this is a single part, we can at least show the correct |
|
# status, but if it's multipart, we're lost, since we can't |
|
# retreive the metadata to count the parts |
|
if ($curRes->{RESOURCE_ERROR}) { |
|
@parts = ("0"); |
|
} |
|
|
|
# Now, we've decided what parts to show. Loop through them and |
# Now, we've decided what parts to show. Loop through them and |
# show them. |
# show them. |
foreach my $part (@parts) { |
foreach my $part ('', @parts) { |
|
if ($part eq '0') { |
|
next; |
|
} |
$rownum ++; |
$rownum ++; |
my $backgroundColor = $backgroundColors[$rownum % scalar(@backgroundColors)]; |
my $backgroundColor = $backgroundColors[$rownum % scalar(@backgroundColors)]; |
|
|
Line 1209 sub render {
|
Line 1224 sub render {
|
$result = ""; |
$result = ""; |
$r->rflush(); |
$r->rflush(); |
} |
} |
|
} continue { |
$curRes = $it->next(); |
$curRes = $it->next(); |
} |
} |
|
|
Line 2730 sub extractParts {
|
Line 2745 sub extractParts {
|
$self->{PARTS} = \@sortedParts; |
$self->{PARTS} = \@sortedParts; |
} |
} |
|
|
# Ensure part 0 is included at the beginning. |
|
if ($self->{PARTS}->[0] ne '0') { |
|
unshift @{$self->{PARTS}}, '0'; |
|
} |
|
|
|
return; |
return; |
} |
} |
|
|