Commit 44e116ec authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Changes to make the TinyMCE 4.1 spellchecker work"

parents c92411cc a42e68b4
...@@ -56,6 +56,7 @@ Mahara 15.10 requires: ...@@ -56,6 +56,7 @@ Mahara 15.10 requires:
** zip (optional) ** zip (optional)
** zlib (optional) ** zlib (optional)
** adodb (optional; improves performance) ** adodb (optional; improves performance)
** enchant or pspell (optional; for TinyMCE spellcheck button)
** ... and ensure that the magic_quotes and register_globals settings are off. ** ... 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 * OS: Mahara is only officially supported on Debian (5.0/"Lenny" or later) and
......
...@@ -12,6 +12,6 @@ Changes: ...@@ -12,6 +12,6 @@ Changes:
* Removed all .min.js and .dev.js files * Removed all .min.js and .dev.js files
* Removed all files in 'classes' directory since they're packaged into tinymce.js * Removed all files in 'classes' directory since they're packaged into tinymce.js
* Removed all .less files from skin * 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) * Added maharaimage plugin (supports adding attachments)
* Adjusted the charmap plugin to contain Māori macrons * Adjusted the charmap plugin to contain Māori macrons
\ No newline at end of file
...@@ -9,12 +9,17 @@ ...@@ -9,12 +9,17 @@
* Contributing: http://www.tinymce.com/contributing * Contributing: http://www.tinymce.com/contributing
*/ */
define('INTERNAL', 1);
require_once('../../../../init.php');
require('./includes/Engine.php'); require('./includes/Engine.php');
require('./includes/EnchantEngine.php'); require('./includes/EnchantEngine.php');
require('./includes/PSpellEngine.php'); require('./includes/PSpellEngine.php');
$engine = get_config('tinymcespellcheckerengine');
$tinymceSpellCheckerConfig = array( $tinymceSpellCheckerConfig = array(
"engine" => "enchant", // enchant, pspell "engine" => $engine, // enchant, pspell
// Enchant options // Enchant options
"enchant_dicts_path" => "./dicts", "enchant_dicts_path" => "./dicts",
...@@ -27,4 +32,3 @@ $tinymceSpellCheckerConfig = array( ...@@ -27,4 +32,3 @@ $tinymceSpellCheckerConfig = array(
); );
TinyMCE_Spellchecker_Engine::processRequest($tinymceSpellCheckerConfig); TinyMCE_Spellchecker_Engine::processRequest($tinymceSpellCheckerConfig);
?>
\ No newline at end of file
...@@ -270,14 +270,6 @@ $cfg->imagemaxheight = 1024; ...@@ -270,14 +270,6 @@ $cfg->imagemaxheight = 1024;
*/ */
$cfg->maximageresizememory = 104857600; $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 * @global $cfg->pathtoclam The path to the ClamAV executable (clamscan or clamdscan); disabled by default
*/ */
...@@ -372,6 +364,14 @@ $cfg->leapovermnetloglevel = 0; ...@@ -372,6 +364,14 @@ $cfg->leapovermnetloglevel = 0;
*/ */
// $cfg->blockeditorheight = 550; // $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. * @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( ...@@ -142,11 +142,10 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
$extramceconfig = isset($extraconfig['tinymceconfig']) ? $extraconfig['tinymceconfig'] : ''; $extramceconfig = isset($extraconfig['tinymceconfig']) ? $extraconfig['tinymceconfig'] : '';
// Check whether to make the spellchecker available // Check whether to make the spellchecker available
$aspellpath = get_config('pathtoaspell'); if (get_config('tinymcespellcheckerengine')) {
if ($aspellpath && file_exists($aspellpath) && is_executable($aspellpath)) {
$spellchecker = ',spellchecker'; $spellchecker = ',spellchecker';
$spellchecker_toolbar = '| 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 { else {
$spellchecker = $spellchecker_toolbar = ''; $spellchecker = $spellchecker_toolbar = '';
......
Supports Markdown
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