Bug #19257 » rtehtmlarea_bugfix_9235.patch
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (copie de travail) | ||
---|---|---|
var $toolbarOrderArray = array();
|
||
protected $pluginEnabledArray = array(); // Array of plugin id's enabled in the current RTE editing area
|
||
protected $pluginEnabledCumulativeArray = array(); // Cumulative array of plugin id's enabled so far in any of the RTE editing areas of the form
|
||
protected $registeredPlugins = array(); // Array of registered plugins indexd by their plugin Id's
|
||
public $registeredPlugins = array(); // Array of registered plugins indexd by their plugin Id's
|
||
|
||
/**
|
||
* Returns true if the RTE is available. Here you check if the browser requirements are met.
|
||
... | ... | |
foreach ($this->pluginEnabledCumulativeArray[$RTEcounter] as $pluginId) {
|
||
$extensionKey = is_object($this->registeredPlugins[$pluginId]) ? $this->registeredPlugins[$pluginId]->getExtensionKey() : $this->ID;
|
||
$loadPluginCode .= '
|
||
HTMLArea.loadPlugin("' . $pluginId . '", true, "' . $this->writeTemporaryFile('EXT:' . $extensionKey . '/htmlarea/plugins/' . $pluginId . '/' . strtolower(preg_replace('/([a-z])([A-Z])([a-z])/', "$1".'-'."$2"."$3", $pluginId)) . '.js', $pluginId) . '");';
|
||
HTMLArea.loadPlugin("' . $pluginId . '", "' . $this->writeTemporaryFile('EXT:' . $extensionKey . '/htmlarea/plugins/' . $pluginId . '/' . strtolower(preg_replace('/([a-z])([A-Z])([a-z])/', "$1".'-'."$2"."$3", $pluginId)) . '.js', $pluginId) . '", '. ($this->registeredPlugins[$pluginId]->requiresSynchronousLoad()?'true':'false'). ');';
|
||
}
|
||
return (!$this->is_FE() ? '' : '
|
||
' . '/*<![CDATA[*/') . ($this->is_FE() ? '' : '
|
typo3/sysext/rtehtmlarea/class.tx_rtehtmlareaapi.php (copie de travail) | ||
---|---|---|
protected $pluginAddsButtons = true; // Boolean indicating whether the plugin is adding buttons or not
|
||
protected $convertToolbarForHtmlAreaArray = array(); // The name-converting array, converting the button names used in the RTE PageTSConfing to the button id's used by the JS scripts
|
||
protected $requiresClassesConfiguration = false; // True if the registered plugin requires the PageTSConfig Classes configuration
|
||
protected $requiresSynchronousLoad = false; // True if the plugin must be loaded synchronously
|
||
/**
|
||
* Returns true if the plugin is available and correctly initialized
|
||
... | ... | |
return $this->requiresClassesConfiguration;
|
||
}
|
||
/**
|
||
* Returns true if the plugin requires synchronous load
|
||
*
|
||
* @return boolean true if the plugin requires synchronous load
|
||
*/
|
||
public function requiresSynchronousLoad() {
|
||
return $this->requiresSynchronousLoad;
|
||
}
|
||
/**
|
||
* Sets the plugin to require synchronous load or not
|
||
*
|
||
* @param boolean $value: the boolean value to set
|
||
*
|
||
* @return void
|
||
*/
|
||
public function setSynchronousLoad($value = true) {
|
||
$this->requiresSynchronousLoad = $value;
|
||
}
|
||
} // end of class
|
||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/class.tx_rtehtmlareaapi.php']) {
|
typo3/sysext/rtehtmlarea/extensions/DefinitionList/class.tx_rtehtmlarea_definitionlist.php (copie de travail) | ||
---|---|---|
);
|
||
|
||
public function main($parentObject) {
|
||
global $TYPO3_CONF_VARS;
|
||
|
||
return parent::main($parentObject) && $this->htmlAreaRTE->isPluginEnabled('BlockElements');
|
||
$enabled = parent::main($parentObject) && $this->htmlAreaRTE->isPluginEnabled('BlockElements');
|
||
if ($enabled && is_object($this->htmlAreaRTE->registeredPlugins['BlockElements'])) {
|
||
$this->htmlAreaRTE->registeredPlugins['BlockElements']->setSynchronousLoad();
|
||
}
|
||
return $enabled;
|
||
}
|
||
|
||
/**
|
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail) | ||
---|---|---|
HTMLArea._scripts = [];
|
||
HTMLArea._scriptLoaded = [];
|
||
HTMLArea._request = [];
|
||
HTMLArea.loadScript = function(url, plugin) {
|
||
if (plugin) url = _editor_url + "/plugins/" + plugin + '/' + url;
|
||
HTMLArea.loadScript = function(url, pluginName, asynchronous) {
|
||
if (typeof(pluginName) == "undefined") {
|
||
var pluginName = "";
|
||
}
|
||
if (typeof(asynchronous) == "undefined") {
|
||
var asynchronous = true;
|
||
}
|
||
if (HTMLArea.is_opera) url = _typo3_host_url + url;
|
||
if (HTMLArea._compressedScripts && url.indexOf("compressed") == -1) url = url.replace(/\.js$/gi, "_compressed.js");
|
||
HTMLArea._scripts.push(url);
|
||
var scriptInfo = {
|
||
pluginName : pluginName,
|
||
url : url,
|
||
asynchronous : asynchronous
|
||
};
|
||
HTMLArea._scripts.push(scriptInfo);
|
||
};
|
||
if(HTMLArea.is_gecko) HTMLArea.loadScript(RTEarea[0]["htmlarea-gecko"] ? RTEarea[0]["htmlarea-gecko"] : _editor_url + "htmlarea-gecko.js");
|
||
if(HTMLArea.is_ie) HTMLArea.loadScript(RTEarea[0]["htmlarea-ie"] ? RTEarea[0]["htmlarea-ie"] : _editor_url + "htmlarea-ie.js");
|
||
... | ... | |
HTMLArea.MSXML_XMLHTTP_PROGIDS = new Array("Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP");
|
||
HTMLArea.XMLHTTPResponseHandler = function (i) {
|
||
return (function() {
|
||
var url = HTMLArea._scripts[i];
|
||
var url = HTMLArea._scripts[i].url;
|
||
if (HTMLArea._request[i].readyState != 4) return;
|
||
if (HTMLArea._request[i].status == 200) {
|
||
try {
|
||
... | ... | |
});
|
||
};
|
||
HTMLArea._getScript = function (i,asynchronous,url) {
|
||
if (typeof(url) == "undefined") var url = HTMLArea._scripts[i];
|
||
if (typeof(asynchronous) == "undefined") var asynchronous = true;
|
||
if (typeof(url) == "undefined") var url = HTMLArea._scripts[i].url;
|
||
if (typeof(asynchronous) == "undefined") var asynchronous = HTMLArea._scripts[i].asynchronous;
|
||
if (window.XMLHttpRequest) HTMLArea._request[i] = new XMLHttpRequest();
|
||
else if (window.ActiveXObject) {
|
||
var success = false;
|
||
... | ... | |
try {
|
||
var success = true;
|
||
for (var i = 0, n = HTMLArea._scripts.length; i < n && success; i++) {
|
||
success = success && HTMLArea._getScript(i);
|
||
if (HTMLArea._scripts[i].asynchronous) {
|
||
success = success && HTMLArea._getScript(i);
|
||
} else {
|
||
try {
|
||
eval(HTMLArea._getScript(i));
|
||
HTMLArea._scriptLoaded[i] = true;
|
||
} catch (e) {
|
||
HTMLArea._appendToLog("ERROR [HTMLArea::getScript]: Unable to get script " + url + ": " + e);
|
||
}
|
||
}
|
||
}
|
||
} catch (e) {
|
||
HTMLArea._appendToLog("ERROR [HTMLArea::init]: Unable to use XMLHttpRequest: "+ e);
|
||
... | ... | |
};
|
||
/*
|
||
* Load the required plugin script and, unless not requested, the language file
|
||
* Load the required plugin script
|
||
*/
|
||
HTMLArea.loadPlugin = function(pluginName,noLangFile,url) {
|
||
if (typeof(url) == "undefined") {
|
||
var dir = _editor_url + "plugins/" + pluginName;
|
||
var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g, "$1" + "-" + "$2" + "$3").toLowerCase() + ".js";
|
||
var plugin_file = dir + "/" + plugin;
|
||
HTMLArea.loadScript(plugin_file);
|
||
if (typeof(noLangFile) == "undefined" || !noLangFile) {
|
||
var plugin_lang = dir + "/lang/" + _editor_lang + ".js";
|
||
HTMLArea._scripts.push(plugin_lang);
|
||
}
|
||
} else {
|
||
HTMLArea.loadScript(url);
|
||
HTMLArea.loadPlugin = function (pluginName, url, asynchronous) {
|
||
if (typeof(asynchronous) == "undefined") {
|
||
var asynchronous = true;
|
||
}
|
||
HTMLArea.loadScript(url, pluginName, asynchronous);
|
||
};
|
||
/*
|