version 1.146, 2003/02/21 21:40:07
|
version 1.152, 2003/03/04 22:30:10
|
Line 44 package Apache::lonnavmaps;
|
Line 44 package Apache::lonnavmaps;
|
use strict; |
use strict; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Apache::loncommon(); |
use Apache::loncommon(); |
|
use Apache::lonmenu(); |
use POSIX qw (floor strftime); |
use POSIX qw (floor strftime); |
|
|
my %navmaphash; |
my %navmaphash; |
Line 152 sub real_handler {
|
Line 153 sub real_handler {
|
} |
} |
|
|
$r->print("<html><head>\n"); |
$r->print("<html><head>\n"); |
$r->print("<title>Navigate Course Contents</title></head>"); |
$r->print("<title>Navigate Course Contents</title>"); |
|
# ------------------------------------------------------------ Get query string |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['register']); |
|
# ----------------------------------------------------- Force menu registration |
|
my $addentries=''; |
|
if ($ENV{'form.register'}) { |
|
$addentries=' onLoad="'.&Apache::lonmenu::loadevents(). |
|
'" onUnload="'.&Apache::lonmenu::unloadevents().'"'; |
|
$r->print(&Apache::lonmenu::registerurl(1)); |
|
} |
|
|
# Header |
# Header |
$r->print(&Apache::loncommon::bodytag('Navigate Course Contents','', |
$r->print('</head>'. |
'')); |
&Apache::loncommon::bodytag('Navigate Course Contents','', |
|
$addentries,'','',$ENV{'form.register'})); |
$r->print('<script>window.focus();</script>'); |
$r->print('<script>window.focus();</script>'); |
|
|
$r->rflush(); |
$r->rflush(); |
Line 178 sub real_handler {
|
Line 189 sub real_handler {
|
# 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', |
'printKey' => 1, |
#'printKey' => 1, |
'r' => $r}); |
'r' => $r}); |
|
|
$navmap->untieHashes(); |
$navmap->untieHashes(); |
Line 2687 sub extractParts {
|
Line 2698 sub extractParts {
|
|
|
# Retrieve part count, if this is a problem |
# Retrieve part count, if this is a problem |
if ($self->is_problem()) { |
if ($self->is_problem()) { |
my $metadata = &Apache::lonnet::metadata($self->src(), 'allpossiblekeys'); |
my $metadata = &Apache::lonnet::metadata($self->src(), 'packages'); |
if (!$metadata) { |
if (!$metadata) { |
$self->{RESOURCE_ERROR} = 1; |
$self->{RESOURCE_ERROR} = 1; |
$self->{PARTS} = []; |
$self->{PARTS} = []; |
return; |
return; |
} |
} |
|
|
foreach (split(/\,/,$metadata)) { |
foreach (split(/\,/,$metadata)) { |
if ($_ =~ /^parameter\_(.*)\_opendate$/) { |
if ($_ =~ /^part_(.*)$/) { |
push @{$self->{PARTS}}, $1; |
my $part = $1; |
|
# check to see if part is turned off. |
|
if (! Apache::loncommon::check_if_partid_hidden($part, $self->symb())) { |
|
push @{$self->{PARTS}}, $1; |
|
} |
} |
} |
} |
} |
|
|
|
|
# Is this possible to do in one line? - Jeremy |
|
my @sortedParts = sort @{$self->{PARTS}}; |
my @sortedParts = sort @{$self->{PARTS}}; |
$self->{PARTS} = \@sortedParts; |
$self->{PARTS} = \@sortedParts; |
} |
} |