Juan Carlos Raña 14 years ago
parent
commit
1b96152e8f
23 changed files with 27 additions and 1879 deletions
  1. 6 0
      documentation/installation_guide.html
  2. 5 0
      documentation/installation_guide_es_ES.html
  3. 0 1
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/VERSION
  4. 10 2
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/configuration.ini.default
  5. BIN
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/cas.gif
  6. 0 231
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/cas.js
  7. 0 713
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/core.js
  8. 0 94
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/editor.js
  9. BIN
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/wiris-cas.gif
  10. BIN
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/wiris-formula.gif
  11. 0 334
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js
  12. 0 94
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/cas.php
  13. 0 32
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createcasimage.php
  14. 0 56
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createimage.php
  15. 0 72
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/editor.php
  16. 0 34
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/getmathml.php
  17. 0 93
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/libwiris.php
  18. 0 20
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/showcasimage.php
  19. 0 100
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/showimage.php
  20. 3 0
      main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/readme.txt
  21. 1 1
      main/lang/brazilian/index.inc.php
  22. 1 1
      main/lang/english/admin.inc.php
  23. 1 1
      main/lang/spanish/admin.inc.php

+ 6 - 0
documentation/installation_guide.html

@@ -45,6 +45,7 @@
   <li><a href="#6._LDAP">LDAP&nbsp;</a></li>
   <li><a href="#7._Mathematical_formulas">Mathematical formulas with LaTeX</a></li>
   <li><a href="#8._ASCIIMathML_mathematical_formulas">Mathematical formulas with ASCIIMathML</a></li>
+  <li><a href="#9._WIRIS_mathematical_formulas">Mathematical formulas with WIRIS</a></li>
 </ol>
 
 <br />
@@ -686,6 +687,11 @@ You may need to alter the setting to be for example:</p>
     <li>... or something else</li>
 </ul>
 <p>For testing how the variable <strong>AMTcgiloc</strong> may be set, there are some examples (as comments) inside the script.</p>
+
+<hr style="width: 100%; height: 2px;" />
+<h2><a name="9._WIRIS_mathematical_formulas"></a>9. Mathematical formulas with WIRIS</h2>
+<p>Installing this plugin you get WIRIS editor and WIRIS CAS. <br/>
+This activation is not fully realized unless it has been previously downloaded the <a href="http://www.wiris.com/plugins/editors/download?filter=fckeditor" target="_blank">PHP plugin for FCKeditor WIRIS</a> and unzipped its contents in the Chamilo's directory main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/ <br/>This is necessary because Wiris is proprietary software and his services are <a href="http://www.wiris.com/store/who-pays" target="_blank">commercial</a>. To make adjustments to the plugin, edit configuration.ini file or replace his content by configuration.ini.default Chamilo file.</p>
 <hr style="width: 100%; height: 2px;" />
 <p>
   <br />

+ 5 - 0
documentation/installation_guide_es_ES.html

@@ -53,6 +53,7 @@ no son requeridos para usar Chamilo LMS. &nbsp;Por favor, lea completamente este
   <li><a href="#6._LDAP">LDAP&nbsp;</a></li>
   <li><a href="#7._Mathematical_formulas">Fórmulas Matemáticas con LaTeX</a></li>
   <li><a href="#8._ASCIIMathML_mathematical_formulas">Fórmulas Matemáticas con ASCIIMathML</a></li>
+  <li><a href="#9._WIRIS_mathematical_formulas">Fórmulas Matemáticas con WIRIS</a></li>
 </ol>
 
 
@@ -780,6 +781,10 @@ Podría necesitar modificar el ejemplo para tener algo como:</p>
 </ul>
 <p>Para formas de probar como la variable <strong>AMTcgiloc</strong> tiene que ser configurada, existen unos ejemplos (en comentario) dentro del script.</p>
 <hr style="width: 100%; height: 2px;" />
+<h2><a name="9._WIRIS_mathematical_formulas"></a>9. Fórmulas matemáticas con WIRIS</h2>
+<p>Instalando este plugin obtendrá WIRIS editor y WIRIS CAS. <br/>La activación no se realiza completamente si previamente no ha descargado el <a href="http://www.wiris.com/plugins/editors/download?filter=fckeditor" target="_blank">PHP plugin for FCKeditor de WIRIS</a> y descomprimido su contenido en el directorio de Chamilo main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/ <br/>Esto es necesario debido a que Wiris es un software propietario y los servicios de Wiris son <a href="http://www.wiris.com/store/who-pays" target="_blank">comerciales</a>. Para realizar ajustes en el plugin edite el archivo configuration.ini o sustituya su contenido por el de configuration.ini.default que acompaña a Chamilo.
+</p>
+<hr style="width: 100%; height: 2px;" />
 <p>
   <br />
   <br />

+ 0 - 1
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/VERSION

@@ -1 +0,0 @@
-1.14.3

+ 10 - 2
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/configuration.ini → main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/configuration.ini.default

@@ -25,7 +25,7 @@ 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
@@ -65,4 +65,12 @@ CAS_width = 450
 CAS_height = 400
 wirisproxy = false
 wirisproxy_host =
-wirisproxy_port =
+wirisproxy_port =
+
+//////
+
+// Place to store the cached images.
+//wiriscachedirectory = /var/cache
+
+// Place to store the formulas.
+//wirisformuladirectory = /var/formulas

BIN
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/cas.gif


+ 0 - 231
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/cas.js

