Enable TinyMCE spellcheck module: Difference between revisions

From Open-Xchange
(Added new property description to enable the spellchecker)
 
(6 intermediate revisions by 3 users not shown)
Line 11: Line 11:
* PHP5 must be enabled in your Apache configuration
* PHP5 must be enabled in your Apache configuration


= Enabling the TinyMCE Spellcheck module =
= Installation and Configuration of the TinyMCE Spellcheck module =


Please note that enabling the spellcheck module will require the modification of one javascript file of the Open-Xchange UI, and therefor every update will disable the spellcheck button, as the javascript file will be overwritten during the update. Also Open-Xchange cannot support the spellcheck module itself and the according infrastructure (aspell, PHP), as those modules won't be maintained and tracked by Open-Xchange.
Please note: Open-Xchange cannot support the spellcheck module itself and the according infrastructure (aspell, PHP), as those modules won't be maintained and tracked by Open-Xchange. On machines with lot of users this service may produce heavy load due to many request so we highly recommend to cluster it or, even better, to use the native spellcheck plugins of modern browsers.


== Installation of the TinyMCE spellchecker module ==
== Installation of the TinyMCE spellchecker module ==


Please visit the TinyMCE website and download the latest TinyMCE spellchecker module (at the bottom of the page) at http://tinymce.moxiecode.com/download.php. This article will use the following spellchecker module: http://prdownloads.sourceforge.net/tinymce/tinymce_spellchecker_php_2_0_2.zip?download
Please visit the TinyMCE website and download the latest TinyMCE "PHP Spellchecker"  plugin at http://www.tinymce.com/download/download.php (at the bottom of the list). This article uses Version 2.0.5.


Extract the downloaded archive and move the extracted directory "spellchecker" to the TinyMCE location on the Open-Xchange installation:
Extract the downloaded archive and move the extracted directory "spellchecker" to the TinyMCE location on the Open-Xchange installation:
Line 24: Line 24:


== Enable the spellchecker button in the Open-Xchange HTML editor ==
== Enable the spellchecker button in the Open-Xchange HTML editor ==
'''Version >= 6.14:'''


This can be accomplished by adding a properties file to directory "/opt/open-xchange/etc/groupware/settings".
This can be accomplished by adding a properties file to directory "/opt/open-xchange/etc/groupware/settings".


This file should contain a single property of the format:
  $ vim /opt/open-xchange/etc/groupware/settings/spellchecker.properties
  <path-in-config-tree> '=' ("true" | "false")
   
 
E.g.:
  # A short description of this property
  modules/mail/spellcheck=true
  modules/mail/spellcheck=true


The file "/opt/open-xchange/etc/groupware/settings/themes.properties" for example is a good choice as a template.
== Setting the default spell check language ==
 
'''Version <= 6.12:'''
 
Now as we have installed the spellcheker plugin, we need to modify the Open-Xchange HTML editor, so that the spellchecker button will be displayed. To do so, edit /var/www/ox6/concat_mailnew.js and change the following lines:


Replace
The spell check language for the tinyMCE spellcheck module defaults to english and is configured inside the files editor_plugin.js and editor_plugin_src.js located in the directory
plugins : "inlinepopups",
/var/www/ox6/3rdparty/tinymce/jscripts/tiny_mce/plugins/spellchecker. A '+' character in front of the language name will indicate that this will be the default language used for the spellchecker. The default value for this option is '+English=en'. You can change this to another language by moving the '+' character in front of the language name of your choice in both files. Search for 'spellchecker_languages' to easily jump to the languages section in these files. The changes are active immediately after you have cleared your browser cache.
with
plugins : "inlinepopups,spellchecker",
Replace:
theme_advanced_buttons2 : (editorEnabled ? "cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,image,link,unlink,|,hr,|,charmap" : "") ,
with
theme_advanced_buttons2 : (editorEnabled ? "cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,image,link,unlink,|,hr,|,charmap,|,spellchecker" : "") ,


== Setup the backend communication ==
== Setup the backend communication ==
Line 55: Line 40:
Finally we need to tell the spellchecker module which binary it should execute in order to get spelling suggestions. By default GoogleSpell is activated for remote suggestion, but as this would mean that every eMail which should be checked will be send to Google, we recommend to use a local aspell instance for this purpose. To do so, install aspell and the according dictionaries as we told you in the requirements section, and modify /var/www/ox6/3rdparty/tinymce/jscripts/tiny_mce/plugins/spellchecker/config.php to specify the aspell binary location. Please use the following example, and just replace [REPLACE_WITH_PATH_TO_ASPELL_BIN] with the location of the aspell binary (for example /usr/bin/aspell):
Finally we need to tell the spellchecker module which binary it should execute in order to get spelling suggestions. By default GoogleSpell is activated for remote suggestion, but as this would mean that every eMail which should be checked will be send to Google, we recommend to use a local aspell instance for this purpose. To do so, install aspell and the according dictionaries as we told you in the requirements section, and modify /var/www/ox6/3rdparty/tinymce/jscripts/tiny_mce/plugins/spellchecker/config.php to specify the aspell binary location. Please use the following example, and just replace [REPLACE_WITH_PATH_TO_ASPELL_BIN] with the location of the aspell binary (for example /usr/bin/aspell):


<?php
  <?php
  /**
  * config.php
  *
  * @package MCManager.includes
  */
         // General settings
         // General settings
         //$config['general.engine'] = 'GoogleSpell';
         //$config['general.engine'] = 'GoogleSpell';
