version 1.219, 2003/07/29 05:22:56
|
version 1.220, 2003/08/07 14:29:43
|
Line 129 sub real_handler {
|
Line 129 sub real_handler {
|
$r->send_http_header; |
$r->send_http_header; |
|
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new( |
my $navmap = Apache::lonnavmaps::navmap->new(1, 1); |
$ENV{"request.course.fn"}.".db", |
|
$ENV{"request.course.fn"}."_parms.db", 1, 1); |
|
|
|
|
|
if (!defined($navmap)) { |
if (!defined($navmap)) { |
Line 1172 sub render {
|
Line 1170 sub render {
|
if (!$ENV{'form.folderManip'} && !defined($args->{'iterator'})) { |
if (!$ENV{'form.folderManip'} && !defined($args->{'iterator'})) { |
# Step 1: Check to see if we have a navmap |
# Step 1: Check to see if we have a navmap |
if (!defined($navmap)) { |
if (!defined($navmap)) { |
$navmap = Apache::lonnavmaps::navmap->new( |
$navmap = Apache::lonnavmaps::navmap->new(1, 1); |
$ENV{"request.course.fn"}.".db", |
|
$ENV{"request.course.fn"}."_parms.db", 1, 1); |
|
$mustCloseNavMap = 1; |
$mustCloseNavMap = 1; |
} |
} |
$navmap->init(); |
$navmap->init(); |
Line 1238 sub render {
|
Line 1234 sub render {
|
|
|
# Step 1: Check to see if we have a navmap |
# Step 1: Check to see if we have a navmap |
if (!defined($navmap)) { |
if (!defined($navmap)) { |
$navmap = Apache::lonnavmaps::navmap->new($r, |
$navmap = Apache::lonnavmaps::navmap->new(1, 1); |
$ENV{"request.course.fn"}.".db", |
|
$ENV{"request.course.fn"}."_parms.db", 1, 1); |
|
$mustCloseNavMap = 1; |
$mustCloseNavMap = 1; |
} |
} |
# Paranoia: Make sure it's ready |
# Paranoia: Make sure it's ready |
Line 1646 To create a navmap object, use the follo
|
Line 1640 To create a navmap object, use the follo
|
|
|
=over 4 |
=over 4 |
|
|
=item * B<Apache::lonnavmaps::navmap-E<gt>new>(navHashFile, parmHashFile, |
=item * B<Apache::lonnavmaps::navmap-E<gt>new>( |
genCourseAndUserOptions, genMailDiscussStatus, getUserData): |
genCourseAndUserOptions, genMailDiscussStatus, getUserData): |
|
|
Binds a new navmap object to the compiled nav map hash and parm hash |
Creates a new navmap object. genCourseAndUserOptions is a flag saying whether |
given as filenames. genCourseAndUserOptions is a flag saying whether |
|
the course options and user options hash should be generated. This is |
the course options and user options hash should be generated. This is |
for when you are using the parameters of the resources that require |
for when you are using the parameters of the resources that require |
them; see documentation in resource object |
them; see documentation in resource object |
Line 1692 sub new {
|
Line 1685 sub new {
|
my $class = ref($proto) || $proto; |
my $class = ref($proto) || $proto; |
my $self = {}; |
my $self = {}; |
|
|
$self->{NAV_HASH_FILE} = shift; |
|
$self->{PARM_HASH_FILE} = shift; |
|
$self->{GENERATE_COURSE_USER_OPT} = shift; |
$self->{GENERATE_COURSE_USER_OPT} = shift; |
$self->{GENERATE_EMAIL_DISCUSS_STATUS} = shift; |
$self->{GENERATE_EMAIL_DISCUSS_STATUS} = shift; |
$self->{GET_USER_DATA} = shift; |
$self->{GET_USER_DATA} = shift; |
Line 1710 sub new {
|
Line 1701 sub new {
|
|
|
my %navmaphash; |
my %navmaphash; |
my %parmhash; |
my %parmhash; |
if (!(tie(%navmaphash, 'GDBM_File', $self->{NAV_HASH_FILE}, |
my $courseFn = $ENV{"request.course.fn"}; |
|
if (!(tie(%navmaphash, 'GDBM_File', "${courseFn}.db", |
&GDBM_READER(), 0640))) { |
&GDBM_READER(), 0640))) { |
return undef; |
return undef; |
} |
} |
|
|
if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE}, |
if (!(tie(%parmhash, 'GDBM_File', "${courseFn}_parms.db", |
&GDBM_READER(), 0640))) |
&GDBM_READER(), 0640))) |
{ |
{ |
untie %{$self->{PARM_HASH}}; |
untie %{$self->{PARM_HASH}}; |