N°2629 Allow user to choose default expanded/collapsed toolbar for richtext editors

This commit is contained in:
Stephen Abello
2020-12-04 10:53:22 +01:00
parent cc6e9492fd
commit 13d2699011
9 changed files with 90 additions and 16 deletions

View File

@@ -103,11 +103,14 @@ class ConsoleSimpleFieldRenderer extends FieldRenderer
// Some additional stuff if we are displaying it with a rich editor
if ($bRichEditor)
{
$sEditorLanguage = strtolower(trim(UserRights::GetUserLanguage()));
$aConfig = utils::GetCkeditorPref();
$aConfig['extraPlugins'] = 'codesnippet';
$sJsConfig = json_encode($aConfig);
$oOutput->AddJs(
<<<EOF
$('#{$this->oField->GetGlobalId()}').addClass('htmlEditor');
$('#{$this->oField->GetGlobalId()}').ckeditor(function(){}, {language: '$sEditorLanguage', contentsLanguage: '$sEditorLanguage', extraPlugins: 'codesnippet'});
$('#{$this->oField->GetGlobalId()}').ckeditor(function(){}, $sJsConfig);
EOF
);
if (($this->oField->GetObject() !== null) && ($this->oField->GetTransactionId() !== null))