Fix: Correction probleme fckeditor si utilisation d'un theme qui ne personalise pas fckeditor

This commit is contained in:
Laurent Destailleur 2006-08-14 19:09:23 +00:00
parent 12c8092490
commit d1e970b5aa
2 changed files with 36 additions and 43 deletions

View File

@ -20,8 +20,6 @@
FCKConfig.CustomConfigurationsPath = '' ; FCKConfig.CustomConfigurationsPath = '' ;
print FCKConfig.BasePath;
FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ; FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
FCKConfig.DocType = '' ; FCKConfig.DocType = '' ;
@ -79,46 +77,35 @@ FCKConfig.FloatingPanelsZIndex = 10000 ;
FCKConfig.ToolbarLocation = 'In' ; FCKConfig.ToolbarLocation = 'In' ;
FCKConfig.ToolbarSets["dolibarr_mailings"] = [ FCKConfig.ToolbarSets["dolibarr_mailings"] = [
['Source','DocProps','-','Save','NewPage','Preview'], ['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'], ['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','About'], ['Undo','Redo','-','Find','Replace','-','SelectAll'],
'/', ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'], ['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink'], ['Link','Unlink','Anchor','Image','Table','Rule','Smiley','SpecialChar','UniversalKey'],
['SelectAll','RemoveFormat'], ['FontName','FontSize']
'/',
['FontName','FontSize'],
['Rule','SpecialChar','TextColor','BGColor','FitWindow']
] ; ] ;
FCKConfig.ToolbarSets["dolibarr_notes"] = [ FCKConfig.ToolbarSets["dolibarr_notes"] = [
['Source','DocProps','-','Save','NewPage','Preview'], ['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'], ['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','-','Preview','Print'],
['Undo','Redo','-','Find','Replace','-','About'], ['Undo','Redo','-','Find','Replace','-','SelectAll'],
'/', ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'], ['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink'], ['Link','Unlink','Anchor','Image','Table','Rule','SpecialChar','UniversalKey'],
['SelectAll','RemoveFormat'], ['FontName','FontSize']
'/',
['FontName','FontSize'],
['Rule','SpecialChar','TextColor','BGColor','FitWindow']
] ; ] ;
FCKConfig.ToolbarSets["dolibarr_details"] = [ FCKConfig.ToolbarSets["dolibarr_details"] = [
['Source','DocProps','-','Save','NewPage','Preview'], ['FitWindow','Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'], ['Cut','Copy','Paste','-','Preview'],
['Undo','Redo','-','Find','Replace','-','About'], ['Undo','Redo'],
'/', ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor','-','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'], ['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink'], ['Link','Unlink','Anchor'],
['SelectAll','RemoveFormat'], ['SpecialChar','UniversalKey'],
'/', ['FontName','FontSize']
['FontName','FontSize'],
['Rule','SpecialChar','TextColor','BGColor','FitWindow']
] ; ] ;
FCKConfig.ToolbarSets["Default"] = [ FCKConfig.ToolbarSets["Default"] = [

View File

@ -60,16 +60,22 @@ class DolEditor
$this->editor = new FCKeditor($htmlname); $this->editor = new FCKeditor($htmlname);
$this->editor->Value = $content; $this->editor->Value = $content;
$this->editor->Height = $height; $this->editor->Height = $height;
$this->editor->ToolbarSet = $toolbarname;
$this->editor->Config['AutoDetectLanguage'] = 'true';
$this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In';
$this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded;
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js')) if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js'))
{ {
$this->editor->Config['CustomConfigurationsPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js'; $this->editor->Config['CustomConfigurationsPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js';
$this->editor->ToolbarSet = $toolbarname;
$this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In';
$this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded;
$this->editor->Config['SkinPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/'; $this->editor->Config['SkinPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/';
// if ($langs->origlang=='auto') // if ($langs->origlang!='auto')
// {
// }
}
else
{
// if ($langs->origlang!='auto')
// { // {
$this->editor->Config['AutoDetectLanguage'] = 'true';
// } // }
} }
} }