--- loncom/interface/lonmenu.pm 2011/01/07 22:21:02 1.315.2.8 +++ loncom/interface/lonmenu.pm 2011/05/27 19:33:45 1.315.2.11 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.315.2.8 2011/01/07 22:21:02 raeburn Exp $ +# $Id: lonmenu.pm,v 1.315.2.11 2011/05/27 19:33:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -453,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); @@ -670,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 @@ -712,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(); @@ -744,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 ''; } @@ -1236,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]= ''.$pic. - ''.$desc.''; + ''.$icon_text.' '; } } }