--- loncom/interface/lonnavdisplay.pm 2012/01/02 23:10:58 1.22 +++ loncom/interface/lonnavdisplay.pm 2013/08/07 00:03:25 1.23 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavdisplay.pm,v 1.22 2012/01/02 23:10:58 www Exp $ +# $Id: lonnavdisplay.pm,v 1.23 2013/08/07 00:03:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -293,7 +293,16 @@ sub startContentScreen { $r->print("\n".'<ul class="LC_TabContentBigger" id="mainnav">'."\n"); $r->print('<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b> '.&mt('Main Content').' </b></a></li>'."\n"); - $r->print('<li '.(($mode eq 'supplemental')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'); + my $allowed = &Apache::lonnet::allowed('mdc',$env{'request.course.id'}); + my ($suppcount,$errors); + unless ($allowed) { + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + ($suppcount,$errors) = &Apache::lonnet::get_numsuppfiles($cnum,$cdom); + } + if ($allowed || $suppcount) { + $r->print('<li '.(($mode eq 'supplemental')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'); + } $r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"); $r->print('<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b> '.&mt('Content Index').' </b></a></li>'."\n"); $r->print("\n".'</ul>'."\n");