--- loncom/interface/lonnavmaps.pm 2006/05/15 19:29:03 1.382
+++ loncom/interface/lonnavmaps.pm 2006/06/29 16:32:14 1.389
@@ -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.389 2006/06/29 16:32:14 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);
}
}
@@ -1091,7 +1096,13 @@ sub render_resource {
if ($resource->is_problem()) {
if ($part eq '0' || $params->{'condensed'}) {
- $icon ='';
+ $icon = '';
} else {
$icon = $params->{'indentString'};
}
@@ -1122,9 +1133,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 +1187,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 +1231,7 @@ sub render_communication_status {
foreach (split(/\,/, $feedback)) {
if ($_) {
$feedbackHTML .= ' '
+ . &escape($_) . '">'
. '';
}
@@ -1235,7 +1246,7 @@ sub render_communication_status {
if ($_) {
$errorcount++;
$errorHTML .= ' '
+ . &escape($_) . '">'
. '';
}
@@ -1469,7 +1480,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 +1619,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 +1669,7 @@ END
if ($args->{'caller'} eq 'navmapsdisplay') {
$result .= '
'. - &Apache::loncommon::help_open_menu('','Navigation Screen','Navigation_Screen','',undef,'RAT').' | '; + &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').''; if ($env{'environment.remotenavmap'} ne 'on') { $result .= ''; } else { @@ -1923,7 +1934,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 +2239,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 +2585,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 +4175,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. |