--- loncom/interface/lonnavdisplay.pm 2009/03/09 13:27:56 1.7 +++ loncom/interface/lonnavdisplay.pm 2010/05/27 21:37:13 1.13.4.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavdisplay.pm,v 1.7 2009/03/09 13:27:56 schulted Exp $ +# $Id: lonnavdisplay.pm,v 1.13.4.1 2010/05/27 21:37:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -155,14 +155,27 @@ MENU # Header my $course_type = &Apache::loncommon::course_type(); - $r->print(&Apache::loncommon::start_page(#'Navigate '.$course_type. - 'Course 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'}}; + $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}; + $start_page = &Apache::loncommon::start_page($title,js,$args); + } + $r->print($start_page. + ''); $r->rflush(); # Check that it's defined @@ -261,8 +274,12 @@ MENU .""); } } else { + my $link = 'navmaps?jumpToFirstHomework'; + if ($env{'form.register'}) { + $link .= '&register='.$env{'form.register'}; + } &Apache::lonnavmaps::add_linkitem(\%toplinkitems,'firsthomework', - 'location.href="navmaps?jumpToFirstHomework"', + 'location.href="'.$link.'"', "Show my first due problem"); } @@ -278,33 +295,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 .= '&register='.$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").""); $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 .= '&register='.$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=("
- - - - - -
"); + my %selected=($env{'form.sort'} => ' selected="selected"'); + my $sort_html=('
+ + + '.&mt('Sort by:').' + + + +
'); # renderer call my $renderArgs = { 'cols' => [0,1,2,3], 'sort' => $env{'form.sort'},