@@ -1,231 +0,0 @@
-var wrs_opener;
-var appletObject;
-var initialXML = '';
-var closeFunction;
-
-if (window.opener) {							// For popup mode.
-	wrs_opener = window.opener;
-	closeFunction = window.close;
-}
-// FCKeditor integration begin
-else {											// For iframe mode.
-	wrs_opener = window.parent;
-	
-	while (wrs_opener.InnerDialogLoaded) {
-		wrs_opener = wrs_opener.parent;
-	}
-}
-
-if (window.parent.InnerDialogLoaded) {			// Iframe mode.
-	window.parent.InnerDialogLoaded();
-	closeFunction = window.parent.Cancel;
-}
-else if (window.opener.parent.FCKeditorAPI) {	// Popup mode.
-	wrs_opener = window.opener.parent;
-}
-// FCKeditor integration end
-
-function getMathmlFromAppletCode(appletCode) {
-	var optionForm = document.getElementById('optionForm');
-	appletObject = wrs_opener.wrs_createObject(appletCode, document);
-	
-	optionForm.width.value = parseInt(appletObject.width);
-	optionForm.height.value = parseInt(appletObject.height);
-	
-	var params = appletObject.childNodes;
-	var mathml = '';
-	
-	for (var i = 0; i < params.length; ++i) {
-		if (params[i].name == 'xmlinitialtext') {
-			mathml = params[i].value;
-		}
-		else if (params[i].name == 'requestfirstevaluation') {
-			optionForm.executeonload.checked = (params[i].value == 'true') ? true : false;
-		}
-		else if (params[i].name == 'toolbar') {
-			optionForm.toolbar.checked = (params[i].value == 'floating') ? false : true;
-		}
-		else if (params[i].name == 'requestfocus') {
-			optionForm.focusonload.checked = (params[i].value == 'true') ? true : false;
-		}
-		else if (params[i].name == 'level') {
-			optionForm.level.checked = (params[i].value == 'primary') ? true : false;
-		}
-	}
-	
-	return mathml;
-}
-
-function createIframePath(params) {
-	var iframePath = wrs_opener._wrs_conf_CASPath;
-	iframePath += ((iframePath.indexOf('?') == -1) ? '?' : '&') + 'mode=applet&';
-	
-	for (var i in params) {
-		iframePath += wrs_opener.wrs_urlencode(i) + '=' + wrs_opener.wrs_urlencode(params[i]);
-	}
-	
-	return iframePath;
-}
-
-function createIframe(params) {
-	var iframe = document.createElement('iframe');
-	iframe.id = 'appletContainerIframe';
-	iframe.src = createIframePath(params);
-	iframe.width = '100%';
-	iframe.height = '100%';
-	iframe.frameBorder = 0;
-	
-	wrs_opener.wrs_addEvent(iframe, 'load', function () {
-		if (initialXML.length > 0) {
-			var applet = iframe.contentWindow.document.getElementById('applet');
-			
-			function setAppletMathml() {
-				// Internet explorer fails on "applet.isActive". It only supports "applet.isActive()".
-				
-				try {
-					if (applet.isActive && applet.isActive()) {
-						applet.setXML(initialXML);
-					}
-					else {
-						setTimeout(setAppletMathml, 50);
-					}
-				}
-				catch (e) {
-					if (applet.isActive()) {
-						applet.setXML(initialXML);
-					}
-					else {
-						setTimeout(setAppletMathml, 50);
-					}
-				}
-			}
-
-			setAppletMathml();
-		}
-	});
-	
-	document.getElementById('appletContainer').appendChild(iframe);
-}
-
-function reloadIframe(params) {
-	var iframe = document.getElementById('appletContainerIframe');
-	var applet = iframe.contentWindow.document.getElementById('applet');
-	initialXML = applet.getXML();
-	iframe.src = createIframePath(params);
-}
-
-wrs_opener.wrs_addEvent(window, 'load', function () {
-	// Getting language list <select> object.
-	var languageList = document.getElementById('languageList');
-	
-	// When the language list <select> object changes its value, the iframe should be refreshed.
-	
-	wrs_opener.wrs_addEvent(languageList, 'change', function () {
-		reloadIframe({
-			'lang': languageList.value
-		});
-	});
-	
-	// Setting iframe language.
-	
-	var language;
-	
-	if (wrs_opener._wrs_isNewElement) {
-		language = wrs_opener._wrs_int_language;
-	}
-	else {
-		var appletCode = wrs_opener._wrs_temporalImage.getAttribute(wrs_opener._wrs_conf_CASMathmlAttribute);
-		initialXML = getMathmlFromAppletCode(wrs_opener.wrs_mathmlDecode(appletCode));
-		
-		var language = '';
-		
-		// We can convert initialXML to an object and get its "lang" value. However, IE does not support this functionability, so we use string parsing.
-		var languageStart = initialXML.indexOf('lang="');
-		
-		if (languageStart != -1) {
-			var languageEnd = initialXML.indexOf('"', languageStart + 6);		// +6 because 'lang="'.length is 6.
-			
-			if (languageEnd != -1) {
-				language = initialXML.substring(languageStart + 6, languageEnd);
-			}
-		}
-	}
-	
-	// Creating the iframe.
-	
-	createIframe({
-		'lang': language
-	});
-	
-	// Selecting the language on the <select> object.
-	
-	for (var i = languageList.options.length - 1; i >= 0; --i) {
-		if (languageList.options[i].value == language) {
-			languageList.selectedIndex = i;
-			i = 0;
-		}
-	}
-	
-	// More events.
-	
-	wrs_opener.wrs_addEvent(document.getElementById('submit'), 'click', function () {
-		var applet = document.getElementById('appletContainerIframe').contentWindow.document.getElementById('applet');
-		
-		// Creating new applet code
-		var optionForm = document.getElementById('optionForm');
-		var newWidth = parseInt(optionForm.width.value);
-		var newHeight = parseInt(optionForm.height.value);
-		
-		var appletCode = '<applet alt="WIRIS CAS" class="Wiriscas" align="middle" ';
-		appletCode += 'codebase="' + applet.getAttribute('codebase') + '" ';
-		appletCode += 'archive="' + applet.getAttribute('archive') + '" ';
-		appletCode += 'code="' + applet.getAttribute('code') + '" ';
-		appletCode += 'width="' + newWidth + '" height="' + newHeight + '">';
-		
-		appletCode += '<param name="requestfirstevaluation" value="' + (optionForm.executeonload.checked ? 'true' : 'false') + '"></param>';
-		appletCode += '<param name="toolbar" value="' + (optionForm.toolbar.checked ? 'true' : 'floating') + '"></param>';
-		appletCode += '<param name="requestfocus" value="' + (optionForm.focusonload.checked ? 'true' : 'false') + '"></param>';
-		appletCode += '<param name="level" value="' + (optionForm.level.checked ? 'primary' : 'false') + '"></param>';
-		appletCode += '<param name="xmlinitialtext" value="' + wrs_opener.wrs_htmlentities(applet.getXML()) + '"></param>';
-		appletCode += '<param name="interface" value="false"></param><param name="commands" value="false"></param><param name="command" value="false"></param>';
-		
-		appletCode += '</applet>';
-		
-		// Getting the image
-		// First, resize applet
-		applet.width = newWidth;
-		applet.height = newHeight;
-		
-		// Waiting for applet resizing
-		function finish() {
-			if (applet.getSize().width != applet.width || applet.getSize().height != applet.height) {
-				setTimeout(finish, 100);
-			}
-			else {
-				// Getting the image
-				var image = applet.getImageBase64('png');
-				
-				// FCKeditor integration begin
-				if (window.parent.InnerDialogLoaded && window.parent.FCKBrowserInfo.IsIE) {			// On IE, we must close the dialog for push the caret on the correct position.
-					closeFunction();
-					wrs_opener.wrs_int_updateCAS(appletCode, image, newWidth, newHeight);
-				}
-				// FCKeditor integration end
-				else {
-					wrs_opener.wrs_int_updateCAS(appletCode, image, newWidth, newHeight);
-					closeFunction();
-				}
-			}
-		}
-		
-		finish();
-	});
-
-	wrs_opener.wrs_addEvent(document.getElementById('cancel'), 'click', function () {
-		closeFunction();
-	});
-});
-
-wrs_opener.wrs_addEvent(window, 'unload', function () {
-	wrs_opener.wrs_int_notifyWindowClosed();
-});

+ 0 - 713
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/core.js

