--- loncom/interface/lonmenu.pm 2010/05/24 12:20:16 1.244.2.17 +++ loncom/interface/lonmenu.pm 2009/06/08 18:04:45 1.270 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.244.2.17 2010/05/24 12:20:16 raeburn Exp $ +# $Id: lonmenu.pm,v 1.270 2009/06/08 18:04:45 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,15 +26,10 @@ # http://www.lon-capa.org/ # # -# There are two parameters controlling the action of this module: -# -# browser.interface - if this is 'textual', it overrides the second parameter -# and goes to screen reader PDA mode +# There is one parameter controlling the action of this module: # # environment.remote - if this is 'on', the routines controll the remote -# control, otherwise they render the main window controls; ignored it -# browser.interface is 'textual' -# +# control, otherwise they render the main window controls; =head1 NAME @@ -51,8 +46,6 @@ described at http://www.lon-capa.org. =over -=item show_course() - Little texts =item initlittle() @@ -120,6 +113,11 @@ The javascript is usually similar to "go =item get_nav_status() +=item convert_menu_function() + +FIXME this needs to move into mydesktab and the other locations +the text is generated + =item hidden_button_check() =item roles_selector() @@ -139,47 +137,26 @@ use Apache::loncommon(); use Apache::lonenc(); use Apache::lonlocal; use LONCAPA qw(:DEFAULT :match); -use HTML::Entities(); use vars qw(@desklines %category_names %category_members %category_positions $readdesk); my @inlineremote; - - -sub show_course { - my $course = !$env{'user.adv'}; - if (!$env{'user.adv'}) { - foreach my $env (keys(%env)) { - next if ($env !~ m/^user\.priv\./); - if ($env !~ m/^user\.priv\.(?:st|cm)/) { - $course = 0; - last; - } - } - } - return $course; -} - sub initlittle { - my %lt=&Apache::lonlocal::texthash('ret' => 'Return to Last Location', - 'nav' => 'Course Contents', + return &Apache::lonlocal::texthash('ret' => 'Return to Last Location', + 'nav' => 'Navigate Contents', 'main' => 'Main Menu', 'roles' => (&Apache::loncommon::show_course()? 'Courses':'Roles'), 'other' => 'Other Roles', - 'docs' => 'Course Editor', + 'docs' => 'Edit Course', 'exit' => 'Logout', 'login' => 'Log In', 'launch' => 'Launch Remote Control', 'groups' => 'Groups', + 'gdoc' => 'Group Documents', ); - if (&Apache::loncommon::course_type() eq 'Community') { - $lt{'nav'} = &mt('Community Contents'); - $lt{'docs'} = &mt('Community Editor'); - } - return %lt; } sub menubuttons { @@ -206,8 +183,8 @@ sub menubuttons { my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'})); my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); - $logo = '
$lt{'main'} | +$helplink | -$lt{'exit'} | -
- '. - &mt('You have new messages').' | '; - } else { - $newmail= 'swmenu.setstatus("you have","messages");'; - } + my $breadcrumb; + + if (&Apache::lonmsg::newmail() && !$noremote) { + # We have new mail and remote is up + $newmail= 'swmenu.setstatus("you have","messages");'; } - if (($textual) + if ($noremote && ($env{'request.symb'}) && ($env{'request.course.id'})) { - $newmail.= ''; - my ($mapurl,$rid,$resurl)= - &Apache::lonnet::decode_symb(&Apache::lonnet::symbread()); - my $coursetitle=$env{'course.'.$env{'request.course.id'}.'.description'}; - $newmail.=$coursetitle; - my $maptitle=&Apache::lonnet::gettitle($mapurl); - my $restitle=&Apache::lonnet::gettitle(&Apache::lonnet::symbread()); - if ($maptitle && ($maptitle ne 'default.sequence') && ($maptitle ne $coursetitle)) { - $newmail.=', '.$maptitle; - } - if ($restitle) { - $newmail.=': '.$restitle; - } - $newmail.=' | '; + + my ($mapurl,$rid,$resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread()); + my $coursetitle = $env{'course.'.$env{'request.course.id'}.'.description'}; + + my $maptitle = &Apache::lonnet::gettitle($mapurl); + my $restitle = &Apache::lonnet::gettitle(&Apache::lonnet::symbread()); + my @crumbs = ({text => "Course Content", + href => "Javascript:gonav('/adm/navmaps')"}, + {text => '...', + no_mt => 1}); + + push @crumbs, {text => $maptitle, no_mt => 1} if ($maptitle + && $maptitle ne 'default.sequence' + && $maptitle ne $coursetitle); + + push @crumbs, {text => $restitle, no_mt => 1} if $restitle; + + Apache::lonhtmlcommon::clear_breadcrumbs(); + Apache::lonhtmlcommon::add_breadcrumb(@crumbs); + $breadcrumb .= Apache::lonhtmlcommon::breadcrumbs(undef,undef,0); + # } if ($env{'request.state'} eq 'construct') { $newmail = $titletable; - } else { - if ($noremote) { - $newmail.='