[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonnavdisplay.pm

raeburn raeburn at source.lon-capa.org
Wed Aug 7 21:54:51 EDT 2013


raeburn		Thu Aug  8 01:54:51 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonnavdisplay.pm 
  Log:
  - For 2.11
    - Backport 1.23, 1.24
  
  
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.22.4.1 loncom/interface/lonnavdisplay.pm:1.22.4.2
--- loncom/interface/lonnavdisplay.pm:1.22.4.1	Sun May 13 12:04:23 2012
+++ loncom/interface/lonnavdisplay.pm	Thu Aug  8 01:54:51 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavdisplay.pm,v 1.22.4.1 2012/05/13 12:04:23 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.22.4.2 2013/08/08 01:54:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -293,7 +293,16 @@
 
     $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("\n".'</ul>'."\n");
     $r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">');




More information about the LON-CAPA-cvs mailing list