Enabling the new prefs & admin settings in fckeditor html class function

This commit is contained in:
José Luis Gordo Romero 2007-12-20 06:15:56 +00:00
parent de333e0726
commit 71d98434fe
4 changed files with 93 additions and 10 deletions

View File

@ -503,20 +503,50 @@ class html
}
// switching the encoding as html entities off, as we correctly handle charsets and it messes up the wiki totally
$oFCKeditor->Config['ProcessHTMLEntities'] = false;
// Now setting the admin settings
$spell = '';
if (isset($GLOBALS['egw_info']['server']['enabled_spellcheck']))
{
$spell = '_spellcheck';
$oFCKeditor->Config['SpellChecker'] = 'SpellerPages';
$oFCKeditor->Config['SpellerPagesServerScript'] = 'server-scripts/spellchecker.php?enabled=1';
if (isset($GLOBALS['egw_info']['server']['aspell_path']))
{
$oFCKeditor->Config['SpellerPagesServerScript'] .= '&aspell_path='.$GLOBALS['egw_info']['server']['aspell_path'];
}
if (isset($GLOBALS['egw_info']['user']['preferences']['common']['spellchecker_lang']))
{
$oFCKeditor->Config['SpellerPagesServerScript'] .= '&spellchecker_lang='.$GLOBALS['egw_info']['user']['preferences']['common']['spellchecker_lang'];
}
else
{
$oFCKeditor->Config['SpellerPagesServerScript'] .= '&spellchecker_lang='.$GLOBALS['egw_info']['user']['preferences']['common']['lang'];
}
$oFCKeditor->Config['FirefoxSpellChecker'] = false;
}
// Now setting the user preferences
if (isset($GLOBALS['egw_info']['user']['preferences']['common']['rte_enter_mode']))
{
$oFCKeditor->Config['EnterMode'] = $GLOBALS['egw_info']['user']['preferences']['common']['rte_enter_mode'];
}
if (isset($GLOBALS['egw_info']['user']['preferences']['common']['rte_skin']))
{
$oFCKeditor->Config['SkinPath'] = $oFCKeditor->BasePath.'editor/skins/'.$GLOBALS['egw_info']['user']['preferences']['common']['rte_skin'].'/';
}
switch($_mode) {
case 'simple':
$oFCKeditor->ToolbarSet = 'egw_simple';
$oFCKeditor->ToolbarSet = 'egw_simple'.$spell;
$oFCKeditor->Config['ContextMenu'] = false;
break;
default:
case 'extended':
$oFCKeditor->ToolbarSet = 'egw_extended';
$oFCKeditor->ToolbarSet = 'egw_extended'.$spell;
break;
case 'advanced':
$oFCKeditor->ToolbarSet = 'egw_advanced';
$oFCKeditor->ToolbarSet = 'egw_advanced'.$spell;
break;
}
return $oFCKeditor->CreateHTML();

View File

@ -3,10 +3,29 @@ header('Content-type: text/html; charset=utf-8');
// The following variables values must reflect your installation needs.
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
//$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
//$aspell_prog = 'aspell'; // by FredCK (for Linux)
$lang = 'en_US';
if ($_GET['aspell_path'])
{
$aspell_prog = $_GET['aspell_path'];
}
else
{
$aspell_prog = 'aspell';
}
if ($_GET['spellchecker_lang'])
{
$lang = $_GET['spellchecker_lang'];
}
else
{
$lang = 'en_US';
}
//$lang = 'en_US';
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK
$tempfiledir = "./";

View File

@ -5,6 +5,8 @@
- editor/filemanager/connectors/php/config.php
- Enable connector
- Get and set ServerPath var to configure userdir path
- Enable/configure aspell on (for spellchecker):
- editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php
--------------------------------------------------------
Changes made to fckeditor to work properly on egroupware

View File

@ -7,7 +7,15 @@ FCKConfig.ToolbarSets["egw_simple"] = [
['FontFormat','FontName','FontSize'],
['TextColor','BGColor']
] ;
FCKConfig.ToolbarSets["egw_simple_spellcheck"] = [
['Bold','Italic','Underline'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['UnorderedList','OrderedList','Outdent','Indent','Undo','Redo'],
['FitWindow','SpellCheck'],
'/',
['FontFormat','FontName','FontSize'],
['TextColor','BGColor']
] ;
FCKConfig.ToolbarSets["egw_extended"] = [
['Bold','Italic','Underline'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
@ -19,10 +27,20 @@ FCKConfig.ToolbarSets["egw_extended"] = [
['FontFormat','FontName','FontSize'],
['TextColor','BGColor']
] ;
FCKConfig.ToolbarSets["egw_extended_spellcheck"] = [
['Bold','Italic','Underline'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['UnorderedList','OrderedList','Outdent','Indent','Undo','Redo'],
['Link','Unlink','Anchor'],
['Find','Replace'],
['FitWindow','SpellCheck','Image','Table'],
'/',
['FontFormat','FontName','FontSize'],
['TextColor','BGColor']
] ;
FCKConfig.ToolbarSets["egw_advanced"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'/*,'SpellCheck'*/],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
@ -33,4 +51,18 @@ FCKConfig.ToolbarSets["egw_advanced"] = [
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor']
] ;
] ;
FCKConfig.ToolbarSets["egw_advanced_spellcheck"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['UnorderedList','OrderedList','-','Outdent','Indent'],
['Link','Unlink','Anchor'],
['FitWindow','Image',/*'Flash',*/'Table','Rule',/*'Smiley',*/'SpecialChar','PageBreak'], //,'UniversalKey'
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor']
] ;