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

raeburn raeburn at source.lon-capa.org
Fri Jul 14 16:16:04 EDT 2023


raeburn		Fri Jul 14 20:16:04 2023 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - Breadcrumbs text when creating new file in Course Authoring Space.
  - All resources published in Course Authoring Space receive custom
    copyright/distribution, as defined in default.rights file.
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.301 loncom/publisher/lonpublisher.pm:1.302
--- loncom/publisher/lonpublisher.pm:1.301	Tue Mar 28 23:17:16 2023
+++ loncom/publisher/lonpublisher.pm	Fri Jul 14 20:16:04 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.301 2023/03/28 23:17:16 raeburn Exp $
+# $Id: lonpublisher.pm,v 1.302 2023/07/14 20:16:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1825,7 +1825,21 @@
 	                                 $env{'user.domain'};
     $metadatafields{'authorspace'}=$cuname.':'.$cudom;
     $metadatafields{'domain'}=$cudom;
-    
+
+    my $crsauthor;
+    if ($env{'request.course.id'}) {
+        my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+        my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+        if ($distarget =~ m{^/res/$cdom/$cnum}) {
+            $crsauthor = 1;
+            my $default_rights = "/res/$cdom/$cnum/default.rights";
+            unless ($distarget eq $default_rights) {
+                $metadatafields{'copyright'} = 'custom';
+                $metadatafields{'customdistributionfile'} = $default_rights;
+            }
+        }
+    }
+
     my $allkeywords=$env{'form.addkey'};
     if (exists($env{'form.keywords'})) {
         if (ref($env{'form.keywords'})) {
@@ -1907,14 +1921,6 @@
     $metadatafields{'url'} = $distarget;
     $metadatafields{'version'} = 'current';
 
-    my $crsauthor;
-    if ($env{'request.course.id'}) {
-        my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
-        my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
-        if ($distarget =~ m{^/res/$cdom/$cnum}) {
-            $crsauthor = 1;
-        }
-    }
     unless ($crsauthor) {
         my ($error,$success) = &store_metadata(%metadatafields);
         if ($success) {
@@ -2598,12 +2604,21 @@
 
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
-    
+
     # Breadcrumbs
     &Apache::lonhtmlcommon::clear_breadcrumbs();
+    my $crumbtext = 'Authoring Space';
+    my $crumbhref = &Apache::loncommon::authorspace($fn);
+    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';
+        }
+    }
     &Apache::lonhtmlcommon::add_breadcrumb({
-        'text'  => 'Authoring Space',
-        'href'  => &Apache::loncommon::authorspace($fn),
+        'text'  => $crumbtext,
+        'href'  => $crumbhref,
     });
     &Apache::lonhtmlcommon::add_breadcrumb({
         'text'  => 'Resource Publication',




More information about the LON-CAPA-cvs mailing list