Line 63: Line 53:
   
   
         // PSpell settings
         // PSpell settings
         //$config['PSpell.mode'] = PSPELL_FAST;
         $config['PSpell.mode'] = PSPELL_FAST;
         //$config['PSpell.spelling'] = "";
         $config['PSpell.spelling'] = "";
         //$config['PSpell.jargon'] = "";
         $config['PSpell.jargon'] = "";
         //$config['PSpell.encoding'] = "";
         $config['PSpell.encoding'] = "";
   
   
         // PSpellShell settings
         // PSpellShell settings
         $config['PSpellShell.mode'] = PSPELL_FAST;
         $config['PSpellShell.mode'] = PSPELL_FAST;
         $config['PSpellShell.aspell'] = '[REPLACE_WITH_PATH_TO_ASPELL_BIN]';
         $config['PSpellShell.aspell'] = '[REPLACE_WITH_PATH_TO_ASPELL_BIN]'; // e.g. /usr/bin/aspell
         $config['PSpellShell.tmp'] = '/tmp';
         $config['PSpellShell.tmp'] = '/tmp';
   
   
Line 76: Line 66:
         //$config['PSpellShell.aspell'] = '"c:\Program Files\Aspell\bin\aspell.exe"';
         //$config['PSpellShell.aspell'] = '"c:\Program Files\Aspell\bin\aspell.exe"';
         //$config['PSpellShell.tmp'] = 'c:/temp';
         //$config['PSpellShell.tmp'] = 'c:/temp';
  ?>
  ?>  


[[Category: OX6]]
[[Category: OX6]]

Latest revision as of 10:48, 13 December 2011

Introduction

By default there is no spell check available in the Open-Xchange application itself because most of the modern browsers usually offer a spellcheck module. TinyMCE, the HTML editor which is used by Open-Xchange for HTML editing while writing an eMail, offers a wide set of functions and features which can be added to the HTML editor UI. This example will describe how you can enable the TinyMCE based spellcheck functionality within the Open-Xchange mail module.

Requirements

  • An installed Open-Xchange Server
  • ASpell with the according dictionaries needs to be installed
  • PHP5 must be enabled in your Apache configuration

Installation and Configuration of the TinyMCE Spellcheck module

Please note: Open-Xchange cannot support the spellcheck module itself and the according infrastructure (aspell, PHP), as those modules won't be maintained and tracked by Open-Xchange. On machines with lot of users this service may produce heavy load due to many request so we highly recommend to cluster it or, even better, to use the native spellcheck plugins of modern browsers.

Installation of the TinyMCE spellchecker module

Please visit the TinyMCE website and download the latest TinyMCE "PHP Spellchecker" plugin at http://www.tinymce.com/download/download.php (at the bottom of the list). This article uses Version 2.0.5.

Extract the downloaded archive and move the extracted directory "spellchecker" to the TinyMCE location on the Open-Xchange installation:

$ mv spellchecker /var/www/ox6/3rdparty/tinymce/jscripts/tiny_mce/plugins/.

Enable the spellchecker button in the Open-Xchange HTML editor

This can be accomplished by adding a properties file to directory "/opt/open-xchange/etc/groupware/settings".

$ vim /opt/open-xchange/etc/groupware/settings/spellchecker.properties

modules/mail/spellcheck=true

Setting the default spell check language

The spell check language for the tinyMCE spellcheck module defaults to english and is configured inside the files editor_plugin.js and editor_plugin_src.js located in the directory /var/www/ox6/3rdparty/tinymce/jscripts/tiny_mce/plugins/spellchecker. A '+' character in front of the language name will indicate that this will be the default language used for the spellchecker. The default value for this option is '+English=en'. You can change this to another language by moving the '+' character in front of the language name of your choice in both files. Search for 'spellchecker_languages' to easily jump to the languages section in these files. The changes are active immediately after you have cleared your browser cache.

Setup the backend communication

Finally we need to tell the spellchecker module which binary it should execute in order to get spelling suggestions. By default GoogleSpell is activated for remote suggestion, but as this would mean that every eMail which should be checked will be send to Google, we recommend to use a local aspell instance for this purpose. To do so, install aspell and the according dictionaries as we told you in the requirements section, and modify /var/www/ox6/3rdparty/tinymce/jscripts/tiny_mce/plugins/spellchecker/config.php to specify the aspell binary location. Please use the following example, and just replace [REPLACE_WITH_PATH_TO_ASPELL_BIN] with the location of the aspell binary (for example /usr/bin/aspell):

 <?php
 /**
  * config.php
  *
  * @package MCManager.includes
  */
        // General settings
        //$config['general.engine'] = 'GoogleSpell';
        //$config['general.engine'] = 'PSpell';
        $config['general.engine'] = 'PSpellShell';
        //$config['general.remote_rpc_url'] = 'http://some.other.site/some/url/rpc.php';

        // PSpell settings
        $config['PSpell.mode'] = PSPELL_FAST;
        $config['PSpell.spelling'] = "";
        $config['PSpell.jargon'] = "";
        $config['PSpell.encoding'] = "";

        // PSpellShell settings
        $config['PSpellShell.mode'] = PSPELL_FAST;
        $config['PSpellShell.aspell'] = '[REPLACE_WITH_PATH_TO_ASPELL_BIN]'; // e.g. /usr/bin/aspell
        $config['PSpellShell.tmp'] = '/tmp';

        // Windows PSpellShell settings
        //$config['PSpellShell.aspell'] = '"c:\Program Files\Aspell\bin\aspell.exe"';
        //$config['PSpellShell.tmp'] = 'c:/temp';
?>