--- loncom/interface/lonnavmaps.pm 2002/07/08 20:27:10 1.38 +++ loncom/interface/lonnavmaps.pm 2002/09/02 18:25:55 1.45 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.38 2002/07/08 20:27:10 www Exp $ +# $Id: lonnavmaps.pm,v 1.45 2002/09/02 18:25:55 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -339,7 +339,7 @@ sub tracetable { my ($sofar,$rid,$beenhere,$showtypes,$indent,$linkid)=@_; my $newshowtypes=$showtypes; my $further=$sofar; - #$Apache::lonxml::debug=1; +# $Apache::lonxml::debug=1; &Apache::lonxml::debug("$rid ; $linkid ; $sofar ; $beenhere ; ".$hash{'src_'.$rid}); if ($beenhere=~/\&$rid\&/) { return $further; } $beenhere.=$rid.'&'; @@ -411,10 +411,10 @@ sub handler { if ($ENV{'request.course.fn'}) { $fn=$ENV{'request.course.fn'}; if (-e "$fn.db") { - if ((tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER,0640)) && + if ((tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640)) && (tie(%parmhash,'GDBM_File', $ENV{'request.course.fn'}.'_parms.db', - &GDBM_READER,0640))) { + &GDBM_READER(),0640))) { $hashtied=1; } } @@ -434,8 +434,10 @@ sub handler { &Apache::loncommon::no_cache($r); $r->send_http_header; - my $firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}}; - my $lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}}; + my $firstres=$hash{'map_start_'. + &Apache::lonnet::clutter($ENV{'request.course.uri'})}; + my $lastres=$hash{'map_finish_'. + &Apache::lonnet::clutter($ENV{'request.course.uri'})}; if (!(($firstres) && ($lastres))) { $r->print('Coursemap undefined.'); } else { @@ -489,13 +491,7 @@ sub handler { @rows=(); - &tracetable(0,$firstres,'&'.$lastres.'&','',0); - if ($hash{'src_'.$lastres}) { - my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$lastres}); - if (($brepriv eq '2') || ($brepriv eq 'F')) { - $rows[$#rows+1]=''.$lastres; - } - } + &tracetable(0,$firstres,'&','',0); # ------------------------------------------------------------------ Page parms @@ -567,16 +563,19 @@ sub handler { } } # ----------------------------------------------------------- Start Page Output - $r->print('Navigate LON-CAPA Maps'); - $r->print('print( + 'Navigate Course Map'); if (($currenturl=~/^\/res/) && ($currenturl!~/^\/res\/adm/)) { - $r->print(' onLoad="window.location.hash='."'curloc'".'"'); + $bodytagadd='onLoad="window.location.hash='."'curloc'".'"'; } - $r->print('>'. - ''. - '

Navigate Course Map

'. - "

$date

"); + $r->print(&Apache::loncommon::bodytag('Navigate Course Map','', + $bodytagadd)); + $r->print(''); + my $desc=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; + if (defined($desc)) { $r->print("

$desc

\n"); } + $r->print("

$date

\n"); $r->rflush(); $r->print(' New discussion since '. localtime($lastcheck). @@ -608,10 +607,14 @@ sub handler { $r->print("\n"); my @colcont=split(/\&/,$rows[$i]); my $avespan=$lcm/($#colcont+1); + + # for each item I wish to print on this row... for ($j=0;$j<=$#colcont;$j++) { 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}); @@ -649,7 +652,7 @@ sub handler { } elsif ($code eq '4') { $add=''; } else { - $add=''; + $add=''; if ($tcode eq '2') { $add=''; } @@ -716,7 +719,8 @@ sub handler { $r->print($add.$indentstr); if ($rid) { $r->print(''. $hwk.$hash{'title_'.$rid}.$hwke.''); }