[LON-CAPA-cvs] cvs: loncom /homework daxepage.pm /interface lonmenu.pm

raeburn raeburn at source.lon-capa.org
Thu Apr 18 23:48:23 EDT 2024


raeburn		Fri Apr 19 03:48:23 2024 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
    /loncom/homework	daxepage.pm 
  Log:
  - No breadcrumbs in LON-CAPA menus when using Daxe editor to edit file in  
    Authoring Space, so include "Exit Daxe" icon/link in Functions menu. 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.548 loncom/interface/lonmenu.pm:1.549
--- loncom/interface/lonmenu.pm:1.548	Thu Apr 18 17:53:15 2024
+++ loncom/interface/lonmenu.pm	Fri Apr 19 03:48:22 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.548 2024/04/18 17:53:15 raeburn Exp $
+# $Id: lonmenu.pm,v 1.549 2024/04/19 03:48:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -911,6 +911,7 @@
         $ltiscope,$ltiuri,$showncrumbsref) = @_;
     my $const_space = ($env{'request.state'} eq 'construct');
     my $is_const_dir = 0;
+    my $in_daxe = 0;
 
     if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; }
 
@@ -1309,6 +1310,23 @@
                 }
             }
 #
+# "Exit Daxe" in Functions menu when using Daxe
+#
+                if ((($env{'form.editmode'} eq 'daxe') &&
+                     ($thisdisfn=~/\.(xml|html|htm|xhtml|xhtm)$/)) ||
+                    (($env{'form.problemmode'} eq 'daxe') &&
+                     ($thisdisfn=~/$LONCAPA::assess_re/))) {
+                    my %editors = &Apache::loncommon::permitted_editors();
+                    if ($editors{'daxe'}) {
+                        my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn");
+                        $in_daxe = 1;
+                        $menuitems .= (<<ENDMENUITEMS);
+my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn");
+s&7&6&tolastloc.png&Exit Daxe&resource[_1]&go('$privfile')&Exit editing this resource
+ENDMENUITEMS
+                    }
+                }
+#
 # Editing options usually accessed via "Settings" in inline menu need to be
 # accessed in a different way, when Authoring Space is accessed in course
 # context
@@ -1528,8 +1546,13 @@
             &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'tools', at tools);
 
+            #exit editing link/icon when using daxe in construction space 
             #publish button in construction space
             if ($env{'request.state'} eq 'construct'){
+                if ($in_daxe) {
+                    &Apache::lonhtmlcommon::add_breadcrumb_tool(
+                         'advtools', $inlineremote[76]);
+                }
                 &Apache::lonhtmlcommon::add_breadcrumb_tool(
                      'advtools', $inlineremote[63]);
             } else {
@@ -1537,7 +1560,7 @@
                      'tools', $inlineremote[63]);
             }
             &advtools_crumbs(@inlineremote);
-            #options link/icon in constructions space viewed with course role 
+            #options link/icon in constructions space viewed with course role
             if (($env{'request.state'} eq 'construct') &&
                 ($env{'request.role'} !~/^(aa|ca|au)/)) {
                 &Apache::lonhtmlcommon::add_breadcrumb_tool(
Index: loncom/homework/daxepage.pm
diff -u loncom/homework/daxepage.pm:1.16 loncom/homework/daxepage.pm:1.17
--- loncom/homework/daxepage.pm:1.16	Wed Apr 17 14:15:45 2024
+++ loncom/homework/daxepage.pm	Fri Apr 19 03:48:23 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Page with Daxe on the left side and the preview on the right side
 #
-# $Id: daxepage.pm,v 1.16 2024/04/17 14:15:45 raeburn Exp $
+# $Id: daxepage.pm,v 1.17 2024/04/19 03:48:23 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -84,6 +84,9 @@
     if ($is_not_assess) {
         delete($editors{'xml'});
         $editors{'edit'} = 1;
+        $Apache::lonnet::env{'form.editmode'} = 'daxe';
+    } else {
+        $Apache::lonnet::env{'form.problemmode'} = 'daxe';
     }
     &Apache::lonhtmlcommon::clear_breadcrumbs();
     my %lt = &Apache::lonlocal::texthash(
@@ -139,7 +142,7 @@
         $editheader .= '  |  <span class="LC_nobreak">'.$other.':</span> '.
                        '<span class="LC_nobreak">';
         if ($is_not_assess) {
-            $editheader .= '<input type="hidden" name="editmode" value="" />'."\n".
+            $editheader .= '<input type="hidden" name="editmode" value="daxe" />'."\n".
                            '<input type="button" name="editordefault" value="'.$lt{'text'}.
                            '" onclick="javascript:seteditmode(this.form,'."'edit'".');" />'."\n";
         } else {




More information about the LON-CAPA-cvs mailing list