--- loncom/interface/lonnavdisplay.pm 2008/03/12 02:45:07 1.3
+++ loncom/interface/lonnavdisplay.pm 2010/10/04 21:46:32 1.13.6.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavdisplay.pm,v 1.3 2008/03/12 02:45:07 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.13.6.2 2010/10/04 21:46:32 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -133,12 +133,13 @@ MENU
if (!defined($navmap)) {
my $requrl = $r->uri;
$env{'user.error.msg'} = "$requrl:bre:0:0:Course not initialized";
+ $env{'user.reinit'} = 1;
return HTTP_NOT_ACCEPTABLE;
}
$r->send_http_header;
# ------------------------------------------------------------ Get query string
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['register','sort','showOnlyHomework','postsymb']);
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sort','showOnlyHomework','postsymb','register']);
# ----------------------------------------------------- Force menu registration
my $body_only='';
@@ -154,13 +155,29 @@ MENU
# Header
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('');
+ my ($title,$breadcrumb_text,$start_page,$args);
+ if ($course_type eq 'Community') {
+ $title = 'Community Contents';
+ $breadcrumb_text = &mt('Community Contents');
+ } else {
+ $title = 'Course Contents';
+ $breadcrumb_text = &mt('Course Contents');
+ }
+ if ($env{'form.register'}) {
+ $args = {'force_register' => $env{'form.register'},
+ 'only_body' => $body_only};
+ $start_page = &Apache::loncommon::start_page($title,$js,$args);
+ } else {
+ my $brcrum = [{href => '/adm/navmaps',
+ text => $breadcrumb_text,
+ no_mt => 1},
+ ];
+ $args = {'bread_crumbs' => $brcrum,
+ 'only_body' => $body_only};
+ $start_page = &Apache::loncommon::start_page($title,$js,$args);
+ }
+ $r->print($start_page.
+ '');
$r->rflush();
@@ -255,11 +272,17 @@ MENU
# If we found no problems, print a note to that effect.
if (!$foundDoableProblem) {
- $r->print("All homework assignments have been completed.
");
+ $r->print(""
+ .&mt("All homework assignments have been completed.")
+ ."");
}
} else {
+ my $link = 'navmaps?jumpToFirstHomework';
+ if ($env{'form.register'}) {
+ $link .= '®ister='.$env{'form.register'};
+ }
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'firsthomework',
- 'location.href="navmaps?jumpToFirstHomework"',
+ 'location.href="'.$link.'"',
"Show my first due problem");
}
@@ -275,33 +298,41 @@ MENU
$filterFunc = sub { my $res = shift;
return $res->completable() || $res->is_map();
};
+ my $link = 'navmaps?sort='.$env{'form.sort'};
+ if ($env{'form.register'}) {
+ $link .= '®ister='.$env{'form.register'};
+ }
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'everything',
- 'location.href="navmaps?sort='.$env{'form.sort'}.'"',
+ 'location.href="'.$link.'"',
"Show everything");
- $r->print("
".&mt("Uncompleted Problems")."
"); + $r->print("".&mt("Uncompleted Problems").""); $env{'form.filter'} = ''; $env{'form.condition'} = 1; $resource_no_folder_link = 1; } else { + my $link = 'navmaps?sort='.$env{'form.sort'}.'&showOnlyHomework=1'; + if ($env{'form.register'}) { + $link .= '®ister='.$env{'form.register'}; + } &Apache::lonnavmaps::add_linkitem(\%toplinkitems,'uncompleted', - 'location.href="navmaps?sort='.$env{'form.sort'}. - '&showOnlyHomework=1"', + 'location.href="'.$link.'"', "Show only uncompleted problems"); } - my %selected=($env{'form.sort'} => 'selected=on'); - my $sort_html=(""); + + + '); # renderer call my $renderArgs = { 'cols' => [0,1,2,3], 'sort' => $env{'form.sort'}, @@ -321,9 +352,9 @@ MENU # user knows there was no error. if ($renderArgs->{'counter'} == 0) { if ($showOnlyHomework) { - $r->print("".&mt("All homework is currently completed").".
"); + $r->print("".&mt("All homework is currently completed.")."
"); } else { # both jumpToFirstHomework and normal use the same: course must be empty - $r->print("This course is empty.
"); + $r->print("".&mt("This course is empty.")."
"); } } #my $td=&tv_interval($t0);