@@ -1,713 +0,0 @@
-// Vars
-var _wrs_currentPath = window.location.toString().substr(0, window.location.toString().lastIndexOf('/') + 1);
-var _wrs_isNewElement = true;
-var _wrs_temporalImage;
-
-/**
- * Cross-browser addEventListener/attachEvent function.
- * @param object element Element target
- * @param event event Event
- * @param function func Function to run
- */
-function wrs_addEvent(element, event, func) {
-	if (element.addEventListener) {
-		element.addEventListener(event, func, false);
-	}
-	else if (element.attachEvent) {
-		element.attachEvent('on' + event, func);
-	}
-}
-
-/**
- * Adds iframe events.
- * @param object iframe Target
- * @param function doubleClickHandler Function to run when user double clicks the iframe
- * @param function mousedownHandler Function to run when user mousedowns the iframe
- * @param function mouseupHandler Function to run when user mouseups the iframe
- */
-function wrs_addIframeEvents(iframe, doubleClickHandler, mousedownHandler, mouseupHandler) {
-	if (doubleClickHandler) {
-		wrs_addEvent(iframe.contentWindow.document, 'dblclick', function (event) {
-			var realEvent = (event) ? event : window.event;
-			var element = realEvent.srcElement ? realEvent.srcElement : realEvent.target;
-			doubleClickHandler(iframe, element, realEvent);
-		});
-	}
-	
-	if (mousedownHandler) {
-		wrs_addEvent(iframe.contentWindow.document, 'mousedown', function (event) {
-			var realEvent = (event) ? event : window.event;
-			var element = realEvent.srcElement ? realEvent.srcElement : realEvent.target;
-			mousedownHandler(iframe, element, realEvent);
-		});
-	}
-	
-	if (mouseupHandler) {
-		wrs_addEvent(iframe.contentWindow.document, 'mouseup', function (event) {
-			var realEvent = (event) ? event : window.event;
-			var element = realEvent.srcElement ? realEvent.srcElement : realEvent.target;
-			mouseupHandler(iframe, element, realEvent);
-		});
-	}
-}
-
-/**
- * Adds textarea events.
- * @param object textarea Target
- * @param function clickHandler Function to run when user clicks the textarea.
- */
-function wrs_addTextareaEvents(textarea, clickHandler) {
-	if (clickHandler) {
-		wrs_addEvent(textarea, 'click', function (event) {
-			var realEvent = (event) ? event : window.event;
-			clickHandler(textarea, realEvent);
-		});
-	}
-}
-
-/**
- * Converts applet code to img object.
- * @param object creator Object with "createElement" method
- * @param string appletCode Applet code
- * @param string image Base 64 image stream
- * @param int imageWidth Image width
- * @param int imageHeight Image height
- * @return object
- */
-function wrs_appletCodeToImgObject(creator, appletCode, image, imageWidth, imageHeight) {
-	var imageSrc = wrs_createImageCASSrc(image);
-	var imgObject = creator.createElement('img');
-	imgObject.title = 'Double click to edit';
-	imgObject.src = imageSrc;
-	imgObject.align = 'middle';
-	imgObject.width = imageWidth;
-	imgObject.height = imageHeight;
-	imgObject.setAttribute(_wrs_conf_CASMathmlAttribute, wrs_mathmlEncode(appletCode));
-	imgObject.className = 'Wiriscas';
-	
-	return imgObject;
-}
-
-/**
- * Checks if an element contains a class.
- * @param object element
- * @param string className
- * @return bool
- */
-function wrs_containsClass(element, className) {
-	var currentClasses = element.className.split(' ');
-	
-	for (var i = currentClasses.length - 1; i >= 0; --i) {
-		if (currentClasses[i] == className) {
-			return true;
-		}
-	}
-	
-	return false;
-}
-
-/**
- * Cross-browser solution for creating new elements.
- * 
- * It fixes some browser bugs.
- *
- * @param string elementName The tag name of the wished element.
- * @param object attributes An object where each key is a wished attribute name and each value is its value.
- * @param object creator Optional param. If supplied, this function will use the "createElement" method from this param. Else, "document" will be used.
- * @return object The DOM element with the specified attributes assignated.
- */
-function wrs_createElement(elementName, attributes, creator) {
-	if (attributes === undefined) {
-		attributes = {};
-	}
-	
-	if (creator === undefined) {
-		creator = document;
-	}
-	
-	var element;
-	
-	/*
-	 * Internet Explorer fix:
-	 * If you create a new object dynamically, you can't set a non-standard attribute.
-	 * For example, you can't set the "src" attribute on an "applet" object.
-	 * Other browsers will throw an exception and will run the standard code.
-	 */
-	
-	try {
-		var html = '<' + elementName + ' ';
-		
-		for (var attributeName in attributes) {
-			html += attributeName + '="' + wrs_htmlentities(attributes[attributeName]) + '" ';
-		}
-		
-		html += '>';
-		element = creator.createElement(html);
-	}
-	catch (e) {
-		element = creator.createElement(elementName);
-		
-		for (var attributeName in attributes) {
-			element.setAttribute(attributeName, attributes[attributeName]);
-		}
-	}
-	
-	return element;
-}
-
-/**
- * Cross-browser httpRequest creation.
- * @return object
- */
-function wrs_createHttpRequest() {
-	if (typeof XMLHttpRequest != 'undefined') {
-		return new XMLHttpRequest();
-	}
-			
-	try {
-		return new ActiveXObject('Msxml2.XMLHTTP');
-	}
-	catch (e) {
-		try {
-			return new ActiveXObject('Microsoft.XMLHTTP');
-		}
-		catch (oc) {
-		}
-	}
-	
-	return false;
-}
-
-/**
- * Gets CAS image src with AJAX.
- * @param string image Base 64 image stream
- * @return string
- */
-function wrs_createImageCASSrc(image, appletCode) {
-	var httpRequest = wrs_createHttpRequest();
-	
-	if (httpRequest) {
-		var data = 'image=' + wrs_urlencode(image);
-		
-		if (appletCode) {
-			data += '&mml=' + wrs_urlencode(appletCode);
-		}
-		
-		if (_wrs_conf_createcasimagePath.substr(0, 1) == '/' || _wrs_conf_createcasimagePath.substr(0, 7) == 'http://' || _wrs_conf_createimagePath.substr(0, 8) == 'https://') {
-			httpRequest.open('POST', _wrs_conf_createcasimagePath, false);
-		}
-		else {
-			httpRequest.open('POST', _wrs_currentPath + _wrs_conf_createcasimagePath, false);
-		}
-		
-		httpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
-		httpRequest.send(data);
-		
-		return httpRequest.responseText;
-	}
-	
-	alert('Your browser is not compatible with AJAX technology. Please, use the latest version of Mozilla Firefox.');
-	return '';
-}
-
-/**
- * Gets formula image src with AJAX.
- * @param mathml Mathml code
- * @param wirisProperties
- * @return string Image src
- */
-function wrs_createImageSrc(mathml, wirisProperties) {
-	var httpRequest = wrs_createHttpRequest();
-	
-	if (httpRequest) {
-		var data = (wirisProperties) ? wirisProperties : {};
-		data['mml'] = mathml;
-		
-		if (window._wrs_conf_useDigestInsteadOfMathml && _wrs_conf_useDigestInsteadOfMathml) {
-			data['returnDigest'] = 'true';
-		}
-		
-		if (_wrs_conf_createimagePath.substr(0, 1) == '/' || _wrs_conf_createimagePath.substr(0, 7) == 'http://' || _wrs_conf_createimagePath.substr(0, 8) == 'https://') {
-			httpRequest.open('POST', _wrs_conf_createimagePath, false);
-		}
-		else {
-			httpRequest.open('POST', _wrs_currentPath + _wrs_conf_createimagePath, false);
-		}
-		
-		httpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
-		httpRequest.send(wrs_httpBuildQuery(data));
-		
-		return httpRequest.responseText;
-	}
-	
-	alert('Your browser is not compatible with AJAX technology. Please, use the latest version of Mozilla Firefox.');
-	return '';
-}
-
-/**
- * Creates new object using its html code.
- * @param string objectCode
- * @return object
- */
-function wrs_createObject(objectCode, creator) {
-	if (creator === undefined) {
-		creator = document;
-	}
-
-	// Internet Explorer can't include "param" tag when is setting an innerHTML property.
-	objectCode = objectCode.split('<applet ').join('<span wirisObject="WirisApplet" ').split('<APPLET ').join('<span wirisObject="WirisApplet" ');	// It is a 'span' because 'span' objects can contain 'br' nodes.
-	objectCode = objectCode.split('</applet>').join('</span>').split('</APPLET>').join('</span>');
-	
-	objectCode = objectCode.split('<param ').join('<br wirisObject="WirisParam" ').split('<PARAM ').join('<br wirisObject="WirisParam" ');			// It is a 'br' because 'br' can't contain nodes.
-	objectCode = objectCode.split('</param>').join('</br>').split('</PARAM>').join('</br>');
-	
-	var container = wrs_createElement('div', {}, creator);
-	container.innerHTML = objectCode;
-	
-	function recursiveParamsFix(object) {
-		if (object.getAttribute && object.getAttribute('wirisObject') == 'WirisParam') {
-			var attributesParsed = {};
-			
-			for (var i = 0; i < object.attributes.length; ++i) {
-				if (object.attributes[i].nodeValue !== null) {
-					attributesParsed[object.attributes[i].nodeName] = object.attributes[i].nodeValue;
-				}
-			}
-			
-			var param = wrs_createElement('param', attributesParsed, creator);
-			
-			// IE fix
-			if (param.NAME) {
-				param.name = param.NAME;
-				param.value = param.VALUE;
-			}
-			
-			param.removeAttribute('wirisObject');
-			object.parentNode.replaceChild(param, object);
-		}
-		else if (object.getAttribute && object.getAttribute('wirisObject') == 'WirisApplet') {
-			var attributesParsed = {};
-			
-			for (var i = 0; i < object.attributes.length; ++i) {
-				if (object.attributes[i].nodeValue !== null) {
-					attributesParsed[object.attributes[i].nodeName] = object.attributes[i].nodeValue;
-				}
-			}
-			
-			var applet = wrs_createElement('applet', attributesParsed, creator);
-			applet.removeAttribute('wirisObject');
-			
-			for (var i = 0; i < object.childNodes.length; ++i) {
-				recursiveParamsFix(object.childNodes[i]);
-
-				if (object.childNodes[i].nodeName.toLowerCase() == 'param') {
-					applet.appendChild(object.childNodes[i]);
-					--i;	// When we insert the object child into the applet, object loses one child.
-				}
-			}
-
-			object.parentNode.replaceChild(applet, object);
-		}
-		else {
-			for (var i = 0; i < object.childNodes.length; ++i) {
-				recursiveParamsFix(object.childNodes[i]);
-			}
-		}
-	}
-	
-	recursiveParamsFix(container);
-	return container.firstChild;
-}
-
-/**
- * Converts an object to its HTML code.
- * @param object object
- * @return string
- */
-function wrs_createObjectCode(object, creator) {
-	if (creator === undefined) {
-		creator = document;
-	}
-	
-	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);
-	return toReturn;
-}
-
-/**
- * Parses end HTML code, converts CAS images to CAS applets.
- * @param string code
- * @return string
- */
-function wrs_endParse(code) {
-	var containerCode = '<div>' + code + '</div>';
-	var container = wrs_createObject(containerCode);
-	var imgList = container.getElementsByTagName('img');
-	
-	for (var i = 0; i < imgList.length; ++i) {
-		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);
-			
-			imgList[i].parentNode.replaceChild(appletObject, imgList[i]);
-			--i;		// One image has been deleted.
-		}
-	}
-
-	return container.innerHTML;
-}
-
-/**
- * Gets the formula mathml or CAS appletCode using its image hash code.
- * @param string variableName Variable to send on POST query to the server.
- * @param string imageHashCode
- * @return string
- */
-function wrs_getCode(variableName, imageHashCode) {
-	var data = wrs_urlencode(variableName) + '=' + imageHashCode;
-	var httpRequest = wrs_createHttpRequest();
-	
-	if (httpRequest) {
-		if (_wrs_conf_getmathmlPath.substr(0, 1) == '/' || _wrs_conf_getmathmlPath.substr(0, 7) == 'http://' || _wrs_conf_getmathmlPath.substr(0, 8) == 'https://') {
-			httpRequest.open('POST', _wrs_conf_getmathmlPath, false);
-		}
-		else {
-			httpRequest.open('POST', _wrs_currentPath + _wrs_conf_getmathmlPath, false);
-		}
-		
-		httpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
-		httpRequest.send(data);
-		return httpRequest.responseText;
-	}
-	
-	alert('Your browser is not compatible with AJAX technology. Please, use the latest version of Mozilla Firefox.');
-	return '';
-}
-
-/**
- * Parses a text and replaces all HTML special characters by their entities.
- * @param string input
- * @return string
- */
-function wrs_htmlentities(input) {
-    var container = document.createElement('span');
-    var text = document.createTextNode(input);
-    container.appendChild(text);
-    return container.innerHTML.split('"').join('&quot;');
-}
-
-/**
- * Converts a hash to a HTTP query.
- * @param hash properties
- * @return string
- */
-function wrs_httpBuildQuery(properties) {
-	var result = '';
-	
-	for (i in properties) {
-		if (properties[i] != null) {
-			result += wrs_urlencode(i) + '=' + wrs_urlencode(properties[i]) + '&';
-		}
-	}
-	
-	return result;
-}
-
-/**
- * Parses initial HTML code, converts CAS applets to CAS images.
- * @param string code
- * @return string
- */
-function wrs_initParse(code) {
-	var containerCode = '<div>' + code + '</div>';
-	var container = wrs_createObject(containerCode);
-	var appletList = container.getElementsByTagName('applet');
-	
-	for (var i = 0; i < appletList.length; ++i) {
-		if (appletList[i].className == 'Wiriscas' || appletList[i].getAttribute('class') == 'Wiriscas') {		// Internet Explorer can't read className correctly
-			var imgObject = wrs_createElement('img');
-			imgObject.title = 'Double click to edit';
-			imgObject.src = appletList[i].getAttribute('src');
-			imgObject.align = 'middle';
-			
-			var appletCode = wrs_createObjectCode(appletList[i]);
-			imgObject.setAttribute(_wrs_conf_CASMathmlAttribute, wrs_mathmlEncode(appletCode));
-			imgObject.className = 'Wiriscas';
-			
-			appletList[i].parentNode.replaceChild(imgObject, appletList[i]);
-			--i;		// we have deleted one sleeped applet
-		}
-	}
-	
-	return container.innerHTML;
-}
-
-/**
- * WIRIS special encoding.
- *  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
-	
-	// We are replacing $ by & for retrocompatibility. Now, the standard is replace § by &
-	input = input.split('$').join('&');
-	
-	return input;
-}
-
-/**
- * WIRIS special encoding.
- *  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
-	
-	return input;
-}
-
-/**
- * Converts special symbols (> 128) to entities.
- * @param string mathml
- * @return string
- */
-function wrs_mathmlEntities(mathml) {
-	var toReturn = '';
-	
-	for (var i = 0; i < mathml.length; ++i) {
-		//parsing > 128 characters
-		if (mathml.charCodeAt(i) > 128) {
-			toReturn += '&#' + mathml.charCodeAt(i) + ';';
-		}
-		else {
-			toReturn += mathml.charAt(i);
-		}
-	}
-	
-	return toReturn;
-}
-
-/**
- * Converts mathml to img object.
- * @param object creator Object with "createElement" method
- * @param string mathml Mathml code
- * @return object
- */
-function wrs_mathmlToImgObject(creator, mathml, wirisProperties) {
-	var imgObject = creator.createElement('img');
-	imgObject.title = 'Double click to edit';
-	imgObject.align = 'middle';
-	imgObject.className = 'Wirisformula';
-	
-	var result = wrs_createImageSrc(mathml, wirisProperties);
-	
-	if (window._wrs_conf_useDigestInsteadOfMathml && _wrs_conf_useDigestInsteadOfMathml) {
-		var parts = result.split(':', 2);
-		imgObject.setAttribute(_wrs_conf_imageMathmlAttribute, parts[0]);
-		imgObject.src = parts[1];
-	}
-	else {
-		imgObject.setAttribute(_wrs_conf_imageMathmlAttribute, wrs_mathmlEncode(mathml));
-		imgObject.src = result;
-	}
-	
-	return imgObject;
-}
-
-/**
- * Cross-browser removeEventListener/detachEvent function.
- * @param object element Element target
- * @param event event Event
- * @param function func Function to run
- */
-function wrs_removeEvent(element, event, func) {
-	if (element.removeEventListener) {
-		element.removeEventListener(event, func, false);
-	}
-	else if (element.detachEvent) {
-		element.detachEvent('on' + event, func);
-	}
-}
-
-/**
- * Inserts or modifies CAS on an iframe.
- * @param object iframe Target
- * @param string appletCode Applet code
- * @param string image Base 64 image stream
- * @param int imageWidth Image width
- * @param int imageHeight Image height
- */
-function wrs_updateCAS(iframe, appletCode, image, imageWidth, imageHeight) {
-	try {
-		if (iframe && appletCode) {
-			iframe.contentWindow.focus();
-			var imgObject = wrs_appletCodeToImgObject(iframe.contentWindow.document, appletCode, image, imageWidth, imageHeight);
-			
-			if (_wrs_isNewElement) {
-				if (document.selection) {
-					var range = iframe.contentWindow.document.selection.createRange();
-					
-					iframe.contentWindow.document.execCommand('insertimage', false, imgObject.src);
-
-					if (range.parentElement) {
-						var temporalImg = range.parentElement();
-						temporalImg.parentNode.insertBefore(imgObject, temporalImg);
-						temporalImg.parentNode.removeChild(temporalImg);
-					}
-				}
-				else {
-					var sel = iframe.contentWindow.getSelection();
-					try {
-						var range = sel.getRangeAt(0);
-					}
-					catch (e) {
-						var range = iframe.contentWindow.document.createRange();
-					}
-					
-					sel.removeAllRanges();
-					range.deleteContents();
-					
-					var node = range.startContainer;
-					var pos = range.startOffset;
-					
-					if (node.nodeType == 3) {
-						node = node.splitText(pos);
-						node.parentNode.insertBefore(imgObject, node);
-					}
-					else if (node.nodeType == 1) {
-						node.insertBefore(imgObject, node.childNodes[pos]);
-					}
-				}
-			}
-			else {
-				_wrs_temporalImage.parentNode.insertBefore(imgObject, _wrs_temporalImage);
-				_wrs_temporalImage.parentNode.removeChild(_wrs_temporalImage);
-			}
-		}
-	}
-	catch (e) {
-	}
-}
-
-/**
- * Inserts or modifies formulas on an iframe.
- * @param object iframe Target
- * @param string mathml Mathml code
- */
-function wrs_updateFormula(iframe, mathml, wirisProperties) {
-	try {
-		if (iframe && mathml) {
-			iframe.contentWindow.focus();
-			var imgObject = wrs_mathmlToImgObject(iframe.contentWindow.document, mathml, wirisProperties);
-			
-			if (_wrs_isNewElement) {
-				if (document.selection) {
-					var range = iframe.contentWindow.document.selection.createRange();
-					iframe.contentWindow.document.execCommand('insertimage', false, imgObject.src);
-
-					if (range.parentElement) {
-						var temporalImg = range.parentElement();
-						temporalImg.parentNode.insertBefore(imgObject, temporalImg);
-						temporalImg.parentNode.removeChild(temporalImg);
-					}
-				}
-				else {
-					var selection = iframe.contentWindow.getSelection();
-					
-					try {
-						var range = selection.getRangeAt(0);						
-					}
-					catch (e) {
-						var range = iframe.contentWindow.document.createRange();
-					}
-					
-					selection.removeAllRanges();
-					range.deleteContents();
-				
-					var node = range.startContainer;
-					var pos = range.startOffset;
-					
-					if (node.nodeType == 3) {
-						node = node.splitText(pos);
-						node.parentNode.insertBefore(imgObject, node);
-					}
-					else if (node.nodeType == 1) {
-						node.insertBefore(imgObject, node.childNodes[pos]);
-					}
-				}
-			}
-			else {
-				_wrs_temporalImage.parentNode.insertBefore(imgObject, _wrs_temporalImage);
-				_wrs_temporalImage.parentNode.removeChild(_wrs_temporalImage);
-			}
-		}
-	}
-	catch (e) {
-	}
-}
-
-/**
- * Inserts or modifies formulas or CAS on a textarea.
- * @param object textarea Target
- * @param string text Text to add in the textarea. For example, if you want to add the link to the image, you can call this function as wrs_updateTextarea(textarea, wrs_createImageSrc(mathml));
- */
-function wrs_updateTextarea(textarea, text) {
-	if (textarea && text) {
-		textarea.focus();
-		
-		if (textarea.selectionStart != null) {
-			textarea.value = textarea.value.substring(0, textarea.selectionStart) + text + textarea.value.substring(textarea.selectionEnd, textarea.value.length);
-		}
-		else {
-			var selection = document.selection.createRange();
-			selection.text = text;
-		}
-	}
-}
-
-/**
- * URL encode function
- * @param string clearString Input 
- * @return string
- */
-function wrs_urlencode(clearString) {
-	var output = '';
-	var x = 0;
-	clearString = clearString.toString();
-	var regex = /(^[a-zA-Z0-9_.]*)/;
-	
-	var clearString_length = ((typeof clearString.length) == 'function') ? clearString.length() : clearString.length;
-
-	while (x < clearString_length) {
-		var match = regex.exec(clearString.substr(x));
-		if (match != null && match.length > 1 && match[1] != '') {
-			output += match[1];
-			x += match[1].length;
-		}
-		else {
-			var charCode = clearString.charCodeAt(x);
-			var hexVal = charCode.toString(16);
-			output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
-			++x;
-		}
-	}
-	
-	return output;
-}

