--- loncom/xml/lonxml.pm 2012/05/10 19:08:33 1.531.2.1
+++ loncom/xml/lonxml.pm 2013/07/15 16:13:36 1.542
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.531.2.1 2012/05/10 19:08:33 raeburn Exp $
+# $Id: lonxml.pm,v 1.542 2013/07/15 16:13:36 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -649,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 Math::Complex;');
$safeeval->permit_only(":default");
$safeeval->permit("entereval");
$safeeval->permit(":base_math");
@@ -1502,6 +1502,7 @@ sub renderingoptions {
{&Apache::lonlocal::texthash
('' => '',
'tth' => 'tth (TeX to HTML)',
+ 'MathJax' => 'MathJax',
'jsMath' => 'jsMath',
'mimetex' => 'mimetex (Convert to Images)')}).
'';
@@ -1509,7 +1510,7 @@ sub renderingoptions {
}
sub inserteditinfo {
- my ($filecontents,$filetype,$filename,$symb,$itemtitle) = @_;
+ my ($filecontents,$filetype,$filename,$symb,$itemtitle,$folderpath,$uri) = @_;
$filecontents = &HTML::Entities::encode($filecontents,'<>&"');
my $xml_help = '';
my $initialize='';
@@ -1534,11 +1535,32 @@ sub inserteditinfo {
// ]]>
FULLPAGE
+ my $textareaclass;
if ($filetype eq 'html') {
- if ($symb) {
- $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
- $initialize .=
- &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle)."\n";
+ 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');
@@ -1551,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',
@@ -1567,13 +1588,15 @@ FULLPAGE
$htmlerror=''.$htmlerror.'';
}
if (&Apache::lonhtmlcommon::htmlareabrowser()) {
- $textareaclass = 'class="LC_richDefaultOff"';
+ unless ($textareaclass) {
+ $textareaclass = 'class="LC_richDefaultOff"';
+ }
}
}
my $editfooter=(<