--- loncom/interface/lonmenu.pm 2010/08/26 04:11:34 1.315.2.3
+++ loncom/interface/lonmenu.pm 2011/06/16 22:55:17 1.315.2.12
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.315.2.3 2010/08/26 04:11:34 raeburn Exp $
+# $Id: lonmenu.pm,v 1.315.2.12 2011/06/16 22:55:17 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
@@ -699,6 +724,18 @@ ENDMENUITEMS
# We are in a course and looking at a registred URL
# Should probably be in mydesk.tab
#
+
+ my %icon_text;
+ if ($noremote) {
+ %icon_text = &Apache::lonlocal::texthash (
+ annotate => 'Notes',
+ bookmark => 'Bookmark',
+ catalog => 'Info',
+ evaluate => 'Evaluate',
+ feedback => 'Communicate',
+ printout => 'Print',
+ );
+ }
$menuitems=(< 0){
$menuitems.="anot.gif";
}
$menuitems.="&anno-[_1]&tations[_1]&annotate()&";
-$menuitems.="Make notes and annotations about this resource&&1\n";
+$menuitems.="Make notes and annotations about this resource&&1&$icon_text{'annotate'}\n";
unless ($noremote) {
my $showreqcrs = &check_for_rcrs();
@@ -731,19 +768,24 @@ $menuitems.="Make notes and annotations
}
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {
+ my $tail;
+ unless ($env{'request.state'} eq 'construct') {
+ $tail = '&&&'.$icon_text{'catalog'};
+ }
$menuitems.=(<13)) { return ''; }
@@ -1223,9 +1267,13 @@ sub switch {
if ($env{'environment.icons'} eq 'iconsonly') {
$inlineremote[$idx]=''.$pic.'';
} else {
+ my $icon_text = $desc;
+ if ($inlinetools) {
+ $icon_text = $inlinetools.' ';
+ }
$inlineremote[$idx]=
'';
+ '';
}
}
}
@@ -1325,6 +1373,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 +1696,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")) {
@@ -2038,7 +2087,7 @@ function adhocRole(roleitem) {
secok = 0;
var numrolesec = rolesections[selidx].length;
var msgidx = numsec[selidx] - numrolesec;
- secchoice = prompt("$lt{'this'}\\n"+secpick[msgidx]+"\\n$lt{'avai'} "+roleseclist[selidx],"");
+ secchoice = prompt("$lt{'this'} "+secpick[msgidx]+"\\n$lt{'avai'} "+roleseclist[selidx],"");
if (secchoice == '') {
if (msgidx > 0) {
secok = 1;