--- loncom/interface/lonmenu.pm 2009/11/10 13:58:55 1.301 +++ loncom/interface/lonmenu.pm 2009/11/18 04:59:56 1.302 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.301 2009/11/10 13:58:55 droeschl Exp $ +# $Id: lonmenu.pm,v 1.302 2009/11/18 04:59:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -689,10 +689,22 @@ sub innerregister { } # Finally, turn the button on or off if ($cfile && !$const_space) { - $editbutton=&switch - ('','',6,1,'pcstr.gif','edit[_1]','resource[_2]', + my $nocrsedit; + # Suppress display where CC has switched to student role. + if ($env{'request.course.id'}) { + unless(&Apache::lonnet::allowed('mdc', + $env{'request.course.id'})) { + $nocrsedit = 1; + } + } + if ($nocrsedit) { + $editbutton=&clear(6,1); + } else { + $editbutton=&switch + ('','',6,1,'pcstr.gif','edit[_1]','resource[_2]', "go('".$cfile."');","Edit this resource"); - $noeditbutton = 0; + $noeditbutton = 0; + } } elsif ($editbutton eq '') { $editbutton=&clear(6,1); }