Merge branch 'w30_MDL-38867_m25_gspell' of https://github.com/skodak/moodle into MOODLE_25_STABLE

This commit is contained in:
Dan Poltawski
2013-07-22 17:00:56 +08:00
3 changed files with 12 additions and 13 deletions
@@ -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;
@@ -36,6 +36,12 @@ class tinymce_spellchecker extends editor_tinymce_plugin {
return;
}
// 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 !== '') {
@@ -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,' .