[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

raeburn raeburn at source.lon-capa.org
Fri Jul 14 18:19:22 EDT 2023


raeburn		Fri Jul 14 22:19:22 2023 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - When publishing directory in course authoring space custom rights from 
    default.rights always apply.
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.302 loncom/publisher/lonpublisher.pm:1.303
--- loncom/publisher/lonpublisher.pm:1.302	Fri Jul 14 20:16:04 2023
+++ loncom/publisher/lonpublisher.pm	Fri Jul 14 22:19:22 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.302 2023/07/14 20:16:04 raeburn Exp $
+# $Id: lonpublisher.pm,v 1.303 2023/07/14 22:19:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2288,7 +2288,7 @@
 #########################################
 
 sub publishdirectory {
-    my ($r,$fn,$thisdisfn,$nokeyref)=@_;
+    my ($r,$fn,$thisdisfn,$nokeyref,$crsauthor)=@_;
     $fn=~s/\/+/\//g;
     $thisdisfn=~s/\/+/\//g;
     my $thisdisresdir=$thisdisfn;
@@ -2329,10 +2329,12 @@
                   &checkbox('excludemodmeta','exclude files with modified metadata').
                   '</fieldset>'.
                   '<fieldset><legend>'.&mt('Actions').'</legend>'.
-                  &checkbox('obsolete','make file(s) obsolete').'<br />'.
-                  &common_access('dist',&mt('apply common copyright/distribution'),
-                                 ['default','domain','public','custom']).'<br />'.
-                  &common_access('source',&mt('apply common source availability'),
+                  &checkbox('obsolete','make file(s) obsolete').'<br />');
+        unless ($crsauthor) {
+            $r->print(&common_access('dist',&mt('apply common copyright/distribution'),
+                                     ['default','domain','public','custom']).'<br />');
+        }
+        $r->print(&common_access('source',&mt('apply common source availability'),
                                  ['closed','open']).
                   '</fieldset>'
         );
@@ -2361,7 +2363,7 @@
 	    if ($filename=~/\.(\w+)$/) { $extension=$1; }
 	    if ($cmode&$dirptr) {
 		if (($filename!~/^\./) && ($env{'form.pubrec'})) {
-		    &publishdirectory($r,$fn.'/'.$filename,$thisdisfn.'/'.$filename,$nokeyref);
+		    &publishdirectory($r,$fn.'/'.$filename,$thisdisfn.'/'.$filename,$nokeyref,$crsauthor);
 		}
 	    } elsif ((&Apache::loncommon::fileembstyle($extension) ne 'hdn') &&
 		     ($filename!~/^[\#\.]/) && ($filename!~/\~$/)) {
@@ -2609,11 +2611,13 @@
     &Apache::lonhtmlcommon::clear_breadcrumbs();
     my $crumbtext = 'Authoring Space';
     my $crumbhref = &Apache::loncommon::authorspace($fn);
+    my $crsauthor;
     if ($env{'request.course.id'}) {
         my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
         my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
         if ($crumbhref eq "/priv/$cdom/$cnum/") {
             $crumbtext = 'Course Authoring Space';
+            $crsauthor = 1;
         }
     }
     &Apache::lonhtmlcommon::add_breadcrumb({
@@ -2688,7 +2692,7 @@
 
     if ($fn=~/\/$/) {
 # -------------------------------------------------------- This is a directory
-	&publishdirectory($r,$docroot.$fn,$thisdisfn,$nokeyref);
+	&publishdirectory($r,$docroot.$fn,$thisdisfn,$nokeyref,$crsauthor);
         $r->print(
             '<br /><br />'.
             &Apache::lonhtmlcommon::actionbox([




More information about the LON-CAPA-cvs mailing list