[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

raeburn raeburn at source.lon-capa.org
Wed Apr 17 09:37:37 EDT 2024


raeburn		Wed Apr 17 13:37:37 2024 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - Save some screen real estate by eliminating breadcrumbs trail when
    editing HTML file created or uploaded to a course in Course Editor, for
    both text and Daxe  editors for both Main and Supplemental Content areas. 
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.570 loncom/xml/lonxml.pm:1.571
--- loncom/xml/lonxml.pm:1.570	Sun Apr 14 17:12:28 2024
+++ loncom/xml/lonxml.pm	Wed Apr 17 13:37:37 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.570 2024/04/14 17:12:28 raeburn Exp $
+# $Id: lonxml.pm,v 1.571 2024/04/17 13:37:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1748,10 +1748,12 @@
         window.location = newloc;
     } else {
         if (coursedoc) {
-            form.action += '?forceedit=1';
-            if (!supplemental) {
-                form.action += '&register=1';
+            var curraction = form.action;
+            var idx = curraction.indexOf('?');
+            if (idx !== -1) {
+                form.action = curraction.substring(0,idx);
             }
+            form.action += '?forceedit=1&register=1';
             if (querystr) {
                 form.action += '&'+querystr;
             }
@@ -2004,9 +2006,11 @@
 	    $displayfile=$request->uri;
             if ($request->uri =~ m{^/uploaded/}) {
                 if ($env{'request.course.id'}) {
-                    if ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/supplemental/\E}) {
-                        &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-                                                                ['folderpath','title']);
+                    if ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/\E(docs|supplemental)/}) {
+                        if ($1 eq 'supplemental') { 
+                            &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+                                                                    ['folderpath','title']);
+                        }
                         if (($env{'request.state'} eq 'edit') && ($env{'form.editmode'} eq 'edit') &&
                             ($filetype eq 'html')) {
                             &Apache::lonhtmlcommon::clear_breadcrumbs();




More information about the LON-CAPA-cvs mailing list