+ 0 - 94
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/editor.js

@@ -1,94 +0,0 @@
-var wrs_int_opener;
-var closeFunction;
-
-if (window.opener) {							// For popup mode
-	wrs_int_opener = window.opener;
-	closeFunction = window.close;
-}
-/* FCKeditor integration begin */
-else {											// For iframe mode
-	wrs_int_opener = window.parent;
-	
-	while (wrs_int_opener.InnerDialogLoaded) {
-		wrs_int_opener = wrs_int_opener.parent;
-	}
-}
-
-if (window.parent.InnerDialogLoaded) {			// iframe mode
-	window.parent.InnerDialogLoaded();
-	closeFunction = window.parent.Cancel;
-}
-else if (window.opener.parent.FCKeditorAPI) {	// popup mode
-	wrs_int_opener = window.opener.parent;
-}
-/* FCKeditor integration end */
-
-wrs_int_opener.wrs_addEvent(window, 'load', function () {
-	var applet = document.getElementById('applet');
-	
-	// Mathml content
-	if (!wrs_int_opener._wrs_isNewElement) {
-		var mathml;
-		
-		if (wrs_int_opener._wrs_conf_useDigestInsteadOfMathml) {
-			mathml = wrs_int_opener.wrs_getCode(wrs_int_opener._wrs_conf_digestPostVariable, wrs_int_opener._wrs_temporalImage.getAttribute(wrs_int_opener._wrs_conf_imageMathmlAttribute));
-		}
-		else {
-			mathml = wrs_int_opener.wrs_mathmlDecode(wrs_int_opener._wrs_temporalImage.getAttribute(wrs_int_opener._wrs_conf_imageMathmlAttribute));
-		}
-		
-		function setAppletMathml() {
-			// Internet explorer fails on "applet.isActive". It only supports "applet.isActive()"
-			try {
-				if (applet.isActive && applet.isActive()) {
-					applet.setContent(mathml);
-				}
-				else {
-					setTimeout(setAppletMathml, 50);
-				}
-			}
-			catch (e) {
-				if (applet.isActive()) {
-					applet.setContent(mathml);
-				}
-				else {
-					setTimeout(setAppletMathml, 50);
-				}
-			}
-		}
-
-		setAppletMathml();
-	}
-	
-	// Button events
-	wrs_int_opener.wrs_addEvent(document.getElementById('submit'), 'click', function () {
-		var mathml = '';
-		
-		if (!applet.isFormulaEmpty()) {
-			mathml += applet.getContent();							// if isn't empty, get mathml code to mathml variable
-			mathml = wrs_int_opener.wrs_mathmlEntities(mathml);		// Apply a parse
-		}
-		
-		/* FCKeditor integration begin */
-		if (window.parent.InnerDialogLoaded && window.parent.FCKBrowserInfo.IsIE) {			// On IE, we must close the dialog for push the caret on the correct position.
-			closeFunction();
-			wrs_int_opener.wrs_int_updateFormula(mathml);
-		}
-		/* FCKeditor integration end */
-		else {
-			if (wrs_int_opener.wrs_int_updateFormula) {
-				wrs_int_opener.wrs_int_updateFormula(mathml);
-			}
-			
-			closeFunction();
-		}
-	});
-	
-	wrs_int_opener.wrs_addEvent(document.getElementById('cancel'), 'click', function () {
-		closeFunction();
-	});
-});
-
-wrs_int_opener.wrs_addEvent(window, 'unload', function () {
-	wrs_int_opener.wrs_int_notifyWindowClosed();
-});

