From 696072315bf7827ed25afb497b9512577471a944 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 7 Jun 2010 11:50:46 -0600 Subject: [PATCH] Ckeditor improvements. Allow 'config' parameter to be a PHP array. Disable spell check as you type. Editor still requires Core - remove incorrect comment in package.xml. --- framework/Editor/lib/Horde/Editor/Ckeditor.php | 15 ++++++++++----- framework/Editor/package.xml | 7 +++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/framework/Editor/lib/Horde/Editor/Ckeditor.php b/framework/Editor/lib/Horde/Editor/Ckeditor.php index 534fd8f79..597440863 100644 --- a/framework/Editor/lib/Horde/Editor/Ckeditor.php +++ b/framework/Editor/lib/Horde/Editor/Ckeditor.php @@ -21,7 +21,7 @@ class Horde_Editor_Ckeditor extends Horde_Editor *
      * 'basic' - (boolean) Load "basic" editor (a small javascript stub that
      *           will download the full code on demand)?
-     * 'config' - (string) The javascript config hash used to indiciate the
+     * 'config' - (array) The javascript config hash used to indiciate the
      *            config for this editor instance.
      * 'id' - (string) The ID of the text area to turn into an editor. If
      *        empty, won't automatically load the editor.
@@ -29,8 +29,12 @@ class Horde_Editor_Ckeditor extends Horde_Editor
      *               instead be stored for access via getJS().
      * 
*/ - public function __construct($params = array()) + public function __construct(array $params = array()) { + $params = array_merge(array( + 'config' => array() + ), $params); + parent::__construct($params); if (!$this->supportedByBrowser()) { @@ -42,9 +46,10 @@ class Horde_Editor_Ckeditor extends Horde_Editor : 'ckeditor_basic.js'; $ck_path = $GLOBALS['registry']->get('webroot', 'horde') . '/services/editor/ckeditor/'; - if (empty($params['config'])) { - $params['config'] = '{}'; - } + /* Globally disable spell check as you type. */ + $params['config']['scayt_autoStartup'] = false; + + $params['config'] = Horde_Serialize::serialize($params['config'], Horde_Serialize::JSON); if (empty($params['no_notify'])) { Horde::addScriptFile($ck_path . $ck_file, null, array('external' => true)); diff --git a/framework/Editor/package.xml b/framework/Editor/package.xml index a30503fde..8e3e746b5 100644 --- a/framework/Editor/package.xml +++ b/framework/Editor/package.xml @@ -30,8 +30,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Removed dependency on Horde_Core. - * Removed Xinha driver. + * Removed Xinha driver. * Added CKEditor driver. * Initial Horde 4 package. @@ -62,6 +61,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> pear.horde.org + Core + pear.horde.org + + Exception pear.horde.org -- 2.11.0