From 1dd3ad5e0a0b36cc4c1ade54483201f237b9f2da Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 4 Nov 2013 10:13:28 +0000 Subject: [PATCH] fixed ckeditor wont start with NOT expanded toolbar --- etemplate/inc/class.xul_io.inc.php | 2 +- etemplate/js/et2_widget_htmlarea.js | 14 +++++++------- phpgwapi/inc/class.egw_ckeditor_config.inc.php | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/etemplate/inc/class.xul_io.inc.php b/etemplate/inc/class.xul_io.inc.php index 5ee6e79ea1..cb66ad3904 100644 --- a/etemplate/inc/class.xul_io.inc.php +++ b/etemplate/inc/class.xul_io.inc.php @@ -106,7 +106,7 @@ class xul_io 'size' => 'image,ro_image' ), 'htmlarea' => array( - 'size' => 'mode,height,width,toolbar,base_href', + 'size' => 'mode,height,width,expand_toolbar,base_href', ), 'nextmatch' => array( 'size' => 'template,hide_header,header_left,header_right', diff --git a/etemplate/js/et2_widget_htmlarea.js b/etemplate/js/et2_widget_htmlarea.js index ba6270bd4c..9465bcc2cd 100644 --- a/etemplate/js/et2_widget_htmlarea.js +++ b/etemplate/js/et2_widget_htmlarea.js @@ -27,7 +27,7 @@ var et2_htmlarea = et2_inputWidget.extend( { modes: ['ascii','simple','extended','advanced'], - + attributes: { 'mode': { 'name': 'Mode', @@ -48,7 +48,7 @@ var et2_htmlarea = et2_inputWidget.extend( 'expand_toolbar': { 'name': 'Expand Toolbar', 'default': true, - 'type':'any', + 'type':'boolean', 'description': 'Have the toolbar expanded (visible)' }, 'base_href': { @@ -71,7 +71,7 @@ var et2_htmlarea = et2_inputWidget.extend( /** * Constructor - * + * * @param _parent * @param _attrs * @memberOf et2_htmlarea @@ -87,7 +87,7 @@ var et2_htmlarea = et2_inputWidget.extend( .addClass('et2_textbox_ro'); this.setDOMNode(this.htmlNode[0]); }, - + transformAttributes: function(_attrs) { // Check mode, some apps jammed everything in there @@ -102,11 +102,11 @@ var et2_htmlarea = et2_inputWidget.extend( } this._super.apply(this, arguments); }, - + doLoadingFinished: function() { this._super.apply(this, arguments); if(this.mode == 'ascii') return; - + var self = this; var ckeditor; try @@ -161,7 +161,7 @@ var et2_htmlarea = et2_inputWidget.extend( } else { - this.htmlNode.val(_value); + this.htmlNode.val(_value); this.value = _value; } } catch (e) { diff --git a/phpgwapi/inc/class.egw_ckeditor_config.inc.php b/phpgwapi/inc/class.egw_ckeditor_config.inc.php index 4b6b56f5ab..f4f822ad4f 100644 --- a/phpgwapi/inc/class.egw_ckeditor_config.inc.php +++ b/phpgwapi/inc/class.egw_ckeditor_config.inc.php @@ -224,7 +224,8 @@ class egw_ckeditor_config $config['removePlugins'] = 'elementspath'; $config['toolbarCanCollapse'] = true; - $config['toolbarStartupExpanded'] = $expanded_toolbar; + $config['toolbarStartupExpanded'] = is_bool($expanded_toolbar) ? $expanded_toolbar : + ($expanded_toolbar === 'false' ? false : (boolean)$expanded_toolbar); $config['filebrowserBrowseUrl'] = self::get_filebrowserBrowseUrl($start_path); $config['filebrowserWindowHeight'] = 640; @@ -377,7 +378,7 @@ class egw_ckeditor_config self::add_default_options($config, $height, $expanded_toolbar, $start_path); self::add_spellchecker_options($config, $spellchecker_button, $scayt_button); self::add_toolbar_options($config, $mode, $spellchecker_button, $scayt_button); - + //error_log(__METHOD__."('$mode', $height, ".array2string($expanded_toolbar).") returning ".array2string($config)); return $config; }