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

raeburn raeburn at source.lon-capa.org
Sun Jul 23 08:24:16 EDT 2023


raeburn		Sun Jul 23 12:24:16 2023 EDT

  Modified files:              
    /loncom/publisher	lonretrieve.pm 
  Log:
  - Breadcrumbs text when displaying/editing resource in Course Authoring Space.
  
  
Index: loncom/publisher/lonretrieve.pm
diff -u loncom/publisher/lonretrieve.pm:1.52 loncom/publisher/lonretrieve.pm:1.53
--- loncom/publisher/lonretrieve.pm:1.52	Fri Jun  7 16:07:49 2013
+++ loncom/publisher/lonretrieve.pm	Sun Jul 23 12:24:16 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to retrieve an old version of a file
 #
-# $Id: lonretrieve.pm,v 1.52 2013/06/07 16:07:49 bisitz Exp $
+# $Id: lonretrieve.pm,v 1.53 2023/07/23 12:24:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -302,6 +302,7 @@
 # ----------------------------------------------------------- Start page output
   my $uname;
   my $udom;
+  my $crsauthor;
 
   ($uname,$udom) = &Apache::lonnet::constructaccess($fn);
   unless (($uname ne '') && ($udom ne '')) {
@@ -316,10 +317,20 @@
   $r->send_http_header;
 
     # Breadcrumbs
+    my $text = 'Authoring Space';
+    my $href = &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 ($href eq "/priv/$cdom/$cnum/") {
+            $text = 'Course Authoring Space';
+            $crsauthor = 1;
+        }
+    }
     &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb({
-        'text'  => 'Authoring Space',
-        'href'  => &Apache::loncommon::authorspace($fn),
+        'text'  => $text, 
+        'href'  => $href,
     });
     &Apache::lonhtmlcommon::add_breadcrumb({
         'text'  => 'Retrieve previous version',
@@ -342,13 +353,15 @@
            .&mt('Retrieve previous versions of [_1]'
                    ,'<span class="LC_filename">'.$fn.'</span>')
            .'</p>');
-  
-  if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
+
+  unless ($crsauthor) {
+      if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
           $r->print('<p><span class="LC_info">'
                    .&mt('Co-Author [_1]'
                        ,&Apache::loncommon::plainname($uname,$udom)
                        .' ('.$uname.':'.$udom.')')
                    .'</span></p>');
+      }
   }
 
 




More information about the LON-CAPA-cvs mailing list