BIN
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/wiris-cas.gif


BIN
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/core/wiris-formula.gif


+ 0 - 334
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js

@@ -1,334 +0,0 @@
-/* FCKeditor configuration */
-parent._wrs_conf_usePopUps = false;
-parent._wrs_conf_editorWidth = 500;
-parent._wrs_conf_editorHeight = 500;
-parent._wrs_conf_CASWidth = 640;
-parent._wrs_conf_CASHeight = 580;
-
-/* Including core.js */
-var script = parent.document.createElement('script');
-script.type = 'text/javascript';
-script.src = FCKConfig.PluginsPath + 'fckeditor_wiris/core/core.js';
-parent.document.getElementsByTagName('head')[0].appendChild(script);
-
-/* Configuration */
-parent._wrs_conf_editorEnabled = true;		// Specifies if fomula editor is enabled
-parent._wrs_conf_CASEnabled = true;		// Specifies if WIRIS CAS is enabled
-
-parent._wrs_conf_imageMathmlAttribute = 'alt';	// Specifies the image tag where we should save the formula editor mathml code
-parent._wrs_conf_CASMathmlAttribute = 'alt';	// Specifies the image tag where we should save the WIRIS CAS mathml code
-
-parent._wrs_conf_editorPath = FCKConfig.PluginsPath + 'fckeditor_wiris/integration/editor.php';			// Specifies where is the editor HTML code (for popup window)
-parent._wrs_conf_editorAttributes = 'width=500, height=400, scroll=no, resizable=yes';						// Specifies formula editor window options
-parent._wrs_conf_CASPath = FCKConfig.PluginsPath + 'fckeditor_wiris/integration/cas.php';					// Specifies where is the WIRIS CAS HTML code (for popup window)
-parent._wrs_conf_CASAttributes = 'width=640, height=480, scroll=no, resizable=yes';						// Specifies WIRIS CAS window options
-
-parent._wrs_conf_useDigestInsteadOfMathml = false;
-//parent._wrs_conf_digestPostVariable = 'digest';
-parent._wrs_conf_createimagePath = FCKConfig.PluginsPath + 'fckeditor_wiris/integration/createimage.php';			// Specifies where is createimage script
-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
-
-/* 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';
-parent._wrs_int_temporalIframe;
-parent._wrs_int_temporalImageResizing;
-parent._wrs_int_wirisProperties;
-parent._wrs_int_window;
-parent._wrs_int_window_opened = false;
-parent._wrs_int_language = 'en';
-
-/* Plugin integration */
-
-function whenDocReady(editorInstance, status) {
-	if (status == FCK_STATUS_COMPLETE) {
-		if (parent.wrs_initParse) {
-			editorInstance.SetData(parent.wrs_initParse(editorInstance.GetData()));
-			parent.wrs_addIframeEvents(editorInstance.EditingArea.IFrame, null, wrs_int_mousedownHandler, wrs_int_mouseupHandler);
-		}
-		else {
-			setTimeout(function () {
-				whenDocReady(editorInstance, status);
-			}, 50);
-		}
-	}
-}
-
-FCK.Events.AttachEvent('OnStatusChange', whenDocReady);
-
-FCK.Events.AttachEvent('OnAfterLinkedFieldUpdate', function (editorInstance) {
-	var form = editorInstance.GetParentForm();
-	form[editorInstance.Name].value = parent.wrs_endParse(form[editorInstance.Name].value);
-});
-
-// FCKeditor disables WIRIS double click handlers. Using this method, we can handle it.
-FCK.RegisterDoubleClickHandler(function (element) {
-	wrs_int_doubleClickHandler(parent._wrs_int_temporalIframe, element);
-}, 'IMG');
-
-if (parent._wrs_conf_editorEnabled) {
-	var WIRISFormulaCommand = function () {
-	}
-
-	WIRISFormulaCommand.prototype = new FCKUndefinedCommand();
-
-	WIRISFormulaCommand.prototype.Execute = function () {
-		parent._wrs_int_wirisProperties = {
-			'bgColor': FCK.Config['wirisimagebgcolor'],
-			'symbolColor': FCK.Config['wirisimagesymbolcolor'],
-			'transparency': FCK.Config['wiristransparency'],
-			'fontSize': FCK.Config['wirisimagefontsize'],
-			'numberColor': FCK.Config['wirisimagenumbercolor'],
-			'identColor': FCK.Config['wirisimageidentcolor']
-		};
-		
-		wrs_int_openNewFormulaEditor(FCK.EditingArea.IFrame);
-	}
-		
-	FCKCommands.RegisterCommand(
-		'fckeditor_wiris_openFormulaEditor',
-		new WIRISFormulaCommand()
-	);
-	
-	FCKCommands.RegisterCommand(
-		'fckeditor_wiris_openFormulaEditor_aux',
-		new FCKDialogCommand(
-			'WIRIS Formula Editor',
-			'WIRIS Formula Editor',
-			parent._wrs_conf_editorPath,
-			500,
-			400
-		)
-	);
-	
-	var formulaItem = new FCKToolbarButton('fckeditor_wiris_openFormulaEditor', 'WIRIS Formula Editor');
-	formulaItem.IconPath = parent._wrs_int_editorIcon;
-
-	FCKToolbarItems.RegisterItem(
-		'fckeditor_wiris_openFormulaEditor',
-		formulaItem
-	);
-}
-
-if (parent._wrs_conf_CASEnabled) {
-	var WIRISCASCommand = function () {
-	}
-
-	WIRISCASCommand.prototype = new FCKUndefinedCommand();
-
-	WIRISCASCommand.prototype.Execute = function () {
-		parent._wrs_int_language = FCK.Language.GetActiveLanguage();
-		wrs_int_openNewCAS(FCK.EditingArea.IFrame);
-	}
-
-	FCKCommands.RegisterCommand(
-		'fckeditor_wiris_openCAS',
-		new WIRISCASCommand()
-	);
-
-	var casItem = new FCKToolbarButton('fckeditor_wiris_openCAS', 'WIRIS CAS');
-	casItem.IconPath = parent._wrs_int_CASIcon;
-
-	FCKToolbarItems.RegisterItem(
-		'fckeditor_wiris_openCAS',
-		casItem
-	);
-}
-
-/**
- * Opens formula editor.
- * @param object iframe Target
- */
-function wrs_int_openNewFormulaEditor(iframe) {
-	parent._wrs_isNewElement = true;
-	parent._wrs_int_temporalIframe = iframe;
-	
-	if (parent._wrs_conf_usePopUps) {
-		if (parent._wrs_int_window_opened) {
-			parent._wrs_int_window.focus();
-		}
-		else {
-			parent._wrs_int_window_opened = true;
-			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);
-		wrs_int_hidePopUpButtons();
-	}
-}
-
-/**
- * Opens CAS.
- * @param object iframe Target
- */
-function wrs_int_openNewCAS(iframe) {
-	parent._wrs_isNewElement = true;
-	parent._wrs_int_temporalIframe = iframe;
-	
-	if (parent._wrs_conf_usePopUps) {
-		if (parent._wrs_int_window_opened) {
-			parent._wrs_int_window.focus();
-		}
-		else {
-			parent._wrs_int_window_opened = true;
-			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);
-		wrs_int_hidePopUpButtons();
-	}
-}
-
-/**
- * Handles a double click on the iframe.
- * @param object iframe Target
- * @param object element Element double clicked
- */
-function wrs_int_doubleClickHandler(iframe, element) {
-	if (element.nodeName.toLowerCase() == 'img') {
-		if (parent.wrs_containsClass(element, 'Wirisformula')) {
-			if (!parent._wrs_int_window_opened) {
-				parent._wrs_int_wirisProperties = {
-					'bgColor': FCK.Config['wirisimagebgcolor'],
-					'symbolColor': FCK.Config['wirisimagesymbolcolor'],
-					'transparency': FCK.Config['wiristransparency'],
-					'fontSize': FCK.Config['wirisimagefontsize'],
-					'numberColor': FCK.Config['wirisimagenumbercolor'],
-					'identColor': FCK.Config['wirisimageidentcolor']
-				};
-				
-				parent._wrs_temporalImage = element;
-				wrs_int_openExistingFormulaEditor(iframe);
-			}
-			else {
-				parent._wrs_int_window.focus();
-			}
-		}
-		else if (parent.wrs_containsClass(element, 'Wiriscas')) {
-			if (!parent._wrs_int_window_opened) {
-				parent._wrs_temporalImage = element;
-				wrs_int_openExistingCAS(iframe);
-			}
-			else {
-				parent._wrs_int_window.focus();
-			}
-		}
-	}
-}
-
-/**
- * Opens formula editor to edit an existing formula.
- * @param object iframe Target
- */
-function wrs_int_openExistingFormulaEditor(iframe) {
-	parent._wrs_isNewElement = false;
-	parent._wrs_int_temporalIframe = iframe;
-	
-	if (parent._wrs_conf_usePopUps) {
-		parent._wrs_int_window_opened = true;
-		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);	
-		wrs_int_hidePopUpButtons();
-	}
-}
-
-/**
- * Opens CAS to edit an existing formula.
- * @param object iframe Target
- */
-function wrs_int_openExistingCAS(iframe) {
-	parent._wrs_isNewElement = false;
-	parent._wrs_int_temporalIframe = iframe;
-	
-	if (parent._wrs_conf_usePopUps) {
-		parent._wrs_int_window_opened = true;
-		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);
-		wrs_int_hidePopUpButtons();
-	}
-}
-
-/**
- * Handles a mouse down event on the iframe.
- * @param object iframe Target
- * @param object element Element mouse downed
- */
-function wrs_int_mousedownHandler(iframe, element) {
-	parent._wrs_int_temporalIframe = iframe;	// This allows to recognize de iframe for double click events.
-	
-	if (element.nodeName.toLowerCase() == 'img') {
-		if (parent.wrs_containsClass(element, 'Wirisformula') || parent.wrs_containsClass(element, 'Wiriscas')) {
-			parent._wrs_int_temporalImageResizing = element;
-		}
-	}
-}
-
-/**
- * Handles a mouse up event on the iframe.
- */
-function wrs_int_mouseupHandler() {
-	if (parent._wrs_int_temporalImageResizing) {
-		setTimeout(function () {
-			parent._wrs_int_temporalImageResizing.removeAttribute('style');
-			parent._wrs_int_temporalImageResizing.removeAttribute('width');
-			parent._wrs_int_temporalImageResizing.removeAttribute('height');
-		}, 10);
-	}
-}
-
-/**
- * Calls wrs_updateFormula with well params.
- * @param string mathml
- */
-parent.wrs_int_updateFormula = function (mathml) {								// We need instance this function on parent object because core/editor.js only can access to the parent object.
-	parent.wrs_updateFormula(parent._wrs_int_temporalIframe, mathml, parent._wrs_int_wirisProperties);
-}
-
-/**
- * Calls wrs_updateCAS with well params.
- * @param string appletCode
- * @param string image
- * @param int width
- * @param int height
- */
-parent.wrs_int_updateCAS = function (appletCode, image, width, height) {		// We need instance this function on parent object because core/cas.js only can access to the parent object.
-	parent.wrs_updateCAS(parent._wrs_int_temporalIframe, appletCode, image, width, height);
-}
-
-/**
- * Handles window closing.
- */
-parent.wrs_int_notifyWindowClosed = function () {								// We need instance this function on parent object because core/editor.js only can access to the parent object.
-	parent._wrs_int_window_opened = false;
-}
-
-/*
- * Hiddes popup buttons.
- */
-function wrs_int_hidePopUpButtons() {
-	var cover = FCKDialog.GetCover();
-	
-	if (cover) {
-		function hideCancelButton() {
-			var button = cover.nextSibling.contentWindow.document.getElementById('btnCancel');
-			
-			if (button) {
-				//button.style.visibility = 'hidden';				// It runs on Firefox, but on IE it causes an unknown error. The ugly solution above works well:
-				button.style.position = 'absolute';
-				button.style.top = '1000px';
-			}
-			else {
-				setTimeout(hideCancelButton, 50);
-			}
-		}
-		
-		hideCancelButton();
-	}
-}

