[LON-CAPA-cvs] cvs: loncom /homework daxepage.pm
raeburn
raeburn at source.lon-capa.org
Sun Mar 3 13:16:27 EST 2024
raeburn Sun Mar 3 18:16:27 2024 EDT
Modified files:
/loncom/homework daxepage.pm
Log:
- Add "Exit Daxe" button to return to viewing resource in Authoring Space.
Index: loncom/homework/daxepage.pm
diff -u loncom/homework/daxepage.pm:1.10 loncom/homework/daxepage.pm:1.11
--- loncom/homework/daxepage.pm:1.10 Sun Mar 3 00:08:37 2024
+++ loncom/homework/daxepage.pm Sun Mar 3 18:16:27 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.10 2024/03/03 00:08:37 raeburn Exp $
+# $Id: daxepage.pm,v 1.11 2024/03/03 18:16:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -75,6 +75,7 @@
'oeds' => 'other editors',
'othe' => 'other editor',
'edit' => 'Edit',
+ 'exit' => 'Exit Daxe',
);
my $name = $uri;
$name =~ s/^.*\/([^\/]+)$/$1/;
@@ -83,15 +84,20 @@
my $headjs = &Apache::loncommon::iframe_wrapper_headjs().
&toggle_LCmenus_js().
&Apache::edit::js_change_detection();
+ my $clickexit;
if ($is_assess) {
$headjs .= &Apache::lonxml::setmode_javascript();
+ $clickexit = "javascript:setmode(this.form,'view')";
} else {
$headjs .= &Apache::lonxml::seteditor_javascript();
+ $clickexit = "javascript:seteditmode(this.form,'view')";
}
my $form_events = &Apache::edit::form_change_detection();
my $editheader = '<form '.$form_events.' method="post" name="daxeedit" action="'.$uri.'">'.
'<input type="hidden" name="problemmode" value="daxe" />'."\n".
'<div class="LC_edit_problem_editxml_header">'."\n";
+ my $exitbutton = '<input type="button" name="submitmode" accesskey="t" value="'.$lt{'exit'}.
+ '" onclick="'.$clickexit.'" />'."\n";
if ($editors{'edit'} || $editors{'xml'}) {
my $other = (($editors{'edit'} && $editors{'xml'})? $lt{'oeds'} : $lt{'othe'});
$editheader .= '<table class="LC_edit_problem_header_title"><tr><td>'.
@@ -111,11 +117,12 @@
'onclick="javascript:setmode(this.form,'."'editxml'".')" />'."\n";
}
}
- $editheader .= '</span></td></tr></table>';
+ $editheader .= ' | '.$exitbutton.'</span></td></tr></table>';
} else {
$editheader .= '<table class="LC_edit_problem_header_title"><tr><td>'.
$uri.
- '</td></tr></table>';
+ '</td><td align="right"><span class="LC_nobreak">'.
+ $exitbutton.'</span></td></tr></table>';
}
$editheader .= '</div></form>'."\n";
my $start_collapsed = &collapsible_std_LCmenus();
More information about the LON-CAPA-cvs
mailing list