--- loncom/interface/lonmenu.pm 2010/09/14 03:16:04 1.315.2.4
+++ 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.4 2010/09/14 03:16:04 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
@@ -245,11 +245,20 @@ sub primary_menu {
if ($$menuitem[3] eq 'Help') { # special treatment for helplink
- $menu .= ''.&Apache::loncommon::top_nav_help('Help').'';
+ if ($public) {
+ my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
+ my $defdom = &Apache::lonnet::default_login_domain();
+ my $to = &Apache::loncommon::build_recipient_list(undef,
+ 'helpdeskmail',
+ $defdom,$origmail);
+ if ($to ne '') {
+ $menu .= &prep_menuitem($menuitem);
+ }
+ } else {
+ $menu .= ''.&Apache::loncommon::top_nav_help('Help').'';
+ }
} else {
- my @items = @{$menuitem};
- $items[0] = 'javascript:'.$menuitem->[0].';';
- $menu .= &prep_menuitem(\@items);
+ $menu .= &prep_menuitem($menuitem);
}
}
@@ -444,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);
@@ -463,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 => '...',
@@ -657,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
@@ -1325,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');
@@ -1641,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")) {