Skip to content

Commit

Permalink
define base url and sufix for mail editor
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat authored Dec 14, 2023
1 parent 53ec9c1 commit 564e778
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
15 changes: 7 additions & 8 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
| Q | A |
|---------------|----------------------------------------------------|
| Branch? | dev-master for features / 4.x for bug fixes |
| Bug fix? | yes/no |
| New feature? | yes/no |
| BC breaks? | no |
| Deprecations? | yes/no |
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> |
| Q | A
| ------------- | ---
| Bug fix? | yes/no
| New feature? | yes/no
| BC breaks? | no
| Deprecations? | yes/no
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
Expand Down
3 changes: 3 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Upgrade Notes

## 5.0.2
- Fix Mail Layout Editor base path [#426](https://github.com/dachcom-digital/pimcore-formbuilder/issues/426)

## 5.0.1
- Fix Mail Layout Editor Availability State [#420](https://github.com/dachcom-digital/pimcore-formbuilder/issues/420)

Expand Down
23 changes: 21 additions & 2 deletions public/js/extjs/extensions/formMailEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,32 @@ Formbuilder.extjs.extensions.formMailEditor = Class.create({

initEditor: function (type, editorId, locale) {

var editorInstance;
const userLanguage = pimcore.globalmanager.get('user').language;

let editorInstance,
language,
languageMapping = {
fr: 'fr_FR',
pt: 'pt_PT',
sv: 'sv_SE',
th: 'th_TH',
hu: 'hu_HU'
};

if (this.editors.hasOwnProperty(editorId)) {
return;
}

language = languageMapping[userLanguage];

if (!language) {
language = userLanguage;
}

editorInstance = tinymce.init({
icons: 'customIcons',
height: 500,
language: pimcore.settings['language'],
language: language,
resize: false,
menubar: false,
block_unsupported_drop: false,
Expand All @@ -328,6 +344,9 @@ Formbuilder.extjs.extensions.formMailEditor = Class.create({
table_advtab: false,
table_row_advtab: false,
table_cell_advtab: false,
base_url: '/bundles/pimcoretinymce/build/tinymce',
suffix: '.min',
convert_urls: false,
content_style: `
.mce-content-body inline-token[contentEditable=false][data-mce-selected] {
Expand Down

0 comments on commit 564e778

Please sign in to comment.