--- loncom/xml/lonxml.pm 2011/12/09 21:21:43 1.527
+++ loncom/xml/lonxml.pm 2013/10/29 21:01:21 1.544
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.527 2011/12/09 21:21:43 www Exp $
+# $Id: lonxml.pm,v 1.544 2013/10/29 21:01:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -113,6 +113,7 @@ use Apache::lonr();
use Apache::lonlocal;
use Apache::lonhtmlcommon();
use Apache::functionplotresponse();
+use Apache::lonnavmaps();
#==================================== Main subroutine: xmlparse
@@ -210,8 +211,12 @@ sub xmlend {
my $discussion;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['LONCAPA_INTERNAL_no_discussion']);
- if (! exists($env{'form.LONCAPA_INTERNAL_no_discussion'}) ||
- $env{'form.LONCAPA_INTERNAL_no_discussion'} ne 'true') {
+ if (
+ ( (!exists($env{'form.LONCAPA_INTERNAL_no_discussion'}))
+ || ($env{'form.LONCAPA_INTERNAL_no_discussion'} ne 'true')
+ )
+ && ($env{'form.inhibitmenu'} ne 'yes')
+ ) {
$discussion=&Apache::lonfeedback::list_discussion($mode,$status);
}
if ($target eq 'tex') {
@@ -644,9 +649,9 @@ sub setup_globals {
sub init_safespace {
my ($target,$safeeval,$safehole,$safeinit) = @_;
- $safeeval->reval('use Math::Complex;');
$safeeval->reval('use LaTeX::Table;');
$safeeval->deny_only(':dangerous');
+ $safeeval->reval('use LONCAPA::LCMathComplex;');
$safeeval->permit_only(":default");
$safeeval->permit("entereval");
$safeeval->permit(":base_math");
@@ -1505,12 +1510,12 @@ sub renderingoptions {
}
sub inserteditinfo {
- my ($filecontents, $filetype, $filename)=@_;
+ my ($filecontents,$filetype,$filename,$symb,$itemtitle,$folderpath,$uri,$action) = @_;
$filecontents = &HTML::Entities::encode($filecontents,'<>&"');
my $xml_help = '';
my $initialize='';
my $textarea_id = 'filecont';
- my $dragmath_button;
+ my ($dragmath_button,$deps_button);
my ($add_to_onload, $add_to_onresize);
$initialize=&Apache::lonhtmlcommon::spellheader();
if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) {
@@ -1530,7 +1535,33 @@ sub inserteditinfo {
// ]]>
FULLPAGE
+ my $textareaclass;
if ($filetype eq 'html') {
+ my $context;
+ if ($env{'request.course.id'}) {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) {
+ $context = 'syllabus';
+ $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
+ $initialize .=
+ &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'),
+ $uri,undef,
+ "/public/$cdom/$cnum/syllabus").
+ "\n";
+ if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+ $textareaclass = 'class="LC_richDefaultOn"';
+ }
+ }
+ }
+ unless ($context eq 'syllabus') {
+ if ($symb || $folderpath) {
+ $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
+ $initialize .=
+ &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,
+ undef,$folderpath,$uri)."\n";
+ }
+ }
$dragmath_button = ''.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'';
$initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
}
@@ -1542,7 +1573,6 @@ FULLPAGE
}
my $titledisplay=&display_title();
- my $textareaclass;
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
'vi' => 'Save and View',
'dv' => 'Discard Edits and View',
@@ -1558,13 +1588,15 @@ FULLPAGE
$htmlerror=''.$htmlerror.'';
}
if (&Apache::lonhtmlcommon::htmlareabrowser()) {
- $textareaclass = 'class="LC_richDefaultOff"';
+ unless ($textareaclass) {
+ $textareaclass = 'class="LC_richDefaultOff"';
+ }
}
}
my $editfooter=(<