--- loncom/interface/lonnavmaps.pm 2006/05/15 19:29:03 1.382
+++ loncom/interface/lonnavmaps.pm 2006/06/03 20:36:24 1.386
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.382 2006/05/15 19:29:03 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.386 2006/06/03 20:36:24 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,11 +260,15 @@ 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'},}));
- $r->print('');
+ $r->print(&mt('Navigate '.$course_type.' Contents').
+ '');
$r->rflush();
@@ -469,14 +475,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 +1128,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 +1182,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 +1226,7 @@ sub render_communication_status {
foreach (split(/\,/, $feedback)) {
if ($_) {
$feedbackHTML .= ' '
+ . &escape($_) . '">'
. '
';
}
@@ -1235,7 +1241,7 @@ sub render_communication_status {
if ($_) {
$errorcount++;
$errorHTML .= ' '
+ . &escape($_) . '">'
. '
';
}
@@ -1608,11 +1614,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') {
@@ -1923,7 +1929,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 +2234,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 \[/) {
@@ -2574,7 +2580,7 @@ sub parmval_real {
my $result='';
my ($mapname,$id,$fn)=&Apache::lonnet::decode_symb($symb);
-
+ $mapname = &Apache::lonnet::deversion($mapname);
# ----------------------------------------------------- Cascading lookup scheme
my $rwhat=$what;
$what=~s/^parameter\_//;
@@ -4164,7 +4170,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.