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

raeburn raeburn at source.lon-capa.org
Thu Jul 13 20:54:13 EDT 2023


raeburn		Fri Jul 14 00:54:13 2023 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - "Copy" absent from Functions menu for required default.rights file present
    at top level of Course Authoring Space. 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.533 loncom/interface/lonmenu.pm:1.534
--- loncom/interface/lonmenu.pm:1.533	Thu Jul  6 16:55:43 2023
+++ loncom/interface/lonmenu.pm	Fri Jul 14 00:54:13 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.533 2023/07/06 16:55:43 raeburn Exp $
+# $Id: lonmenu.pm,v 1.534 2023/07/14 00:54:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1139,15 +1139,17 @@
             my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
 	    my ($udom,$uname,$thisdisfn) =
 		($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$});
+            my $crsauthor;
+            if (($env{'request.course.id'}) &&
+                ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) &&
+                ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) {
+                $crsauthor = 1;
+            }
             my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn;
             if ($currdir =~ m-/$-) {
                 $is_const_dir = 1;
-                if ($thisdisfn eq '') {
-                    unless (($env{'request.course.id'}) && 
-                            ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) &&
-                            ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { 
-                        $is_const_dir = 2;
-                    }
+                if (($thisdisfn eq '') && ($crsauthor)) {
+                    $is_const_dir = 2;
                 }
                 my $esc_currdir = &Apache::loncommon::escape_single($currdir);
                 $menuitems=(<<ENDMENUITEMS);
@@ -1170,12 +1172,19 @@
 #
 # Probably should be in mydesk.tab
 #
-                $menuitems=(<<ENDMENUITEMS);
+                if (($crsauthor) && ($pubfile eq "/res/$udom/$uname/default.rights")) {
+                    $menuitems=(<<ENDMENUITEMS);
+s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory
+s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource
+ENDMENUITEMS
+                } else {
+                    $menuitems=(<<ENDMENUITEMS);
 s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory
 s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version
 s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource
 s&7&3&copy.png&Copy&resource[_4]&gocstr('/adm/cfile?action=copy','/priv/$udom/$uname/$cleandisfn')&Copy this resource
 ENDMENUITEMS
+                }
 #
 # Rename and Delete only available if obsolete or unpublished
 #




More information about the LON-CAPA-cvs mailing list