Skip to content

Commit 26ca82f

Browse files
committed
Fixing include_asciimathml_script setting see #7134
1 parent 938151b commit 26ca82f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

main/inc/global.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,3 +617,6 @@
617617
$default_quota = 100000000;
618618
}
619619
define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
620+
621+
// Sets the ascii_math plugin see #7134
622+
$_SESSION['ascii_math_loaded'] = false;

main/inc/lib/fckeditor/myconfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
if (api_get_setting('include_asciimathml_script') == 'true') {
205205
// The automatic content parsing should be disabled on this case, otherwise content would be damaged.
206206
// The editor does the necessary parsing within its separate iframe.
207-
echo '<script type="text/javascript">var translateOnLoad = false ;</script>';
207+
$config['LoadAsciiMath'] = '<script type="text/javascript">var translateOnLoad = false;</script>';
208208
}
209209

210210
// WIRIS: plugin for inserting mathematical formulas

main/inc/lib/formvalidator/Element/html_editor.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,20 @@ function build_FCKeditor() {
106106
if (!FCKeditor :: IsCompatible()) {
107107
return parent::toHTML();
108108
}
109-
$this->fck_editor->Value = $this->getValue();
109+
$this->fck_editor->Value = $this->getValue();
110110
$result = $this->fck_editor->CreateHtml();
111+
112+
if (isset($this->fck_editor->Config['LoadAsciiMath'])) {
113+
if (isset($_SESSION['ascii_math_loaded']) &&
114+
$_SESSION['ascii_math_loaded'] == false
115+
) {
116+
$result .= $this->fck_editor->Config['LoadAsciiMath'];
117+
$_SESSION['ascii_math_loaded'] = true;
118+
}
119+
}
120+
111121
//Add a link to open the allowed html tags window
112122
//$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>';
113123
return $result;
114124
}
115-
}
125+
}

0 commit comments

Comments
 (0)