From d1c24befbd532e2cc7845e72d50d14fbaa67aa93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Fri, 22 Apr 2011 13:46:56 +0200 Subject: [PATCH] Feature #2204 update wiris plugin to ver 1.15.2 --- .../editor/plugins/fckeditor_wiris/VERSION | 2 +- .../plugins/fckeditor_wiris/cache/info.txt | 1 + .../plugins/fckeditor_wiris/configuration.ini | 75 +++--- .../plugins/fckeditor_wiris/core/core.js | 218 ++++++++++++++++-- .../plugins/fckeditor_wiris/fckplugin.js | 16 +- .../plugins/fckeditor_wiris/formulas/info.txt | 1 + .../fckeditor_wiris/integration/cas.php | 186 +++++++-------- .../integration/createcasimage.php | 62 ++--- .../integration/createimage.php | 110 ++++----- .../fckeditor_wiris/integration/editor.php | 142 ++++++------ .../fckeditor_wiris/integration/libwiris.php | 184 +++++++-------- 11 files changed, 577 insertions(+), 420 deletions(-) create mode 100644 main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/cache/info.txt create mode 100644 main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/formulas/info.txt diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/VERSION b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/VERSION index 282f354f41..795d870011 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/VERSION +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/VERSION @@ -1 +1 @@ -1.14.3 \ No newline at end of file +1.15.1 \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/cache/info.txt b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/cache/info.txt new file mode 100644 index 0000000000..1dcd1f6397 --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/cache/info.txt @@ -0,0 +1 @@ +This directory is used to save images \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/configuration.ini b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/configuration.ini index 16508ab535..0fa186635f 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/configuration.ini +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/configuration.ini @@ -1,68 +1,45 @@ wirisimageservicehost = services.wiris.net -//wirisimageservicehost = localhost wirisimageserviceport = 80 wirisimageservicepath = /demo/formula/render -//wirisimageservicepath = /chamilo/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/cache wirisimageserviceversion = 2.0 wiristransparency = true -#wirisimagebgcolor = #ffffff -#wirisimagefontsize = 16 -#wirisimageidentcolor = #000000 -#wirisimagenumbercolor = #000000 -#wirisimagesymbolcolor = #000000 -#wirisimageidentmathvariant = italic-sans-serif -#wirisimagenumbermathvariant = sans-serif -#wirisimagefontident = Courier -#wirisimagefontnumber = Dialog -#wirisimagefontranges = font1, font2 -#font1 = x3b1-x3ff;DialogInput,105 -#font2 = x41-x5A;FreeSans +;wirisimagebgcolor = #ffffff +;wirisimagefontsize = 16 +;wirisimageidentcolor = #000000 +;wirisimagenumbercolor = #000000 +;wirisimagesymbolcolor = #000000 +;wirisimageidentmathvariant = italic-sans-serif +;wirisimagenumbermathvariant = sans-serif +;wirisimagefontident = Courier +;wirisimagefontnumber = Dialog +;wirisimagefontranges = font1, font2 +;font1 = x3b1-x3ff;DialogInput,105 +;font2 = x41-x5A;FreeSans wirisformulaeditorcodebase = http://services.wiris.net/demo/formula/codebase/ -//wirisformulaeditorcodebase = http://localhost/chamilo/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/ wirisformulaeditorarchive = wiriseditor.jar wirisformulaeditorcode = WirisFormulaEditor wirisformulaeditorlang = en -//////////////////////////////// - wiriscascodebase = http://www.wiris.net/demo/wiris/wiris-codebase -//wiriscascodebase = http://www.juntadeandalucia.es/averroes/wiris/wiris-codebase -//wiriscascodebase = http://herramientas.educa.madrid.org/wiris/wiris-codebase -//wiriscascodebase = http://nea.educastur.princast.es/wiris/wiris-codebase -//wiriscascodebase = http://www.educa.jcyl.es/wiris/wiris-codebase -//wiriscascodebase = http://calculadora.edu365.cat/wiris/wiris-codebase -//wiriscascodebase = http://www.wiris.ee/wiris/wiris-codebase -//wiriscascodebase = http://users.wirisonline.net/applet -//wiriscascodebase = http://wiris.schule.at/wiris-codebase - - wiriscasarchive = wrs_net_%LANG.jar -//wiriscasarchive = wrs_andalucia_es.jar -//wiriscasarchive = wrs_cam_es.jar -//wiriscasarchive = wrs_asturias_es.jar -//wiriscasarchive = wrs_castleon_es.jar -//wiriscasarchive = wrs_edu365_ca.jar -//wiriscasarchive = wrs_estonia_et.jar -//wiriscasarchive = wrs_wnl_nl.jar -//wiriscasarchive = wrs_austria_de_en.jar - - wiriscasclass = WirisApplet_net_%LANG -//wiriscasclass = WirisApplet_andalucia_es -//wiriscasclass = WirisApplet_cam_es -//wiriscasclass = WirisApplet_asturias_es -//wiriscasclass = WirisApplet_castleon_es -//wiriscasclass = WirisApplet_edu365_ca -//wiriscasclass = WirisApplet_estonia_et -//wiriscasclass = WirisApplet_wnl_nl -//wiriscasclass = WirisApplet_austria_de_en - - wiriscaslanguages = en, es, fr, it, nl, et, ca, eu, pt, de CAS_width = 450 CAS_height = 400 + +; Only for PHP integration. wirisproxy = false -wirisproxy_host = -wirisproxy_port = \ No newline at end of file +wirisproxy_host = +wirisproxy_port = + +; Only for java integration. +;wirisstorageclass = com.wiris.plugin.storage.FileStorageAndCache +;wiriscontainerstorageclass = com.wiris.plugin.storage.FileStorageAndCache + +; Place to store the cached images. +;wiriscachedirectory = /var/cache + +; Place to store the formulas. +;wirisformuladirectory = /var/formulas diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/core.js b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/core.js index 6938e8ac63..05f5055311 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/core.js +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/core.js @@ -3,6 +3,28 @@ var _wrs_currentPath = window.location.toString().substr(0, window.location.toSt var _wrs_isNewElement = true; var _wrs_temporalImage; +var _wrs_xmlCharacters = { + 'tagOpener': '<', // \x3C + 'tagCloser': '>', // \x3E + 'doubleQuote': '"', // \x22 + 'ampersand': '&', // \x26 + 'quote': '\'' // \x27 +}; + +var _wrs_safeXmlCharacters = { + 'tagOpener': '«', // \xAB + 'tagCloser': '»', // \xBB + 'doubleQuote': '¨', // \xA8 + 'ampersand': '§', // \xA7 + 'quote': '`' // \xB4 +}; + +var _wrs_safeXmlCharactersEntities = { + 'tagOpener': '«', + 'tagCloser': '»', + 'doubleQuote': '¨' +} + /** * Cross-browser addEventListener/attachEvent function. * @param object element Element target @@ -330,11 +352,22 @@ function wrs_createObjectCode(object, creator) { } var parent = object.parentNode; - var newParent = wrs_createElement(parent.tagName, {}, creator); - parent.replaceChild(newParent, object); - newParent.appendChild(object); - var toReturn = newParent.innerHTML; - parent.replaceChild(object, newParent); + var toReturn; + + if (parent != null) { + var newParent = wrs_createElement(parent.tagName, {}, creator); + parent.replaceChild(newParent, object); + newParent.appendChild(object); + toReturn = newParent.innerHTML; + parent.replaceChild(object, newParent); + } + else { + var newParent = wrs_createElement('div', {}, creator); + newParent.appendChild(object); + toReturn = newParent.innerHTML; + newParent.removeChild(object); + } + return toReturn; } @@ -347,15 +380,51 @@ function wrs_endParse(code) { var containerCode = '
' + code + '
'; var container = wrs_createObject(containerCode); var imgList = container.getElementsByTagName('img'); + var convertToXml = false; + var convertToSafeXml = false; + + if (window._wrs_conf_saveMode) { + if (_wrs_conf_saveMode == 'safeXml') { + convertToXml = true; + convertToSafeXml = true; + } + else if (_wrs_conf_saveMode == 'xml') { + convertToXml = true; + } + } for (var i = 0; i < imgList.length; ++i) { - if (imgList[i].className == 'Wiriscas') { + if (imgList[i].className == 'Wirisformula') { + if (convertToXml) { + var xmlCode = imgList[i].getAttribute(_wrs_conf_imageMathmlAttribute); + var replacementObject; + + if (!convertToSafeXml) { + xmlCode = wrs_mathmlDecode(xmlCode); + var span = document.createElement('span'); + span.innerHTML = xmlCode; + replacementObject = span.firstChild; + } + else { + replacementObject = document.createTextNode(xmlCode); + } + + imgList[i].parentNode.replaceChild(replacementObject, imgList[i]); + --i; // One image has been deleted. + } + } + else if (imgList[i].className == 'Wiriscas') { var appletCode = imgList[i].getAttribute(_wrs_conf_CASMathmlAttribute); appletCode = wrs_mathmlDecode(appletCode); var appletObject = wrs_createObject(appletCode); appletObject.setAttribute('src', imgList[i].src); + var object = appletObject; + + if (convertToSafeXml) { + object = document.createTextNode(wrs_mathmlEncode(wrs_createObjectCode(appletObject))); + } - imgList[i].parentNode.replaceChild(appletObject, imgList[i]); + imgList[i].parentNode.replaceChild(object, imgList[i]); --i; // One image has been deleted. } } @@ -425,8 +494,22 @@ function wrs_httpBuildQuery(properties) { * @return string */ function wrs_initParse(code) { - var containerCode = '
' + code + '
'; - var container = wrs_createObject(containerCode); + if (window._wrs_conf_saveMode) { + var safeXml = (_wrs_conf_saveMode == 'safeXml'); + var characters = _wrs_xmlCharacters; + + if (safeXml) { + characters = _wrs_safeXmlCharacters; + code = wrs_parseSafeAppletsToObjects(code); + } + + if (safeXml || _wrs_conf_saveMode == 'xml') { + // Converting XML to tags. + code = wrs_parseMathmlToImg(code, characters); + } + } + + var container = wrs_createObject('
' + code + '
'); var appletList = container.getElementsByTagName('applet'); for (var i = 0; i < appletList.length; ++i) { @@ -450,16 +533,22 @@ function wrs_initParse(code) { /** * WIRIS special encoding. - * We use these entities because IE doesn't support html entities on its attributes sometimes. Yes, sometimes. + * We use these entities because IE doesn't support html entities on its attributes sometimes. Yes, sometimes. * @param string input * @return string */ function wrs_mathmlDecode(input) { - input = input.split('«').join('<'); // \xAB by \x3C - input = input.split('»').join('>'); // \xBB by \x3E - input = input.split('¨').join('"'); // \xA8 by \x22 - input = input.split('§').join('&'); // \xA7 by \x26 - input = input.split('`').join("'"); // \xB4 by \x27 + // Decoding entities. + input = input.split(_wrs_safeXmlCharactersEntities.tagOpener).join(_wrs_safeXmlCharacters.tagOpener); + input = input.split(_wrs_safeXmlCharactersEntities.tagCloser).join(_wrs_safeXmlCharacters.tagCloser); + input = input.split(_wrs_safeXmlCharactersEntities.doubleQuote).join(_wrs_safeXmlCharacters.doubleQuote); + + // Decoding characters. + input = input.split(_wrs_safeXmlCharacters.tagOpener).join(_wrs_xmlCharacters.tagOpener); + input = input.split(_wrs_safeXmlCharacters.tagCloser).join(_wrs_xmlCharacters.tagCloser); + input = input.split(_wrs_safeXmlCharacters.doubleQuote).join(_wrs_xmlCharacters.doubleQuote); + input = input.split(_wrs_safeXmlCharacters.ampersand).join(_wrs_xmlCharacters.ampersand); + input = input.split(_wrs_safeXmlCharacters.quote).join(_wrs_xmlCharacters.quote); // We are replacing $ by & for retrocompatibility. Now, the standard is replace § by & input = input.split('$').join('&'); @@ -469,16 +558,16 @@ function wrs_mathmlDecode(input) { /** * WIRIS special encoding. - * We use these entities because IE doesn't support html entities on its attributes sometimes. Yes, sometimes. + * We use these entities because IE doesn't support html entities on its attributes sometimes. Yes, sometimes. * @param string input * @return string */ function wrs_mathmlEncode(input) { - input = input.split('<').join('«'); // \x3C by \xAB - input = input.split('>').join('»'); // \x3E by \xBB - input = input.split('"').join('¨'); // \x22 by \xA8 - input = input.split('&').join('§'); // \x26 by \xA7 - input = input.split("'").join('`'); // \x27 by \xB4 + input = input.split(_wrs_xmlCharacters.tagOpener).join(_wrs_safeXmlCharacters.tagOpener); + input = input.split(_wrs_xmlCharacters.tagCloser).join(_wrs_safeXmlCharacters.tagCloser); + input = input.split(_wrs_xmlCharacters.doubleQuote).join(_wrs_safeXmlCharacters.doubleQuote); + input = input.split(_wrs_xmlCharacters.ampersand).join(_wrs_safeXmlCharacters.ampersand); + input = input.split(_wrs_xmlCharacters.quote).join(_wrs_safeXmlCharacters.quote); return input; } @@ -531,6 +620,93 @@ function wrs_mathmlToImgObject(creator, mathml, wirisProperties) { return imgObject; } +/** + * Opens a new CAS window. + * @return object The opened window + */ +function wrs_openCASWindow() { + return window.open(_wrs_conf_CASPath, 'WIRISCAS', _wrs_conf_CASAttributes); +} + +/** + * Opens a new editor window. + * @param string language Language code for the editor + * @return object The opened window + */ +function wrs_openEditorWindow(language) { + var path = _wrs_conf_editorPath; + + if (language) { + path += '?lang=' + language; + } + + return window.open(path, 'WIRISeditor', _wrs_conf_editorAttributes); +} + +/** + * Converts all occurrences of mathml code to the corresponding image. + * @param string content + * @return string + */ +function wrs_parseMathmlToImg(content, characters) { + var output = ''; + var mathTagBegin = characters.tagOpener + 'math'; + var mathTagEnd = characters.tagOpener + '/math' + characters.tagCloser; + var start = content.indexOf(mathTagBegin); + var end = 0; + + while (start != -1) { + output += content.substring(end, start); + end = content.indexOf(mathTagEnd, start); + + if (end == -1) { + end = content.length - 1; + } + else { + end += mathTagEnd.length; + } + + var mathml = content.substring(start, end); + mathml = (characters == _wrs_safeXmlCharacters) ? wrs_mathmlDecode(mathml) : wrs_mathmlEntities(mathml); + output += wrs_createObjectCode(wrs_mathmlToImgObject(document, mathml)); + start = content.indexOf(mathTagBegin, end); + } + + output += content.substring(end, content.length - 1); + return output; +} + +/** + * Converts all occurrences of safe applet code to the corresponding code. + * @param string content + * @return string + */ +function wrs_parseSafeAppletsToObjects(content) { + var output = ''; + var appletTagBegin = _wrs_safeXmlCharacters.tagOpener + 'applet'; + var appletTagEnd = _wrs_safeXmlCharacters.tagOpener + '/applet' + _wrs_safeXmlCharacters.tagCloser; + var start = content.indexOf(appletTagBegin); + var end = 0; + + while (start != -1) { + output += content.substring(end, start); + end = content.indexOf(appletTagEnd, start); + + if (end == -1) { + end = content.length - 1; + } + else { + end += appletTagEnd.length; + } + + output += wrs_mathmlDecode(content.substring(start, end)); + start = content.indexOf(appletTagBegin, end); + } + + output += content.substring(end, content.length - 1); + return output; +} + /** * Cross-browser removeEventListener/detachEvent function. * @param object element Element target diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js index f30e61a256..b590c6ab3b 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js @@ -29,6 +29,8 @@ parent._wrs_conf_createimagePath = FCKConfig.PluginsPath + 'fckeditor_wiris/inte parent._wrs_conf_createcasimagePath = FCKConfig.PluginsPath + 'fckeditor_wiris/integration/createcasimage.php'; // Specifies where is createcasimage script //parent._wrs_conf_getmathmlPath = FCKConfig.PluginsPath + 'fckeditor_wiris/integration/getmathml.php'; // Specifies where is getmathml script +var _wrs_conf_saveMode = 'tags'; // this value can be 'tags', 'xml' or 'safeXml'. + /* Vars */ parent._wrs_int_editorIcon = FCKConfig.PluginsPath + 'fckeditor_wiris/core/wiris-formula.gif'; parent._wrs_int_CASIcon = FCKConfig.PluginsPath + 'fckeditor_wiris/core/wiris-cas.gif'; @@ -94,15 +96,15 @@ if (parent._wrs_conf_editorEnabled) { FCKCommands.RegisterCommand( 'fckeditor_wiris_openFormulaEditor_aux', new FCKDialogCommand( - 'WIRIS Formula Editor', - 'WIRIS Formula Editor', + 'WIRIS editor', + 'WIRIS editor', parent._wrs_conf_editorPath, 500, 400 ) ); - var formulaItem = new FCKToolbarButton('fckeditor_wiris_openFormulaEditor', 'WIRIS Formula Editor'); + var formulaItem = new FCKToolbarButton('fckeditor_wiris_openFormulaEditor', 'WIRIS editor'); formulaItem.IconPath = parent._wrs_int_editorIcon; FCKToolbarItems.RegisterItem( @@ -154,7 +156,7 @@ function wrs_int_openNewFormulaEditor(iframe) { } } else { - FCKDialog.OpenDialog('WIRIS Formula Editor', 'WIRIS Formula Editor', parent._wrs_conf_editorPath, parent._wrs_conf_editorWidth, parent._wrs_conf_editorHeight); + FCKDialog.OpenDialog('WIRIS editor', 'WIRIS editor', parent._wrs_conf_editorPath, parent._wrs_conf_editorWidth, parent._wrs_conf_editorHeight); wrs_int_hidePopUpButtons(); } } @@ -177,7 +179,7 @@ function wrs_int_openNewCAS(iframe) { } } else { - FCKDialog.OpenDialog('WIRIS Formula Editor', 'WIRIS Formula Editor', parent._wrs_conf_CASPath, parent._wrs_conf_CASWidth, parent._wrs_conf_CASHeight); + FCKDialog.OpenDialog('WIRIS CAS', 'WIRIS CAS', parent._wrs_conf_CASPath, parent._wrs_conf_CASWidth, parent._wrs_conf_CASHeight); wrs_int_hidePopUpButtons(); } } @@ -232,7 +234,7 @@ function wrs_int_openExistingFormulaEditor(iframe) { parent._wrs_int_window = window.open(parent._wrs_conf_editorPath, 'WIRISFormulaEditor', parent._wrs_conf_editorAttributes); } else { - FCKDialog.OpenDialog('WIRIS Formula Editor', 'WIRIS Formula Editor', parent._wrs_conf_editorPath, parent._wrs_conf_editorWidth, parent._wrs_conf_editorHeight); + FCKDialog.OpenDialog('WIRIS editor', 'WIRIS editor', parent._wrs_conf_editorPath, parent._wrs_conf_editorWidth, parent._wrs_conf_editorHeight); wrs_int_hidePopUpButtons(); } } @@ -250,7 +252,7 @@ function wrs_int_openExistingCAS(iframe) { parent._wrs_int_window = window.open(parent._wrs_conf_CASPath, 'WIRISCAS', parent._wrs_conf_CASAttributes); } else { - FCKDialog.OpenDialog('WIRIS Formula Editor', 'WIRIS Formula Editor', parent._wrs_conf_CASPath, parent._wrs_conf_CASWidth, parent._wrs_conf_CASHeight); + FCKDialog.OpenDialog('WIRIS CAS', 'WIRIS CAS', parent._wrs_conf_CASPath, parent._wrs_conf_CASWidth, parent._wrs_conf_CASHeight); wrs_int_hidePopUpButtons(); } } diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/formulas/info.txt b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/formulas/info.txt new file mode 100644 index 0000000000..38c0c4e0cd --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/formulas/info.txt @@ -0,0 +1 @@ +This directory is used to save mathml \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/cas.php b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/cas.php index 85670bc31a..797355788a 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/cas.php +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/cas.php @@ -1,94 +1,94 @@ - - - - - - - -

You need JAVA® to use WIRIS tools.
FREE download from www.java.com

-
- - - - - - - - WIRIS CAS - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
Width Calculate on load Show toolbar - Language - - -
Height Focus on load Elementary mode
-
- - - + + + + + + +

You need JAVA® to use WIRIS tools.
FREE download from www.java.com

+
+ + + + + + + + WIRIS CAS + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Width Calculate on load Show toolbar + Language + + +
Height Focus on load Elementary mode
+
+ + + \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createcasimage.php b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createcasimage.php index d58a49fb4e..2a5239027a 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createcasimage.php +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createcasimage.php @@ -1,32 +1,32 @@ - \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createimage.php b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createimage.php index 9b9428333b..98982a0d4e 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createimage.php +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createimage.php @@ -1,56 +1,56 @@ - \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/editor.php b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/editor.php index 205c7415d8..cb727381e8 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/editor.php +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/editor.php @@ -1,72 +1,72 @@ - - - - - - WIRIS Formula Editor - - - - - - - - - - - -
- - - - 'wirisformulaeditorlang', - 'identMathvariant' => 'wirisimageidentmathvariant', - 'numberMathvariant' => 'wirisimagenumbermathvariant', - 'fontIdent' => 'wirisimagefontident', - 'fontNumber' => 'wirisimagefontnumber', - 'version' => 'wirisimageserviceversion' - ); - - foreach ($params as $key => $value) { - if (isset($config[$value])) { - echo ''; - } - } - - if (isset($config['wirisimagefontranges'])) { - $fontRanges = explode(',', $config['wirisimagefontranges']); - $fontRangesCount = count($fontRanges); - - for ($i = 0; $i < $fontRangesCount; ++$i) { - $fontRangeName = trim($fontRanges[$i]); - - if (isset($config[$fontRangeName])) { - echo ''; - } - } - } - ?> - -

You need JAVA® to use WIRIS tools.
FREE download from www.java.com

-
-
- Manual >> - - -
- + + + + + + WIRIS Formula Editor + + + + + + + + + + + +
+ + + + 'wirisformulaeditorlang', + 'identMathvariant' => 'wirisimageidentmathvariant', + 'numberMathvariant' => 'wirisimagenumbermathvariant', + 'fontIdent' => 'wirisimagefontident', + 'fontNumber' => 'wirisimagefontnumber', + 'version' => 'wirisimageserviceversion' + ); + + foreach ($params as $key => $value) { + if (isset($config[$value])) { + echo ''; + } + } + + if (isset($config['wirisimagefontranges'])) { + $fontRanges = explode(',', $config['wirisimagefontranges']); + $fontRangesCount = count($fontRanges); + + for ($i = 0; $i < $fontRangesCount; ++$i) { + $fontRangeName = trim($fontRanges[$i]); + + if (isset($config[$fontRangeName])) { + echo ''; + } + } + } + ?> + +

You need JAVA® to use WIRIS tools.
FREE download from www.java.com

+
+
+ Manual >> + + +
+ \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/libwiris.php b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/libwiris.php index 95ff1c6bf4..ac7f616d47 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/libwiris.php +++ b/main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/libwiris.php @@ -1,93 +1,93 @@ - 'wirisimagebgcolor', - 'symbolColor' => 'wirisimagesymbolcolor', - 'transparency' => 'wiristransparency', - 'fontSize' => 'wirisimagefontsize', - 'numberColor' => 'wirisimagenumbercolor', - 'identColor' => 'wirisimageidentcolor', - 'identMathvariant' => 'wirisimageidentmathvariant', - 'numberMathvariant' => 'wirisimagenumbermathvariant', - 'fontIdent' => 'wirisimagefontident', - 'fontNumber' => 'wirisimagefontnumber', - 'version' => 'wirisimageserviceversion' -); - -$wrs_xmlFileAttributes = array( - 'bgColor', - 'symbolColor', - 'transparency', - 'fontSize', - 'numberColor', - 'identColor', - 'identMathvariant', - 'numberMathvariant', - 'fontIdent', - 'fontNumber' -); - -function wrs_getAvailableCASLanguages($languageString) { - $availableLanguages = explode(',', $languageString); - - for ($i = count($availableLanguages) - 1; $i >= 0; --$i) { - $availableLanguages[$i] = trim($availableLanguages[$i]); - } - - // At least we should accept an empty language. - - if (!isset($availableLanguages[0])) { - $availableLanguages[] = ''; - } - - return $availableLanguages; -} - -function wrs_loadConfig($file) { - $handle = fopen($file, 'r'); - - if ($handle === false) { - return array(); - } - - $toReturn = array(); - - while (($line = fgets($handle)) !== false) { - $lineWords = explode('=', $line, 2); - - if (isset($lineWords[1])) { - $key = trim($lineWords[0]); - $value = trim($lineWords[1]); - $toReturn[$key] = $value; - } - } - - fclose($handle); - return $toReturn; -} - -function wrs_replaceVariable($value, $variableName, $variableValue) { - return str_replace('%' . $variableName, $variableValue, $value); -} - -function wrs_secureStripslashes($element) { - if (is_array($element)) { - return array_map('wrs_secureStripslashes', $element); - } - - return stripslashes($element); -} - -set_magic_quotes_runtime(0); - -if (get_magic_quotes_gpc() == 1) { - $_REQUEST = array_map('wrs_secureStripslashes', $_REQUEST); - $_GET = array_map('wrs_secureStripslashes', $_GET); - $_POST = array_map('wrs_secureStripslashes', $_POST); -} + 'wirisimagebgcolor', + 'symbolColor' => 'wirisimagesymbolcolor', + 'transparency' => 'wiristransparency', + 'fontSize' => 'wirisimagefontsize', + 'numberColor' => 'wirisimagenumbercolor', + 'identColor' => 'wirisimageidentcolor', + 'identMathvariant' => 'wirisimageidentmathvariant', + 'numberMathvariant' => 'wirisimagenumbermathvariant', + 'fontIdent' => 'wirisimagefontident', + 'fontNumber' => 'wirisimagefontnumber', + 'version' => 'wirisimageserviceversion' +); + +$wrs_xmlFileAttributes = array( + 'bgColor', + 'symbolColor', + 'transparency', + 'fontSize', + 'numberColor', + 'identColor', + 'identMathvariant', + 'numberMathvariant', + 'fontIdent', + 'fontNumber' +); + +function wrs_getAvailableCASLanguages($languageString) { + $availableLanguages = explode(',', $languageString); + + for ($i = count($availableLanguages) - 1; $i >= 0; --$i) { + $availableLanguages[$i] = trim($availableLanguages[$i]); + } + + // At least we should accept an empty language. + + if (!isset($availableLanguages[0])) { + $availableLanguages[] = ''; + } + + return $availableLanguages; +} + +function wrs_loadConfig($file) { + $handle = fopen($file, 'r'); + + if ($handle === false) { + return array(); + } + + $toReturn = array(); + + while (($line = fgets($handle)) !== false) { + $lineWords = explode('=', $line, 2); + + if (isset($lineWords[1])) { + $key = trim($lineWords[0]); + $value = trim($lineWords[1]); + $toReturn[$key] = $value; + } + } + + fclose($handle); + return $toReturn; +} + +function wrs_replaceVariable($value, $variableName, $variableValue) { + return str_replace('%' . $variableName, $variableValue, $value); +} + +function wrs_secureStripslashes($element) { + if (is_array($element)) { + return array_map('wrs_secureStripslashes', $element); + } + + return stripslashes($element); +} + +@set_magic_quotes_runtime(0); + +if (get_magic_quotes_gpc() == 1) { + $_REQUEST = array_map('wrs_secureStripslashes', $_REQUEST); + $_GET = array_map('wrs_secureStripslashes', $_GET); + $_POST = array_map('wrs_secureStripslashes', $_POST); +} ?> \ No newline at end of file