--- loncom/interface/lonnavdisplay.pm 2009/09/08 20:56:47 1.13 +++ 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.13 2009/09/08 20:56:47 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 # @@ -139,7 +139,7 @@ MENU $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=''; @@ -155,7 +155,7 @@ MENU # Header my $course_type = &Apache::loncommon::course_type(); - my ($title,$breadcrumb_text); + my ($title,$breadcrumb_text,$start_page,$args); if ($course_type eq 'Community') { $title = 'Community Contents'; $breadcrumb_text = &mt('Community Contents'); @@ -163,12 +163,21 @@ MENU $title = 'Course Contents'; $breadcrumb_text = &mt('Course Contents'); } - $r->print(&Apache::loncommon::start_page($title, - $js, - {'only_body' => $body_only, - 'force_register' => $env{'form.register'}, - 'bread_crumbs' => [{text => $breadcrumb_text }],})); - $r->print(''); + 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(); @@ -268,8 +277,12 @@ MENU .""); } } 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"); } @@ -285,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").""); $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="selected"'); - my $sort_html=("
'); # renderer call my $renderArgs = { 'cols' => [0,1,2,3], 'sort' => $env{'form.sort'},