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

raeburn raeburn at source.lon-capa.org
Sun Jul 23 07:54:56 EDT 2023


raeburn		Sun Jul 23 11:54:56 2023 EDT

  Modified files:              
    /loncom/publisher	lonupload.pm 
  Log:
  - Breadcrumbs text when displaying/editing resource in Course Authoring Space.
  
  
Index: loncom/publisher/lonupload.pm
diff -u loncom/publisher/lonupload.pm:1.70 loncom/publisher/lonupload.pm:1.71
--- loncom/publisher/lonupload.pm:1.70	Wed Mar  6 03:39:54 2019
+++ loncom/publisher/lonupload.pm	Sun Jul 23 11:54:56 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to upload files into construction space
 #
-# $Id: lonupload.pm,v 1.70 2019/03/06 03:39:54 raeburn Exp $
+# $Id: lonupload.pm,v 1.71 2023/07/23 11:54:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -624,22 +624,35 @@
     $trailfile =~ s{^/(priv/)}{$londocroot/$1};
 
     # Breadcrumbs
-    my $brcrum = [{'href' => &Apache::loncommon::authorspace($fn),
-                   'text' => 'Authoring Space'},
+    my $text = 'Authoring Space';
+    my $href = &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 ($href eq "/priv/$cdom/$cnum/") {
+            $text = 'Course Authoring Space';
+            $crsauthor = 1;
+        }
+    }
+    my $brcrum = [{'href' => $href,
+                   'text' => $text},
                   {'href' => '/adm/upload',
-                   'text' => 'Upload file to Authoring Space'}];
-    $r->print(&Apache::loncommon::start_page('Upload file to Authoring Space',
+                   'text' => 'Upload file to '.$text}];
+    $r->print(&Apache::loncommon::start_page('Upload file to '.$text,
                                              $javascript,
                                              {'bread_crumbs' => $brcrum,})
              .&Apache::loncommon::head_subbox(
                 &Apache::loncommon::CSTR_pageheader($trailfile))
     );
-  
-    if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
-        $r->print('<p class="LC_info">'
-                 .&mt('Co-Author [_1]',$uname.':'.$udom)
-                 .'</p>'
-        );
+
+    unless ($crsauthor) {
+        if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
+            $r->print('<p class="LC_info">'
+                     .&mt('Co-Author [_1]',$uname.':'.$udom)
+                     .'</p>'
+            );
+        }
     }
     if ($warning) {
         $r->print($warning);




More information about the LON-CAPA-cvs mailing list