+ 0 - 94
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/cas.php

@@ -1,94 +0,0 @@
-<?php
-include 'libwiris.php';
-$config = wrs_loadConfig(WRS_CONFIG_FILE);
-$availableLanguages = wrs_getAvailableCASLanguages($config['wiriscaslanguages']);
-
-if (isset($_GET['mode']) && $_GET['mode'] == 'applet') {
-	if (isset($_GET['lang']) && in_array($_GET['lang'], $availableLanguages)) {
-		$language = $_GET['lang'];
-	}
-	else {
-		$language = $availableLanguages[0];
-	}
-	
-	$codebase = wrs_replaceVariable($config['wiriscascodebase'], 'LANG', $language);
-	$archive = wrs_replaceVariable($config['wiriscasarchive'], 'LANG', $language);
-	$className = wrs_replaceVariable($config['wiriscasclass'], 'LANG', $language);
-	
-	?>
-	<html>
-		<head>
-			<style type="text/css">
-				/*<!--*/
-				body {
-					overflow: hidden;		// Hide scrollbars
-				}
-				/*-->*/
-			</style>
-		</head>
-		<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
-			<applet id="applet" alt="WIRIS CAS" codebase="<?php echo htmlentities($codebase, ENT_QUOTES, 'UTF-8'); ?>" archive="<?php echo htmlentities($archive, ENT_QUOTES, 'UTF-8'); ?>" code="<?php echo htmlentities($className, ENT_QUOTES, 'UTF-8'); ?>" width="100%" height="100%">
-				<p>You need JAVA&reg; to use WIRIS tools.<br />FREE download from <a target="_blank" href="http://www.java.com">www.java.com</a></p>
-			</applet>
-		</body>
-	</html>
-	<?php
-}
-else {
-	?>
-	<html>
-		<head>
-			<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-			<script type="text/javascript" src="../core/cas.js"></script>
-			<title>WIRIS CAS</title>
-			
-			<style type="text/css">
-				/*<!--*/
-				body {
-					overflow: hidden;		// Hide scrollbars
-				}
-				/*-->*/
-			</style>
-		</head>
-		<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
-			<form id="optionForm">
-				<table height="100%" width="100%">
-					<tr>
-						<td id="appletContainer" colspan="5"></td>
-					</tr>
-					<tr height="1px">
-						<td>Width</td>
-						<td><input name="width" type="text" value="<?php echo $config['CAS_width']; ?>"/></td>					
-						<td><input name="executeonload" type="checkbox"/> Calculate on load</td>
-						<td><input name="toolbar" type="checkbox"/> Show toolbar</td><!--Chamilo delete default checked -->
-						<!-- -->
-						<td>
-							Language
-							
-							<select id="languageList">
-								<?php
-								foreach ($availableLanguages as $language) {
-									$language = htmlentities($language, ENT_QUOTES, 'UTF-8');
-									echo '<option value="', $language, '">', $language, '</option>';
-								}
-								?>
-							</select>
-						</td>
-					</tr>
-					<tr height="1px">
-						<td>Height</td>
-						<td><input name="height" type="text" value="<?php echo $config['CAS_height']; ?>"/></td>
-						<td><input name="focusonload" type="checkbox"/> Focus on load</td>
-						<td><input name="level" type="checkbox"/> Elementary mode</td>
-						<td></td>
-					</tr>
-					<tr height="1px">
-						<td colspan="5"><input id="submit" value="Accept" type="button"/> <input id="cancel" value="Cancel" type="button"/></td>
-					</tr>
-				</table>
-			</form>
-		</body>
-	</html>
-	<?php
-}
-?>

