2008-02-27 Stanislas Rolland <stanislas.rolland@fructifor.ca>
* Fixed bug #7697: Syntax error raised by Mozilla 1.7 when loading htmlArea RTE
+ * Fixed bug #7698: htmlArea RTE fails to load due to missing toolbar constraints
2008-02-27 Martin Kutschker <martin.t.kutschker@blackbox.net>
2008-02-27 Stanislas Rolland <stanislas.rolland@fructifor.ca>
* Fixed bug #7697: Syntax error raised by Mozilla 1.7 when loading htmlArea RTE
+ * Fixed bug #7698: htmlArea RTE fails to load due to missing toolbar constraints
2008-02-26 Stanislas Rolland <stanislas.rolland@fructifor.ca>
// Hiding the buttons
$show = array_diff($show, $this->conf_toolbar_hide, $hideButtons, t3lib_div::trimExplode(',',$this->thisConfig['hideButtons'],1));
-
+
+ // Apply toolbar constraints from registered plugins
+ foreach ($this->registeredPlugins as $pluginId => $plugin) {
+ if ($this->isPluginEnabled($pluginId) && method_exists($plugin, "applyToolbarConstraints")) {
+ $show = $plugin->applyToolbarConstraints($show);
+ }
+ }
// Adding the always show buttons
$show = array_unique(array_merge($show, $this->conf_toolbar_show));
$toolbarOrder = array_unique(array_merge($toolbarOrder, $this->conf_toolbar_show));
if (in_array($button, $this->toolbar)) {
if (!is_array( $this->thisConfig['buttons.']) || !is_array( $this->thisConfig['buttons.'][$button.'.'])) {
$registerRTEinJavascriptString .= '
- RTEarea['.$RTEcounter.']["buttons"]["'. $button .'"] = new Object();';
+ RTEarea['.$RTEcounter.'].buttons.'. $button .' = new Object();';
}
$registerRTEinJavascriptString .= '
RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathLinkModule = "../../mod3/browse_links.php";';
*
* @return string classesAnchor array definition
*/
- function buildJSClassesAnchorArray() {
+ public function buildJSClassesAnchorArray() {
global $LANG, $TYPO3_CONF_VARS;
$linebreak = $TYPO3_CONF_VARS['EXTCONF'][$this->htmlAreaRTE->ID]['enableCompressedScripts'] ? '' : chr(10);
}
$JSClassesAnchorArray .= '];' . $linebreak;
return $JSClassesAnchorArray;
- }
+ }
+
+ /**
+ * Return an updated array of toolbar enabled buttons
+ *
+ * @param array $show: array of toolbar elements that will be enabled, unless modified here
+ *
+ * @return array toolbar button array, possibly updated
+ */
+ public function applyToolbarConstraints($show) {
+ // We will not allow unlink if link is not enabled
+ if (!in_array('link', $show)) {
+ return array_diff($show, t3lib_div::trimExplode(',', $this->pluginButtons));
+ } else {
+ return $show;
+ }
+ }
} // end of class
}
return $registerRTEinJavascriptString;
}
+
+
+ /**
+ * Return an updated array of toolbar enabled buttons
+ *
+ * @param array $show: array of toolbar elements that will be enabled, unless modified here
+ *
+ * @return array toolbar button array, possibly updated
+ */
+ public function applyToolbarConstraints($show) {
+ // We will not allow any table operations button if the table button is not enabled
+ if (!in_array('table', $show)) {
+ return array_diff($show, t3lib_div::trimExplode(',', $this->pluginButtons));
+ } else {
+ return $show;
+ }
+ }
} // end of class