[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm

raeburn raeburn at source.lon-capa.org
Sun Jul 23 12:11:52 EDT 2023


raeburn		Sun Jul 23 16:11:52 2023 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - Breadcrumbs text when displaying/editing resource in Course Authoring Space.
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.377 loncom/homework/lonhomework.pm:1.378
--- loncom/homework/lonhomework.pm:1.377	Sun Jun  4 05:27:28 2023
+++ loncom/homework/lonhomework.pm	Sun Jul 23 16:11:52 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.377 2023/06/04 05:27:28 raeburn Exp $
+# $Id: lonhomework.pm,v 1.378 2023/07/23 16:11:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -942,8 +942,17 @@
     my $js = &Apache::structuretags::setmode_javascript();
 
     # Breadcrumbs
-    my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
-                   'text' => 'Authoring Space'},
+    my $text = 'Authoring Space';
+    my $href = &Apache::loncommon::authorspace($request->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';
+        }
+    }
+    my $brcrum = [{'href' => $href,
+                   'text' => $text},
                   {'href' => '',
                    'text' => 'Problem Testing'},
                   {'href' => '',
@@ -1175,8 +1184,17 @@
             &Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
 
     # Breadcrumbs
-    my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
-                   'text' => 'Authoring Space'},
+    my $text = 'Authoring Space';
+    my $href = &Apache::loncommon::authorspace($request->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';
+        }
+    }
+    my $brcrum = [{'href' => $href,
+                   'text' => $text},
                   {'href' => '',
                    'text' => 'Problem Editing'}];
 
@@ -1524,8 +1542,17 @@
 	my $url=&HTML::Entities::encode($request->uri,'<>&"');
 	my $dest = &Apache::lonnet::filelocation("",$request->uri);
 	my $instructions;
-        my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
-                       'text' => 'Authoring Space'},
+        my $text = 'Authoring Space';
+        my $href = &Apache::loncommon::authorspace($request->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';
+            }
+        }
+        my $brcrum = [{'href' => $href,
+                       'text' => $text},
                       {'href' => '',
                        'text' => "Create New $extension"}];
 	my $start_page = 




More information about the LON-CAPA-cvs mailing list