+ 0 - 32
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createcasimage.php

@@ -1,32 +0,0 @@
-<?php
-include 'libwiris.php';
-
-$currentPath = dirname($_SERVER['PHP_SELF']) . '/';
-
-if (isset($_POST['image'])) {
-	$fileName = md5($_POST['image']);
-	$formulaPath = WRS_FORMULA_DIRECTORY . '/' . $fileName . '.xml';
-	
-	if (isset($_POST['mml']) && !is_file($formulaPath)) {
-		file_put_contents($formulaPath, $_POST['mml']);
-	}
-	
-	$url = $currentPath . 'showcasimage.php?formula=' . $fileName . '.png';
-	$imagePath = WRS_CACHE_DIRECTORY . '/' . $fileName . '.png';
-	
-	if (!is_file($imagePath)) {
-		if (file_put_contents($imagePath, base64_decode($_POST['image'])) !== false) {
-			echo $url;
-		}
-		else {
-			echo $currentPath . '../core/cas.gif';
-		}
-	}
-	else {
-		echo $url;
-	}
-}
-else {
-	echo $currentPath . '../core/cas.gif';
-}
-?>

+ 0 - 56
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/createimage.php

@@ -1,56 +0,0 @@
-<?php
-include 'libwiris.php';
-
-if (!empty($_POST['mml'])) {
-	$toSave = $_POST['mml'] . "\n";
-	
-	$config = wrs_loadConfig(WRS_CONFIG_FILE);
-	global $wrs_imageConfigProperties, $wrs_xmlFileAttributes;
-	
-	foreach ($wrs_xmlFileAttributes as $serverParam) {
-		$configKey = $wrs_imageConfigProperties[$serverParam];
-		
-		if (isset($_POST[$serverParam])) {
-			$config[$configKey] = $_POST[$serverParam];
-		}
-		
-		if (isset($config[$configKey])) {
-			$toSave .= $config[$configKey] . "\n";
-		}
-		else {
-			$toSave .= "\n";
-		}
-	}
-	
-	if (isset($config['wirisimagefontranges'])) {
-		$fontRanges = explode(',', $config['wirisimagefontranges']);
-		
-		foreach ($fontRanges as $fontRangeName) {
-			$fontRangeName = trim($fontRangeName);
-			
-			if (isset($config[$fontRangeName])) {
-				$toSave .= $config[$fontRangeName] . "\n";
-			}
-		}
-	}
-	
-	$fileName = md5($toSave);
-	$url = dirname($_SERVER['PHP_SELF']) . '/showimage.php?formula=' . $fileName . '.png';
-	$filePath = WRS_FORMULA_DIRECTORY . '/' . $fileName . '.xml';
-	
-	if (!is_file($filePath)) {
-		if (file_put_contents($filePath, $toSave) !== false) {
-			echo (isset($_POST['returnDigest']) && $_POST['returnDigest'] != 'false') ? $fileName . ':' . $url : $url;
-		}
-		else {
-			echo 'Error: can not create the image. Check your file privileges.';
-		}
-	}
-	else {
-		echo (isset($_POST['returnDigest']) && $_POST['returnDigest'] != 'false') ? $fileName . ':' . $url : $url;
-	}
-}
-else {
-	echo 'Error: no mathml has been sended.';
-}
-?>

+ 0 - 72
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/editor.php

@@ -1,72 +0,0 @@
-<?php
-include 'libwiris.php';
-$config = wrs_loadConfig(WRS_CONFIG_FILE);
-?>
-<html>
-	<head>
-		<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-		<script type="text/javascript" src="../core/editor.js"></script>
-		<title>WIRIS Formula Editor</title>
-		
-		<style type="text/css">
-			/*<!--*/
-			
-			#manualLink {
-				float: right;
-				margin-right: 20px;
-			}
-			
-			/*-->*/
-		</style>
-	</head>
-	<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
-		<table width="100%" height="100%">
-			<tr height="100%">
-				<td>
-					<applet id="applet" codebase="<?php echo $config['wirisformulaeditorcodebase']; ?>" archive="<?php echo $config['wirisformulaeditorarchive']; ?>" code="<?php echo $config['wirisformulaeditorcode']; ?>" height="100%" width="100%">
-						<param name="menuBar" value="false"/>
-						
-						<?php
-						$params = array(
-							'lang' => 'wirisformulaeditorlang',
-							'identMathvariant' => 'wirisimageidentmathvariant',
-							'numberMathvariant' => 'wirisimagenumbermathvariant',
-							'fontIdent' => 'wirisimagefontident',
-							'fontNumber' => 'wirisimagefontnumber',
-							'version' => 'wirisimageserviceversion'
-						);
-						
-						foreach ($params as $key => $value) {
-							if (isset($config[$value])) {
-								echo '<param name="' . $key . '" value="' . $config[$value] . '" />';
-							}
-						}
-						
-						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 '<param name="font' . $i . '" value="' . $config[$fontRangeName] . '" />';
-								}
-							}
-						}
-						?>
-						
-						<p>You need JAVA&reg; to use WIRIS tools.<br />FREE download from <a target="_blank" href="http://www.java.com">www.java.com</a></p>
-					</applet>
-				</td>
-			</tr>
-			<tr>
-				<td>
-					<a id="manualLink" href="http://www.wiris.com/portal/docs/editor-manual" target="_blank">Manual &gt;&gt;</a>
-					<input type="button" id="submit" value="Accept" />
-					<input type="button" id="cancel" value="Cancel" />
-				</td>
-			</tr>
-		</table>
-	</body>
-</html>

+ 0 - 34
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/getmathml.php

@@ -1,34 +0,0 @@
-<?php
-include 'libwiris.php';
-$digest = NULL;
-
-if (isset($_POST['md5']) && mb_strlen($_POST['md5']) == 32) {		// Support for "generic simple" integration.
-	$digest = $_POST['md5'];
-}
-else if (isset($_POST['digest'])) {		// Support for future integrations (where maybe they aren't using md5 sums).
-	$digest = $_POST['digest'];
-}
-
-if (!is_null($digest)) {
-	$filePath = WRS_FORMULA_DIRECTORY . '/' . basename($digest) . '.xml';
-	
-	if (is_file($filePath)) {
-		if (($handle = fopen($filePath, 'r')) !== false) {
-			if (($line = fgets($handle)) !== false) {
-				echo $line;
-			}
-			
-			fclose($handle);
-		}
-		else {
-			echo 'Error: can not read the formula. Check your file privileges.';
-		}
-	}
-	else {
-		echo 'Error: formula does not exists.';
-	}
-}
-else {
-	echo 'Error: no digest has been sended.';
-}
-?>

+ 0 - 93
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/libwiris.php

@@ -1,93 +0,0 @@
-<?php
-define('WRS_CONFIG_FILE', '../configuration.ini');
-define('WRS_CACHE_DIRECTORY', '../cache');
-define('WRS_FORMULA_DIRECTORY', '../formulas');
-
-global $wrs_imageConfigProperties, $wrs_xmlFileAttributes;
-
-$wrs_imageConfigProperties = array(
-	'bgColor' => '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);
-}
-?>

+ 0 - 20
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/showcasimage.php

@@ -1,20 +0,0 @@
-<?php
-include 'libwiris.php';
-
-if (empty($_GET['formula'])) {
-	echo 'Error: no image name has been sended.';
-}
-else {
-	$formula = basename($_GET['formula']);
-	$filePath = WRS_CACHE_DIRECTORY . '/' . $formula;
-	
-	if (is_file($filePath)) {
-		header('Content-Type: image/png');
-		readfile($filePath);
-	}
-	else {
-		header('Content-Type: image/gif');
-		readfile('../core/cas.gif');
-	}
-}
-?>

+ 0 - 100
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/integration/showimage.php

