--- loncom/interface/lonnavmaps.pm 2006/05/15 23:40:54 1.383 +++ loncom/interface/lonnavmaps.pm 2006/06/26 22:31:56 1.388 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.383 2006/05/15 23:40:54 albertel Exp $ +# $Id: lonnavmaps.pm,v 1.388 2006/06/26 22:31:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,6 +40,8 @@ use Apache::lonnet; use POSIX qw (floor strftime); use Data::Dumper; # for debugging, not always use Time::HiRes qw( gettimeofday tv_interval ); +use lib '/home/httpd/lib/perl/'; +use LONCAPA; # symbolic constants sub SYMB { return 1; } @@ -258,7 +260,10 @@ MENU } # Header - $r->print(&Apache::loncommon::start_page('Navigate Course Contents',$js, + my $course_type = &Apache::loncommon::course_type(); + $r->print(&Apache::loncommon::start_page('Navigate '.$course_type. + ' Contents', + $js, {'only_body' => $body_only, 'force_register' => $env{'form.register'},})); @@ -268,9 +273,9 @@ MENU # Check that it's defined if (!($navmap->courseMapDefined())) { - $r->print(&Apache::loncommon::help_open_menu('','Navigation Screen','Navigation_Screen','',undef,'RAT')); - $r->print(''.&mt('Coursemap undefined.'). - '' . + $r->print(&Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT')); + $r->print(''.&mt('Coursemap undefined.'). + '' . &Apache::loncommon::end_page()); return OK; } @@ -469,14 +474,14 @@ sub getLinkForResource { my $anchor; if ($res->is_page()) { foreach (@$stack) { if (defined($_)) { $anchor = $_; } } - $anchor=&Apache::lonnet::escape($anchor->shown_symb()); + $anchor=&escape($anchor->shown_symb()); return ($res->link(),$res->shown_symb(),$anchor); } # in case folder was skipped over as "only sequence" my ($map,$id,$src)=&Apache::lonnet::decode_symb($res->symb()); if ($map=~/\.page$/) { my $url=&Apache::lonnet::clutter($map); - $anchor=&Apache::lonnet::escape($src->shown_symb()); + $anchor=&escape($src->shown_symb()); return ($url,$res->shown_symb(),$anchor); } } @@ -1122,9 +1127,9 @@ sub render_resource { removeFromFilter($filter, $mapId); $linkopen .= "&condition=" . $it->{CONDITION} . '&hereType=' . $params->{'hereType'} . '&here=' . - &Apache::lonnet::escape($params->{'here'}) . + &escape($params->{'here'}) . '&jump=' . - &Apache::lonnet::escape($resource->symb()) . + &escape($resource->symb()) . "&folderManip=1\">"; } else { @@ -1176,7 +1181,7 @@ sub render_resource { !$params->{'condensed'}) { my $displaypart=$resource->part_display($part); $partLabel = " (".&mt('Part: [_1]', $displaypart).")"; - if ($link!~/\#/) { $link.='#'.&Apache::lonnet::escape($part); } + if ($link!~/\#/) { $link.='#'.&escape($part); } $title = ""; } @@ -1220,7 +1225,7 @@ sub render_communication_status { foreach (split(/\,/, $feedback)) { if ($_) { $feedbackHTML .= ' ' + . &escape($_) . '">' . ''; } @@ -1235,7 +1240,7 @@ sub render_communication_status { if ($_) { $errorcount++; $errorHTML .= ' ' + . &escape($_) . '">' . ''; } @@ -1469,7 +1474,7 @@ sub render { $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { # no londer in course - return ''.&mt('No course selected').'
+ return ''.&mt('No course selected').'
'.&mt('Select a course').'
'; } } @@ -1608,11 +1613,11 @@ sub render { my ($link,$text); if ($condition) { $link='"navmaps?condition=0&filter=&'.$queryString. - '&here='.&Apache::lonnet::escape($here).'"'; + '&here='.&escape($here).'"'; $text='Close all folders'; } else { $link='"navmaps?condition=1&filter=&'.$queryString. - '&here='.&Apache::lonnet::escape($here).'"'; + '&here='.&escape($here).'"'; $text='Open all folders'; } if ($args->{'caller'} eq 'navmapsdisplay') { @@ -1658,7 +1663,7 @@ END if ($args->{'caller'} eq 'navmapsdisplay') { $result .= ''; + &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').''; if ($env{'environment.remotenavmap'} ne 'on') { $result .= ''; } else { @@ -1923,7 +1928,7 @@ END my $srcHasQuestion = $src =~ /\?/; $args->{"resourceLink"} = $src. ($srcHasQuestion?'&':'?') . - 'symb=' . &Apache::lonnet::escape($symb).$anchor; + 'symb=' . &escape($symb).$anchor; } # Now, we've decided what parts to show. Loop through them and # show them. @@ -2228,7 +2233,7 @@ sub generate_email_discuss_status { foreach my $msgid (@keys) { if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) { my $plain= - &Apache::lonnet::unescape(&Apache::lonnet::unescape($msgid)); + &LONCAPA::unescape(&LONCAPA::unescape($msgid)); if ($plain=~/ \[([^\]]+)\]\:/) { my $url=$1; if ($plain=~/\:Error \[/) { @@ -4164,7 +4169,7 @@ email data was not extracted when the na used like this: for (split(/\,/, $res->getFeedback())) { - my $link = &Apache::lonnet::escape($_); + my $link = &escape($_); ... and use the link as appropriate.
'. - &Apache::loncommon::help_open_menu('','Navigation Screen','Navigation_Screen','',undef,'RAT').'