--- loncom/interface/lonmenu.pm 2010/12/30 21:36:50 1.315.2.6
+++ loncom/interface/lonmenu.pm 2011/05/15 23:55:51 1.315.2.10
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.315.2.6 2010/12/30 21:36:50 raeburn Exp $
+# $Id: lonmenu.pm,v 1.315.2.10 2011/05/15 23:55:51 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);
@@ -672,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
@@ -714,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 = (
+ 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();
@@ -746,19 +768,23 @@ $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 ''; }
@@ -1238,9 +1266,13 @@ sub switch {
if ($env{'environment.icons'} eq 'iconsonly') {
$inlineremote[$idx]=''.$pic.'';
} else {
+ my $icon_text = $desc;
+ if ($inlinetools) {
+ $icon_text = $inlinetools.' ';
+ }
$inlineremote[$idx]=
'';
+ '';
}
}
}
@@ -1663,12 +1695,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")) {