allow better config options for spell checking in ckeditor (add BrowserBased only)

This commit is contained in:
Klaus Leithoff 2013-03-18 15:36:27 +00:00
parent 8f2c59ac45
commit 6204999b19
2 changed files with 9 additions and 5 deletions

View File

@ -115,6 +115,7 @@
<option value="">{lang_No}</option> <option value="">{lang_No}</option>
<option value="True"{selected_enabled_spellcheck_True}>{lang_Yes}</option> <option value="True"{selected_enabled_spellcheck_True}>{lang_Yes}</option>
<option value="YesNoSCAYT"{selected_enabled_spellcheck_YesNoSCAYT}>{lang_Yes,_but_no_SCAYT}</option> <option value="YesNoSCAYT"{selected_enabled_spellcheck_YesNoSCAYT}>{lang_Yes,_but_no_SCAYT}</option>
<option value="YesBrowserBased"{selected_enabled_spellcheck_YesBrowserBased}>{lang_Yes,_use_browser_based_spell_checking_engine}</option>
<option value="YesUseWebSpellCheck"{selected_enabled_spellcheck_YesUseWebSpellCheck}>{lang_Yes,_use_WebSpellChecker}</option> <option value="YesUseWebSpellCheck"{selected_enabled_spellcheck_YesUseWebSpellCheck}>{lang_Yes,_use_WebSpellChecker}</option>
</select> </select>
</td> </td>

View File

@ -238,28 +238,31 @@ class egw_ckeditor_config
private static function add_spellchecker_options(&$config, &$spellchecker_button, &$scayt_button) private static function add_spellchecker_options(&$config, &$spellchecker_button, &$scayt_button)
{ {
//error_log(__METHOD__.__LINE__.' Spellcheck:'.$GLOBALS['egw_info']['server']['enabled_spellcheck']); //error_log(__METHOD__.__LINE__.' Spellcheck:'.$GLOBALS['egw_info']['server']['enabled_spellcheck']);
if (isset($GLOBALS['egw_info']['server']['enabled_spellcheck'])) if (isset($GLOBALS['egw_info']['server']['enabled_spellcheck']) && $GLOBALS['egw_info']['server']['enabled_spellcheck'])
{ {
// enable browsers native spellchecker as default, if e.g.: aspell fails // enable browsers native spellchecker as default, if e.g.: aspell fails
// to use browsers native spellchecker, you have to hold CMD/CTRL button on rightclick to // to use browsers native spellchecker, you have to hold CMD/CTRL button on rightclick to
// access the browsers spell correction options // access the browsers spell correction options
$config['disableNativeSpellChecker'] = false; if ($GLOBALS['egw_info']['server']['enabled_spellcheck']!='YesNoSCAYT') $config['disableNativeSpellChecker'] = false;
$spellchecker_button = 'SpellChecker'; $spellchecker_button = 'SpellChecker';
if (!empty($GLOBALS['egw_info']['server']['aspell_path']) && if (!empty($GLOBALS['egw_info']['server']['aspell_path']) &&
is_executable($GLOBALS['egw_info']['server']['aspell_path']) && is_executable($GLOBALS['egw_info']['server']['aspell_path']) &&
!($GLOBALS['egw_info']['server']['enabled_spellcheck']=='YesUseWebSpellCheck') ($GLOBALS['egw_info']['server']['enabled_spellcheck']!='YesUseWebSpellCheck' &&
$GLOBALS['egw_info']['server']['enabled_spellcheck']!='YesBrowserBased')
) )
{ {
$spellchecker_button = 'SpellCheck'; $spellchecker_button = 'SpellCheck';
$config['extraPlugins'] = "aspell"; $config['extraPlugins'] = "aspell";
} }
if (!($GLOBALS['egw_info']['server']['enabled_spellcheck']=='YesNoSCAYT')) if ($GLOBALS['egw_info']['server']['enabled_spellcheck']!='YesNoSCAYT' &&
$GLOBALS['egw_info']['server']['enabled_spellcheck']!='YesBrowserBased'
)
{ {
$scayt_button='Scayt'; $scayt_button='Scayt';
$config['scayt_autoStartup'] = true; $config['scayt_autoStartup'] = true;
$config['scayt_sLang'] = self::get_lang().'_'.self::get_country(); $config['scayt_sLang'] = self::get_lang().'_'.self::get_country();
$config['disableNativeSpellChecker'] = true; // only one spell as you type
} }
} }
else else
{ {