From 7831560995bfeada5045f3522658ff2e11415228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Wed, 17 Jul 2013 21:10:16 +0200 Subject: [PATCH] MDL-38867 remove Google spell checking option --- .../tinymce/plugins/spellchecker/config.php | 15 ++++----------- lib/editor/tinymce/plugins/spellchecker/lib.php | 6 ++++++ .../tinymce/plugins/spellchecker/settings.php | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/editor/tinymce/plugins/spellchecker/config.php b/lib/editor/tinymce/plugins/spellchecker/config.php index 4f1ac23e6e4..98adf18e4cd 100644 --- a/lib/editor/tinymce/plugins/spellchecker/config.php +++ b/lib/editor/tinymce/plugins/spellchecker/config.php @@ -28,25 +28,18 @@ require('../../../../../config.php'); // General settings $engine = get_config('tinymce_spellchecker', 'spellengine'); -if (!$engine) { - $engine = 'GoogleSpell'; +if (!$engine or $engine === 'GoogleSpell') { + $engine = 'PSpell'; } $config['general.engine'] = $engine; -// GoogleSpell settings -$config['GoogleSpell.proxyhost'] = isset($CFG->proxyhost) ? $CFG->proxyhost : ''; -$config['GoogleSpell.proxyport'] = isset($CFG->proxyport) ? $CFG->proxyport : ''; -$config['GoogleSpell.proxytype'] = isset($CFG->proxytype) ? $CFG->proxytype : 'HTML'; -$config['GoogleSpell.proxyuser'] = isset($CFG->proxyuser) ? $CFG->proxyuser : ''; -$config['GoogleSpell.proxypassword'] = isset($CFG->proxypassword) ? $CFG->proxypassword : ''; - -if ($config['general.engine'] === 'PSpell' || $config['general.engine'] === 'PSpellShell') { +if ($config['general.engine'] === 'PSpell') { // PSpell settings $config['PSpell.mode'] = PSPELL_FAST; $config['PSpell.spelling'] = ""; $config['PSpell.jargon'] = ""; $config['PSpell.encoding'] = ""; - +} else if ($config['general.engine'] === 'PSpellShell') { // PSpellShell settings $config['PSpellShell.mode'] = PSPELL_FAST; $config['PSpellShell.aspell'] = $CFG->aspellpath; diff --git a/lib/editor/tinymce/plugins/spellchecker/lib.php b/lib/editor/tinymce/plugins/spellchecker/lib.php index b4f51180013..9a39e6549b4 100644 --- a/lib/editor/tinymce/plugins/spellchecker/lib.php +++ b/lib/editor/tinymce/plugins/spellchecker/lib.php @@ -32,6 +32,12 @@ class tinymce_spellchecker extends editor_tinymce_plugin { array $options = null) { global $CFG; + // Check some speller is configured. + $engine = $this->get_config('spellengine', ''); + if (!$engine or $engine === 'GoogleSpell') { + return; + } + // Check at least one language is supported. $spelllanguagelist = $this->get_config('spelllanguagelist', ''); if ($spelllanguagelist !== '') { diff --git a/lib/editor/tinymce/plugins/spellchecker/settings.php b/lib/editor/tinymce/plugins/spellchecker/settings.php index c4081e3a2ea..2be8fde4dd4 100644 --- a/lib/editor/tinymce/plugins/spellchecker/settings.php +++ b/lib/editor/tinymce/plugins/spellchecker/settings.php @@ -26,11 +26,11 @@ defined('MOODLE_INTERNAL') || die; if ($ADMIN->fulltree) { $options = array( + ''=>get_string('none'), 'PSpell'=>'PSpell', - 'GoogleSpell'=>'Google Spell', 'PSpellShell'=>'PSpellShell'); $settings->add(new admin_setting_configselect('tinymce_spellchecker/spellengine', - get_string('spellengine', 'admin'), '', 'GoogleSpell', $options)); + get_string('spellengine', 'admin'), '', '', $options)); $settings->add(new admin_setting_configtextarea('tinymce_spellchecker/spelllanguagelist', get_string('spelllanguagelist', 'admin'), '', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,' .