Commit a42e68b4 authored by Aaron Wells's avatar Aaron Wells

Changes to make the TinyMCE 4.1 spellchecker work

Note that this drops support for the $CFG->pathtoaspell
setting, and replaces it with a new $CFG->tinymcespellcheckerengine
setting.

Bug 1384491

Change-Id: I1692df6ed7a4c6ea3ea98e32855736e11e40dc66
parent f719cd35
......@@ -56,6 +56,7 @@ Mahara 15.10 requires:
** zip (optional)
** zlib (optional)
** adodb (optional; improves performance)
** enchant or pspell (optional; for TinyMCE spellcheck button)
** ... and ensure that the magic_quotes and register_globals settings are off.
* OS: Mahara is only officially supported on Debian (5.0/"Lenny" or later) and
......
......@@ -12,6 +12,6 @@ Changes:
* Removed all .min.js and .dev.js files
* Removed all files in 'classes' directory since they're packaged into tinymce.js
* Removed all .less files from skin
* Added rpc.php to the spellchecker plugin to use server side processing rather than client side
* Added code to spellchecker/spellchecker.rpc to use $CFG->spellcheckerengine
* Added maharaimage plugin (supports adding attachments)
* Adjusted the charmap plugin to contain Māori macrons
\ No newline at end of file
......@@ -9,12 +9,17 @@
* Contributing: http://www.tinymce.com/contributing
*/
define('INTERNAL', 1);
require_once('../../../../init.php');
require('./includes/Engine.php');
require('./includes/EnchantEngine.php');
require('./includes/PSpellEngine.php');
$engine = get_config('tinymcespellcheckerengine');
$tinymceSpellCheckerConfig = array(
"engine" => "enchant", // enchant, pspell
"engine" => $engine, // enchant, pspell
// Enchant options
"enchant_dicts_path" => "./dicts",
......@@ -27,4 +32,3 @@ $tinymceSpellCheckerConfig = array(
);
TinyMCE_Spellchecker_Engine::processRequest($tinymceSpellCheckerConfig);
?>
\ No newline at end of file
......@@ -270,14 +270,6 @@ $cfg->imagemaxheight = 1024;
*/
$cfg->maximageresizememory = 104857600;
/**
* Paths and arguments for various system commands
*
* @global string $cfg->pathtoaspell Set this path to use the TinyMCE Spellcheck button in place of the
* browser's built-in spellchecker.
*/
//$cfg->pathtoaspell = '/usr/bin/aspell';
/**
* @global $cfg->pathtoclam The path to the ClamAV executable (clamscan or clamdscan); disabled by default
*/
......@@ -372,6 +364,14 @@ $cfg->leapovermnetloglevel = 0;
*/
// $cfg->blockeditorheight = 550;
/**
* @global boolean $cfg->tinymcespellcheck Activate the TinyMCE spellcheck plugin. Not usually necessary
* in modern browsers, which have their own built-in spellchecker. Requires the PHP "enchant" or "pspell"
* module to be installed.
*/
//$cfg->tinymcespellcheckerengine = 'enchant';
//$cfg->tinymcespellcheckerengine = 'pspell';
/**
* @global bool $cfg->sslproxy This needs to be true when forcing https with an ssl proxy such as nginx.
*/
......
......@@ -142,11 +142,10 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
$extramceconfig = isset($extraconfig['tinymceconfig']) ? $extraconfig['tinymceconfig'] : '';
// Check whether to make the spellchecker available
$aspellpath = get_config('pathtoaspell');
if ($aspellpath && file_exists($aspellpath) && is_executable($aspellpath)) {
if (get_config('tinymcespellcheckerengine')) {
$spellchecker = ',spellchecker';
$spellchecker_toolbar = '| spellchecker';
$spellchecker_config = "gecko_spellcheck : false, spellchecker_rpc_url : \"{$jsroot}tinymce/plugins/spellchecker/rpc.php\",";
$spellchecker_config = "gecko_spellcheck : false, spellchecker_rpc_url : \"{$jsroot}tinymce/plugins/spellchecker/spellchecker.php\",";
}
else {
$spellchecker = $spellchecker_toolbar = '';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment