[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm

raeburn raeburn@source.lon-capa.org
Sat, 05 Mar 2011 14:45:25 -0000


raeburn		Sat Mar  5 14:45:25 2011 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - Bug 6434.  Edit link to courseprefs for CCs if externalsyllabus in use.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.347 loncom/interface/lonmenu.pm:1.348
--- loncom/interface/lonmenu.pm:1.347	Tue Feb 15 14:54:51 2011
+++ loncom/interface/lonmenu.pm	Sat Mar  5 14:45:24 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.347 2011/02/15 14:54:51 wenzelju Exp $
+# $Id: lonmenu.pm,v 1.348 2011/03/05 14:45:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -359,9 +359,10 @@
 
     undef(@inlineremote);
 
+    my $resurl; 
     if ( $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);
@@ -555,6 +556,18 @@
                 }
             }
         }
+        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