--- loncom/interface/lonnavmaps.pm 2002/09/02 18:25:55 1.45 +++ loncom/interface/lonnavmaps.pm 2002/09/05 19:47:29 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.45 2002/09/02 18:25:55 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.48 2002/09/05 19:47:29 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,6 +67,10 @@ my %courseopt; my %useropt; my %parmhash; +# This parameter keeps track of whether obtaining the user's information +# failed, which the colorizer in astatus can use +my $networkFailedFlag = 0; + # ------------------------------------------------------------------ Euclid gcd sub euclid { @@ -458,9 +462,9 @@ sub handler { my ($cdom,$cnum)=split(/\_/,$cid); my $userprefix=$uname.'_'.$udom.'_'; - + unless ($uhome eq 'no_host') { -# -------------------------------------------------------------- Get coursedata +# ------------------------------------------------- Get coursedata (if present) unless ((time-$courserdatas{$cid.'.last_cache'})<240) { my $reply=&Apache::lonnet::reply('dump:'.$cdom.':'.$cnum. ':resourcedata',$chome); @@ -468,6 +472,11 @@ sub handler { $courserdatas{$cid}=$reply; $courserdatas{$cid.'.last_cache'}=time; } + # check to see if network failed + elsif ( $reply=~/no.such.host/i || $reply=~/con.*lost/i ) + { + $networkFailedFlag = 1; + } } foreach (split(/\&/,$courserdatas{$cid})) { my ($name,$value)=split(/\=/,$_); @@ -584,6 +593,15 @@ sub handler { ($currenturl!~/^\/res\/adm/)) { $r->print('Current Location
'); } + + # Handle a network error + + if ($networkFailedFlag) + { + $r->print('
LON-CAPA's network is having difficulties, some problem" . + " information, such as due dates, will not be available."); + } # ----------------------------------------------------- The little content list for ($i=0;$i<=$#rows;$i++) { if ($rows[$i]) { @@ -613,8 +631,6 @@ sub handler { my $indent;my $indentstr; my $linkid; my $rid=$colcont[$j]; - - # bug? $rid can't accept a list of two elements $rid=~/(\d+)\.(\d+)$/; my $src= &Apache::lonnet::declutter($hash{'src_'.$1.'.'.$2}); @@ -644,19 +660,36 @@ sub handler { my $tcode=$2; my $ctext=$3; $rid=$4; - if ($tcode eq '1') { + + # will open later + if ($tcode eq '1') { $add='