--- loncom/interface/lonmenu.pm 2010/12/25 00:32:05 1.315.2.5 +++ loncom/interface/lonmenu.pm 2011/03/05 16:34:50 1.315.2.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.315.2.5 2010/12/25 00:32:05 raeburn Exp $ +# $Id: lonmenu.pm,v 1.315.2.9 2011/03/05 16:34:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -205,10 +205,10 @@ sub prep_menuitem { } else { # textual Link $link = &mt($$menuitem[3]); } - if($$menuitem[4] eq 'newmsg'){ #special style for New Messages - return '
  • '.$link.'
  • '; - } - return '
  • '.$link.'
  • '; + return '
  • $link
  • |; } # primary_menu() evaluates @primary_menu and returns XHTML for the menu @@ -258,9 +258,7 @@ sub primary_menu { $menu .= '
  • '.&Apache::loncommon::top_nav_help('Help').'
  • '; } } else { - my @items = @{$menuitem}; - $items[0] = 'javascript:'.$menuitem->[0].';'; - $menu .= &prep_menuitem(\@items); + $menu .= &prep_menuitem($menuitem); } } @@ -455,12 +453,12 @@ sub innerregister { $newmail= 'swmenu.setstatus("you have","messages");'; } - my ($breadcrumb,$separator); + my ($breadcrumb,$separator,$resurl); if ($noremote && ($env{'request.symb'}) && ($env{'request.course.id'})) { - my ($mapurl,$rid,$resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread()); + (my $mapurl, my $rid,$resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread()); my $coursetitle = $env{'course.'.$env{'request.course.id'}.'.description'}; my $maptitle = &Apache::lonnet::gettitle($mapurl); @@ -474,8 +472,12 @@ sub innerregister { my @crumbs; unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps') && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) { + my $navhref = "javascript:gopost('/adm/navmaps','')"; + if ($env{'environment.remotenavmap'} eq 'on') { + $navhref = "javascript:gonav('/adm/navmaps');"; + } @crumbs = ({text => $contentstext, - href => "Javascript:gopost('/adm/navmaps','')"}); + href => $navhref}); } if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { push(@crumbs, {text => '...', @@ -668,6 +670,18 @@ sub innerregister { } } } + if ($env{'request.course.id'}) { + if ($resurl eq "public/$cdom/$cnum/syllabus") { + if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ /\w/) { + if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { + $editbutton=&switch('','',6,1,'pcstr.png','Edit', + 'resource[_2]', + "go('/adm/courseprefs?phase=display&actions=courseinfo')", + 'Edit this resource'); + } + } + } + } ### ### # Prepare the rest of the buttons @@ -1336,6 +1350,13 @@ sub rawconfig { my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc,$cat)=split(/\:/,$line); $prt=~s/\$uname/$uname/g; $prt=~s/\$udom/$udom/g; + if ($env{'environment.remotenavmap'} eq 'on') { + unless ($env{'environment.remote'} eq 'on') { + if ($img eq 'nav.gif') { + $act = "gonav('/adm/navmaps','')"; + } + } + } if ($prt =~ /\$crs/) { next unless ($env{'request.course.id'}); next if ($crstype eq 'Community'); @@ -1652,12 +1673,6 @@ function go(url) { } } -function gotop(url) { - if (url!='' && url!= null) { - top.location.href = url; - } -} - function need_switchserver(url) { if (url!='' && url!= null) { if (confirm("$confirm_switch")) {