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

raeburn raeburn at source.lon-capa.org
Wed May 1 10:42:54 EDT 2024


raeburn		Wed May  1 14:42:54 2024 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - Fix logic so "About WebDAV access" help item is shown when displaying top
    level Authoring Space directory when use of webDAV is enabled for it.
  - Note: $is_const_dir was added in 1.131, but code needing it was removed in
    rev. 1.148 while retaining assignment of a value; remove that now. 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.549 loncom/interface/lonmenu.pm:1.550
--- loncom/interface/lonmenu.pm:1.549	Fri Apr 19 03:48:22 2024
+++ loncom/interface/lonmenu.pm	Wed May  1 14:42:54 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.549 2024/04/19 03:48:22 raeburn Exp $
+# $Id: lonmenu.pm,v 1.550 2024/05/01 14:42:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -910,7 +910,6 @@
     my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname,
         $ltiscope,$ltiuri,$showncrumbsref) = @_;
     my $const_space = ($env{'request.state'} eq 'construct');
-    my $is_const_dir = 0;
     my $in_daxe = 0;
 
     if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; }
@@ -1236,8 +1235,8 @@
 # End course context
 
 # Prepare the rest of the buttons
-        my ($menuitems,$got_prt,$got_wishlist,$crsauthor);
-        if ($const_space) {
+    my ($menuitems,$got_prt,$got_wishlist,$crsauthor,$toplevel_cstr,$crsauthor_cstr);
+    if ($const_space) {
 #
 # We are in construction space
 #
@@ -1245,17 +1244,15 @@
             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;
+                $crsauthor_cstr = 1;
             }
             my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn;
             if ($currdir =~ m-/$-) {
-                $is_const_dir = 1;
-                if (($thisdisfn eq '') && ($crsauthor)) {
-                    $is_const_dir = 2;
+                if ($thisdisfn eq '') {
+                    $toplevel_cstr = 1;
                 }
                 my $esc_currdir = &Apache::loncommon::escape_single($currdir);
                 $menuitems=(<<ENDMENUITEMS);
@@ -1278,7 +1275,7 @@
 #
 # Probably should be in mydesk.tab
 #
-                if (($crsauthor) && ($pubfile eq "/res/$udom/$uname/default.rights")) {
+                if (($crsauthor_cstr) && ($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
@@ -1576,7 +1573,7 @@
         }
     }
     my ($topic_help,$topic_help_text);
-    if ($is_const_dir == 2) {
+    if ($toplevel_cstr && !$crsauthor_cstr) {
         if ((($ENV{'SERVER_PORT'} == 443) || 
              ($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) && 
             (&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) {




More information about the LON-CAPA-cvs mailing list