Fixing include_asciimathml_script setting see #7134

1.9.x
Julio Montoya 12 years ago
parent 938151bc81
commit 26ca82fa48
  1. 3
      main/inc/global.inc.php
  2. 2
      main/inc/lib/fckeditor/myconfig.php
  3. 14
      main/inc/lib/formvalidator/Element/html_editor.php

@ -617,3 +617,6 @@ if (empty($default_quota)) {
$default_quota = 100000000; $default_quota = 100000000;
} }
define('DEFAULT_DOCUMENT_QUOTA', $default_quota); define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
// Sets the ascii_math plugin see #7134
$_SESSION['ascii_math_loaded'] = false;

@ -204,7 +204,7 @@ if ((api_get_setting('enabled_asciisvg') == 'true')) {
if (api_get_setting('include_asciimathml_script') == 'true') { if (api_get_setting('include_asciimathml_script') == 'true') {
// The automatic content parsing should be disabled on this case, otherwise content would be damaged. // The automatic content parsing should be disabled on this case, otherwise content would be damaged.
// The editor does the necessary parsing within its separate iframe. // The editor does the necessary parsing within its separate iframe.
echo '<script type="text/javascript">var translateOnLoad = false ;</script>'; $config['LoadAsciiMath'] = '<script type="text/javascript">var translateOnLoad = false;</script>';
} }
// WIRIS: plugin for inserting mathematical formulas // WIRIS: plugin for inserting mathematical formulas

@ -106,10 +106,20 @@ class HTML_QuickForm_html_editor extends HTML_QuickForm_textarea {
if (!FCKeditor :: IsCompatible()) { if (!FCKeditor :: IsCompatible()) {
return parent::toHTML(); return parent::toHTML();
} }
$this->fck_editor->Value = $this->getValue(); $this->fck_editor->Value = $this->getValue();
$result = $this->fck_editor->CreateHtml(); $result = $this->fck_editor->CreateHtml();
if (isset($this->fck_editor->Config['LoadAsciiMath'])) {
if (isset($_SESSION['ascii_math_loaded']) &&
$_SESSION['ascii_math_loaded'] == false
) {
$result .= $this->fck_editor->Config['LoadAsciiMath'];
$_SESSION['ascii_math_loaded'] = true;
}
}
//Add a link to open the allowed html tags window //Add a link to open the allowed html tags window
//$result .= '<small><a href="#" onclick="MyWindow=window.open('."'".api_get_path(WEB_CODE_PATH)."help/allowed_html_tags.php?fullpage=". ($this->fullPage ? '1' : '0')."','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=500,height=600,left=200,top=20'".'); return false;">'.get_lang('AllowedHTMLTags').'</a></small>'; //$result .= '<small><a href="#" onclick="MyWindow=window.open('."'".api_get_path(WEB_CODE_PATH)."help/allowed_html_tags.php?fullpage=". ($this->fullPage ? '1' : '0')."','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=500,height=600,left=200,top=20'".'); return false;">'.get_lang('AllowedHTMLTags').'</a></small>';
return $result; return $result;
} }
} }

Loading…
Cancel
Save