[svn r18479] FS#2867 - FCKEditor, the imgmap plugin installation: Elimination of the manual setting of mimetex_url within the file dokeos/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html. The script receives the needed information from the server and picks up the mimetex_url authomatically.

skala
Ivan Tcholakov 16 years ago
parent 20a057b477
commit 62f1074d02
  1. 19
      main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html
  2. 10
      main/inc/lib/fckeditor/fckeditor.php

@ -5,22 +5,25 @@
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
// Choose mimetex_url according to your operating system.
// TODO: This could be done authomatiacally.
var oEditor = window.parent.InnerDialogLoaded() ;
var FCKLang = oEditor.FCKLang ;
var FCK = oEditor.FCK ;
var FCKConfig = oEditor.FCKConfig ;
// Choosing mimetex_url according to the server's operating system.
var mimetex_url = "/cgi-bin/mimetex.cgi" ; // Linux
//var mimetex_url = "/cgi-bin/mimetex.exe" ; // Windows
if ( FCKConfig.IsWindowsServer )
{
mimetex_url = "/cgi-bin/mimetex.exe" ; // Windows
}
var mimetex_cgi = mimetex_url + "? \\Large " ;
var preview_cgi = mimetex_cgi + "\\nocach " ;
var result_cgi = mimetex_cgi ;
var img_tag = true;
var img_tag = true ;
// FCKEditor
var oEditor = window.parent.InnerDialogLoaded() ;
var FCKLang = oEditor.FCKLang ;
var FCK = oEditor.FCK ;
// look for a MATH-tag
var eSelected = FCK.Selection.MoveToAncestorNode( 'MATH' ) ;

@ -417,6 +417,16 @@ class FCKeditor
// for links (any resource type)
$this->Config['LinkUploadURL'] = $this->BasePath . "editor/filemanager/upload/php/upload.php?Type=File&ServerPath=$upload_path" ;
// The mimetex plugin needs the following information about server's OS.
if (defined('PHP_OS'))
{
$os = PHP_OS;
}
else
{
$os = php_uname();
}
$this->Config['IsWindowsServer'] = (strtoupper(substr($os, 0, 3 )) === 'WIN') ? true : false;
/*
* The original code starts from here.

Loading…
Cancel
Save