@@ -83,13 +83,14 @@ class SiteSettingEventSubscriber implements EventSubscriberInterface | |||
} | |||
$entitySetting = $factory->create($site, $setting['name'], $text, $date, $file); | |||
$this->entityManager->create($entitySetting); | |||
$this->entityManager->persist($entitySetting); | |||
} else { | |||
$methodGetValue = 'get' . ucfirst($setting['field']); | |||
if ($entitySetting->$methodGetValue() === null | |||
&& isset($setting['default']) | |||
&& $setting['default'] !== null) { | |||
$methodSetValue = 'set' . ucfirst($setting['field']); | |||
$entitySetting->$methodSetValue($setting['default']); | |||
$this->entityManager->update($entitySetting); |
@@ -53,7 +53,10 @@ abstract class BaseSettingType extends AbstractType | |||
'text', | |||
CKEditorType::class, | |||
[ | |||
'label' => $label | |||
'label' => $label, | |||
'attr' => [ | |||
'class' => 'field-text_editor' | |||
] | |||
] | |||
); | |||
} elseif ($settingType == 'select') { |
@@ -60,11 +60,6 @@ | |||
<script src="{{ asset(js_asset) }}"></script> | |||
{% endfor %} | |||
<script type="text/javascript"> | |||
var CKEDITOR_BASEPATH = "{{ ckeditor_base_path("/bundles/fosckeditor/") }}"; | |||
</script> | |||
<script type="text/javascript" src="{{ asset('bundles/fosckeditor/ckeditor.js') }}"></script> | |||
{% for webpack_encore_entry in form.vars.ea_crud_form.assets.webpackEncoreAssets %} | |||
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }} | |||
{% endfor %} |
@@ -27,7 +27,6 @@ | |||
<link rel="stylesheet" href="{{ asset(css_asset) }}"> | |||
{% endfor %} | |||
{% for webpack_encore_entry in ea.assets.webpackEncoreAssets ?? [] %} | |||
{{ ea_call_function_if_exists('encore_entry_link_tags', webpack_encore_entry) }} | |||
{% endfor %} | |||
@@ -47,6 +46,12 @@ | |||
<link rel="stylesheet" href="{{ asset('bundles/easyadmin/app-custom-rtl.css') }}"> | |||
{% endif %} #} | |||
{# CKEditor #} | |||
<script type="text/javascript"> | |||
var CKEDITOR_BASEPATH = "{{ ckeditor_base_path("/bundles/fosckeditor/") }}"; | |||
</script> | |||
<script type="text/javascript" src="{{ asset('bundles/fosckeditor/ckeditor.js') }}"></script> | |||
{% block configured_head_contents %} | |||
{% for htmlContent in ea.assets.headContents ?? [] %} | |||
{{ htmlContent|raw }} |