@@ -1,100 +0,0 @@
-<?php
-include 'libwiris.php';
-
-function createImage($config, $formulaPath, $imagePath) {
-	if (is_file($formulaPath) && ($handle = fopen($formulaPath, 'r')) !== false) {
-		$fonts = array();
-		
-		if (($line = fgets($handle)) !== false) {
-			$mathml = trim($line);
-			global $wrs_imageConfigProperties, $wrs_xmlFileAttributes;
-			$i = 0;
-			$wrs_xmlFileAttributesCount = count($wrs_xmlFileAttributes);
-			
-			while (($line = fgets($handle)) !== false && $i < $wrs_xmlFileAttributesCount) {
-				$config[$wrs_imageConfigProperties[$wrs_xmlFileAttributes[$i]]] = trim($line);
-				++$i;
-			}
-			
-			$i = 0;
-			
-			while (($line = fgets($handle)) !== false) {
-				$line = trim($line);
-				
-				if (isset($line[0])) {
-					$fonts['font' . $i] = $line;
-					++$i;
-				}
-			}
-		}
-		else {
-			$mathml = '';
-		}
-		
-		fclose($handle);
-		
-		// Retrocompatibility: when wirisimagenumbercolor is not defined
-		
-		if (!isset($config['wirisimagenumbercolor']) && isset($config['wirisimagesymbolcolor'])) {
-			$config['wirisimagenumbercolor'] = $config['wirisimagesymbolcolor'];
-		}
-		
-		// Retrocompatibility: when wirisimageidentcolor is not defined
-		
-		if (!isset($config['wirisimageidentcolor']) && isset($config['wirisimagesymbolcolor'])) {
-			$config['wirisimageidentcolor'] = $config['wirisimagesymbolcolor'];
-		}
-		
-		$properties = array('mml' => $mathml);
-		
-		foreach ($wrs_imageConfigProperties as $serverParam => $configKey) {
-			if (isset($config[$configKey])) {
-				$properties[$serverParam] = $config[$configKey];
-			}
-		}
-
-		$postdata = http_build_query($fonts, '', '&') . '&' . http_build_query($properties, '', '&');
-		
-		$contextArray = array('http' =>
-			array(
-				'method'  => 'POST',
-				'header'  => 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
-				'content' => $postdata
-			)
-		);
-
-		if (isset($config['wirisproxy']) && $config['wirisproxy'] == 'true') {
-			$contextArray['http']['proxy'] = 'tcp://' . $config['wirisproxy_host'] . ':' . $config['wirisproxy_port'];
-			$contextArray['http']['request_fulluri'] = true;
-		}
-
-		$context = stream_context_create($contextArray);
-
-		if (($response = file_get_contents('http://' . $config['wirisimageservicehost'] . ':' . $config['wirisimageserviceport'] . $config['wirisimageservicepath'], false, $context)) === false) {
-			return false;
-		}
-
-		file_put_contents($imagePath, $response);
-		return true;
-	}
-	
-	return false;
-}
-
-if (empty($_GET['formula'])) {
-	echo 'Error: no image name has been sended.';
-}
-else {
-	$formula = rtrim(basename($_GET['formula']), '.png');
-	$imagePath = WRS_CACHE_DIRECTORY . '/' . $formula . '.png';
-	$config = wrs_loadConfig(WRS_CONFIG_FILE);
-	
-	if (is_file($imagePath) || createImage($config, WRS_FORMULA_DIRECTORY . '/' . $formula . '.xml', $imagePath)) {
-		header('Content-Type: image/png');
-		readfile($imagePath);
-	}
-	else {
-		echo 'Error creating the image.';
-	}
-}
-?>

+ 3 - 0
main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/readme.txt

@@ -0,0 +1,3 @@
+Installing this plugin you get WIRIS editor and WIRIS CAS.
+This activation is not fully realized unless it has been previously downloaded the PHP plugin for FCKeditor WIRIS (http://www.wiris.com/plugins/editors/download?filter=fckeditor) and unzipped its contents in the Chamilo's directory main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/
+This is necessary because Wiris is proprietary software and his services are commercial (http://www.wiris.com/store/who-pays). To make adjustments to the plugin, edit configuration.ini file or replace his content by configuration.ini.default Chamilo file.

+ 1 - 1
main/lang/brazilian/index.inc.php

@@ -72,7 +72,7 @@ $Inbox = "Caixa de entrada";
 $Comppose = "Escrever mensagem";
 $PendingInvitations = "Convites pendentes";
 $YouDoNotHaveAnySessionInItsHistory = "Você não tem nenhuma sessão de treinamento em seu histórico";
-$PortalHomepageDefaultIntroduction = "<h2>Parabéns! Você instalou com sucesso seu portal de e-learning!</h2>  <p>Você agora pode terminar a instalação seguindo três etapas fáceis:<br /> <ol>     <li>Configurar seu portal indo à seção de administração, e selecionando -> <a href=\"main/admin/settings.php\">Configurações gerais do Chamilo</a>.</li>     <li>Adicione alguma vida a seu portal criando usuários e/ou cursos. Você pode convidar novas pessoas para criar seus cursos ou criar você mesmo através da seção de <a href=\"main/admin/\">adminitração</a> usuários e cursos.</li>     <li>Edite a página inicial do portal através da opção de <a href=\"main/admin/configure_homepage.php\">Edição da Página Inicial</a>.</li> </ol> <p>Você pode sempre encontrar mais informação sobre este software em nosso Web site: <a href=\"http://www.chamilo.org\">http://www.chamilo.org</a>.</p> <p>Divirta-se, e não hesite em juntar-se à comunidade e dar-nos o feedback através de <a href=\"http://www.chamilo.org/forum\">nosso fórum</a>.</p>";
+$PortalHomepageDefaultIntroduction = "<h2>Parabéns! Você instalou com sucesso seu portal de e-learning!</h2>  <p>Você agora pode terminar a instalação seguindo três etapas fáceis:<br /> <ol>     <li>Configurar seu portal indo à seção de administração, e selecionando -> <a href=\\"main/admin/settings.php\\">Configurações gerais do Chamilo</a>.</li>     <li>Adicione alguma vida a seu portal criando usuários e/ou cursos. Você pode convidar novas pessoas para criar seus cursos ou criar você mesmo através da seção de <a href=\\"main/admin/\\">adminitração</a> usuários e cursos.</li>     <li>Edite a página inicial do portal através da opção de <a href=\\"main/admin/configure_homepage.php\\">Edição da Página Inicial</a>.</li> </ol> <p>Você pode sempre encontrar mais informação sobre este software em nosso Web site: <a href=\\"http://www.chamilo.org\\">http://www.chamilo.org</a>.</p> <p>Divirta-se, e não hesite em juntar-se à comunidade e dar-nos o feedback através de <a href=\\"http://www.chamilo.org/forum\\">nosso fórum</a>.</p>";
 $Username = "Nome de usuário";
 $Profile = "Perfil";
 ?>

+ 1 - 1
main/lang/english/admin.inc.php

@@ -1289,7 +1289,7 @@ $SSOServerUnAuthURIComment = "The address of the page on the server that logs th
 $SSOServerProtocolTitle = "Single Sign On server's protocol";
 $SSOServerProtocolComment = "The protocol string to prefix the Single Sign On server's domain (we recommend you use https:// if your server is able to provide this feature, as all non-secure protocols are dangerous for authentication matters)";
 $EnabledWirisTitle = "WIRIS mathematical editor";
-$EnabledWirisComment = "Enable WIRIS mathematical editor";
+$EnabledWirisComment = "Enable WIRIS mathematical editor. Installing this plugin you get WIRIS editor and WIRIS CAS. <br/>This activation is not fully realized unless it has been previously downloaded the <a href=\"http://www.wiris.com/plugins/editors/download?filter=fckeditor\" target=\"_blank\">PHP plugin for FCKeditor WIRIS</a> and unzipped its contents in the Chamilo's directory main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/ <br/>This is necessary because Wiris is proprietary software and his services are <a href=\"http://www.wiris.com/store/who-pays\" target=\"_blank\">commercial</a>. To make adjustments to the plugin, edit configuration.ini file or replace his content by configuration.ini.default Chamilo file.";
 $AllowSpellCheckTitle = "Spell check";
 $AllowSpellCheckComment = "Enable spell check";
 $EnabledSVGTitle = "Create and edit SVG files";

+ 1 - 1
main/lang/spanish/admin.inc.php

@@ -1289,7 +1289,7 @@ $SSOServerUnAuthURIComment = "Dirección de la página del servidor que desconec
 $SSOServerProtocolTitle = "Protocolo del servidor Single Sign On";
 $SSOServerProtocolComment = "Prefijo que indica el protocolo del dominio del servidor de Single Sign On (si su servidor lo permite, recomendamos https:// pues protocolos no seguros son un peligro para un sistema de autentificación)";
 $EnabledWirisTitle = "Editor matemático WIRIS";
-$EnabledWirisComment = "Habilitar el editor matemático WIRIS";
+$EnabledWirisComment = "Activar el editor matemático WIRIS. Instalando este plugin obtendrá WIRIS editor y WIRIS CAS. <br/>La activación no se realiza completamente si previamente no ha descargado el <a href=\"http://www.wiris.com/plugins/editors/download?filter=fckeditor\" target=\"_blank\">PHP plugin for FCKeditor de WIRIS</a> y descomprimido su contenido en el directorio de Chamilo main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/ <br/>Esto es necesario debido a que Wiris es un software propietario y los servicios de Wiris son <a href=\"http://www.wiris.com/store/who-pays\" target=\"_blank\">comerciales</a>. Para realizar ajustes en el plugin edite el archivo configuration.ini o sustituya su contenido por el de configuration.ini.default que acompaña a Chamilo.";
 $AllowSpellCheckTitle = "Corrector ortográfico";
 $AllowSpellCheckComment = "Activar el corrector ortográfico";
 $EnabledSVGTitle = "Creación y edición de archivos SVG";