--- loncom/interface/lonmenu.pm 2009/10/28 09:01:59 1.296 +++ loncom/interface/lonmenu.pm 2009/11/03 20:04:05 1.299 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.296 2009/10/28 09:01:59 droeschl Exp $ +# $Id: lonmenu.pm,v 1.299 2009/11/03 20:04:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -235,7 +235,7 @@ sub secondary_menu { if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) { # special treatment for role selector - my $roles_selector = roles_selector( + my $roles_selector = &roles_selector( $env{'course.' . $env{'request.course.id'} . '.domain'}, $env{'course.' . $env{'request.course.id'} . '.num'} ); @@ -545,7 +545,13 @@ sub innerregister { my $maptitle = &Apache::lonnet::gettitle($mapurl); my $restitle = &Apache::lonnet::gettitle(&Apache::lonnet::symbread()); - my @crumbs = ({text => "Course Contents", + my $contentstext; + if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Community') { + $contentstext = &mt('Community Contents'); + } else { + $contentstext = &mt('Course Contents'); + } + my @crumbs = ({text => $contentstext, href => "Javascript:gonav('/adm/navmaps')"}); if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { @@ -1604,6 +1610,12 @@ function go(url) { } } +function gotop(url) { + if (url!='' && url!= null) { + top.location.href = url; + } +} + function gopost(url,postdata) { if (url!='') { this.document.server.action=url; @@ -1788,16 +1800,19 @@ sub hidden_button_check { sub roles_selector { my ($cdom,$cnum) = @_; - my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; - if ($crstype eq '') { - $crstype = 'Course'; - } + my $crstype = &Apache::loncommon::course_type(); my $now = time; my (%courseroles,%seccount); my $is_cc; my $role_selector; - if ($env{'user.role.cc./'.$cdom.'/'.$cnum}) { - my ($start,$end) = split(/\./,$env{'user.role.cc./'.$cdom.'/'.$cnum}); + my $ccrole; + if ($crstype eq 'Community') { + $ccrole = 'co'; + } else { + $ccrole = 'cc'; + } + if ($env{'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum}) { + my ($start,$end) = split(/\./,$env{'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum}); if ((($start) && ($start<0)) || (($end) && ($end<$now)) || @@ -1847,7 +1862,7 @@ sub roles_selector { } else { $switchtext = &mt('Switch course role to...') } - my @roles_order = ('cc','in','ta','ep','ad','st'); + my @roles_order = ($ccrole,'in','ta','ep','ad','st'); if (keys(%courseroles) > 1) { $role_selector = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles); $role_selector .= '