Commit 32664225 authored by Christopher Tombleson's avatar Christopher Tombleson
Browse files

Changed Tiny-Mce default spellchecker to aspell



If aspell is found on the system use it for spellchecking.
Otherwise use GoogleSpell.

Bug#812030

Also renamed the error() function in htdocs/js/tinymce/plugins/spellchecker/includes/general.php
to mceError() because it conflicts with the mahara defined error() function.

Change-Id: I71f17cb29c7dfcd5ea9731c2c1b8e2a64fcc46ef
Signed-off-by: default avatarChristopher Tombleson <christopher@catalyst.net.nz>
parent bcdb22cf
......@@ -9,3 +9,5 @@ Changes:
* Additional files in the eu and zh language packs
* Removed unused media plugin to fix Debian bug #591200
* Removed the standard spellchecker plugin and replace with the php spellchecker plugin
* Edited spellchecker config.php to check if a path for aspell is set
* Renamed error function in plugins/spellchecker/includes/general.php to mceError
......@@ -6,6 +6,14 @@
*/
// General settings
$config['general.engine'] = 'GoogleSpell';
define('INTERNAL', 1);
require_once(dirname(__FILE__).'/../../../../init.php');
$aspellpath = get_config('pathtoaspell');
if (file_exists($aspellpath) && is_executable($aspellpath)) {
$config['general.engine'] = 'PSpellShell';
}
//$config['general.engine'] = 'PSpell';
//$config['general.engine'] = 'PSpellShell';
//$config['general.remote_rpc_url'] = 'http://some.other.site/some/url/rpc.php';
......@@ -18,7 +26,7 @@
// PSpellShell settings
$config['PSpellShell.mode'] = PSPELL_FAST;
$config['PSpellShell.aspell'] = '/usr/bin/aspell';
$config['PSpellShell.aspell'] = $aspellpath;
$config['PSpellShell.tmp'] = '/tmp';
// Windows PSpellShell settings
......
......@@ -74,7 +74,7 @@ function info($msg) {
$log->info(implode(', ', $args));
}
function error($msg) {
function mceError($msg) {
$args = func_get_args();
$log = getLogger();
......@@ -95,4 +95,4 @@ function fatal($msg) {
$log->fatal(implode(', ', $args));
}
?>
\ No newline at end of file
?>
......@@ -197,6 +197,7 @@ $cfg->maximageresizememory = 104857600;
$cfg->pathtogzip = '/bin/gzip';
$cfg->pathtounzip = '/usr/bin/unzip';
$cfg->pathtozip = '/usr/bin/zip';
$cfg->pathtoaspell = '/usr/bin/aspell';
$cfg->ziprecursearg = '-r';
$cfg->unzipdirarg = '-d';
$cfg->unziplistarg = '-l';
......
......@@ -120,6 +120,7 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
$toolbar_align = 'left';
if ($check[$key] == 'tinymce') {
$spellchecker_rpc = $jsroot.'tinymce/plugins/spellchecker/rpc.php';
$tinymce_config = <<<EOF
mode: "none",
theme: "advanced",
......@@ -130,6 +131,7 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "{$toolbar_align}",
fix_list_elements: true,
spellchecker_rpc_url : "{$spellchecker_rpc}",
//width: '512',
EOF;
}
......
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