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

raeburn raeburn at source.lon-capa.org
Fri Jul 14 19:15:10 EDT 2023


raeburn		Fri Jul 14 23:15:10 2023 EDT

  Modified files:              
    /loncom/interface	lonmeta.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/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.255 loncom/interface/lonmeta.pm:1.256
--- loncom/interface/lonmeta.pm:1.255	Tue Mar 28 23:17:18 2023
+++ loncom/interface/lonmeta.pm	Fri Jul 14 23:15:10 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.255 2023/03/28 23:17:18 raeburn Exp $
+# $Id: lonmeta.pm,v 1.256 2023/07/14 23:15:10 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -790,9 +790,18 @@
     &Apache::lonhtmlcommon::clear_breadcrumbs();
 
     if ($env{'request.state'} eq 'construct') {
+        my $text = 'Authoring Space';
+        my $href = &Apache::loncommon::authorspace($uri);
+        if ($env{'request.course.id'}) {
+            my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+            my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+            if ($href eq "/priv/$cdom/$cnum/") {
+                $text = 'Course Authoring Space';
+            }
+        }
         &Apache::lonhtmlcommon::add_breadcrumb({
-            'text'  => 'Authoring Space',
-            'href'  => &Apache::loncommon::authorspace($uri),
+            'text'  => $text,
+            'href'  => $href,
         });
     }
 
@@ -1633,6 +1642,17 @@
         $Apache::lonpublisher::metadatafields{'keywords'} =
             join (',', &Apache::loncommon::get_env_multiple('form.new_keywords'));
             }
+    if (($caller eq 'store') && ($env{'request.course.id'})) {
+        my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+        my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+        if ($uri =~ m{^\Q/priv/$cdom/$cnum/\E}) {
+            unless ($uri eq "/priv/$cdom/$cnum/default.rights.meta") {
+                $Apache::lonpublisher::metadatafields{'copyright'} = 'custom';
+                $Apache::lonpublisher::metadatafields{'customdistributionfile'} =
+                    "/res/$cdom/$cnum/default.rights";
+            }
+        }
+    }
     foreach my $field (sort(keys(%Apache::lonpublisher::metadatafields))) {
         next if ($field =~ /\./);
         my $unikey=$field;




More information about the LON-CAPA-cvs mailing list