--- loncom/interface/lonnavmaps.pm 2002/10/08 20:39:43 1.71
+++ loncom/interface/lonnavmaps.pm 2002/10/24 19:10:07 1.86
@@ -1,7 +1,8 @@
+
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.71 2002/10/08 20:39:43 www Exp $
+# $Id: lonnavmaps.pm,v 1.86 2002/10/24 19:10:07 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,8 +45,8 @@ use strict;
use Apache::Constants qw(:common :http);
use Apache::lonnet();
use Apache::loncommon();
-use HTML::TokeParser;
use GDBM_File;
+use POSIX qw (floor strftime);
# -------------------------------------------------------------- Module Globals
my %hash;
@@ -822,7 +823,7 @@ sub new_handle {
# Initialize the nav map
my $navmap = Apache::lonnavmaps::navmap->new(
$ENV{"request.course.fn"}.".db",
- $ENV{"request.course.fn"}."_parms.db", 1);
+ $ENV{"request.course.fn"}."_parms.db", 1, 1);
if (!defined($navmap)) {
@@ -842,16 +843,12 @@ sub new_handle {
$r->rflush();
if ($navmap->{LAST_CHECK}) {
$r->print(' New discussion since '.
- timeToHumanString($navmap->{LAST_CHECK}).
+ strftime("%A, %b %e at %I:%M %P", localtime($navmap->{LAST_CHECK})).
'
New message (click to open)
');
} else {
$r->print(' Discussions'.
'
New message (click to open)
'); } - #if (($currenturl=~/^\/res/) && - # ($currenturl!~/^\/res\/adm/)) { - # $r->print('Current Location
');
- #}
# Check that it's defined
if (!($navmap->courseMapDefined())) {
@@ -879,7 +876,7 @@ sub new_handle {
$res->NOTHING_SET => '' );
# And a special case in the nav map; what to do when the assignment
# is not yet done and due in less then 24 hours
- my $hurryUpColor = "#FFCCCC";
+ my $hurryUpColor = "#FF0000";
my %statusIconMap =
( $res->NETWORK_FAILURE => '',
@@ -893,7 +890,7 @@ sub new_handle {
$res->TRIES_LEFT => 'navmap.open.gif',
$res->INCORRECT => 'navmap.wrong.gif',
$res->OPEN => 'navmap.open.gif',
- $res->ATTEMPTED => '' );
+ $res->ATTEMPTED => 'navmap.open.gif' );
my %iconAltTags =
( 'navmap.correct.gif' => 'Correct',
@@ -916,30 +913,76 @@ sub new_handle {
my $currenturl = $ENV{'form.postdata'};
$currenturl=~s/^http\:\/\///;
$currenturl=~s/^[^\/]+//;
- my $queryAdd = "postdata=" . &Apache::lonnet::escape($currenturl);
+ # alreadyHere allows us to only open the maps necessary to view
+ # the current location once, while at the same time remembering
+ # the current location. Without that check, the user would never
+ # be able to close those maps; the user would close it, and the
+ # currenturl scan would re-open it.
+ my $queryAdd = "postdata=" . &Apache::lonnet::escape($currenturl) .
+ "&alreadyHere=1";
$r->print('Show All Resources
');
# Begin the HTML table
# four cols: resource + indent, chat+feedback, icon, text string
- $r->print('