Pārlūkot izejas kodu

Correctif CKEditor

feature/symfony6.1
Guillaume pirms 3 gadiem
vecāks
revīzija
01299ec775
4 mainītis faili ar 12 papildinājumiem un 8 dzēšanām
  1. +2
    -1
      EventSubscriber/SiteSettingEventSubscriber.php
  2. +4
    -1
      Form/Setting/BaseSettingType.php
  3. +0
    -5
      Resources/views/adminlte/crud/form.html.twig
  4. +6
    -1
      Resources/views/adminlte/layout.html.twig

+ 2
- 1
EventSubscriber/SiteSettingEventSubscriber.php Parādīt failu

@@ -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);

+ 4
- 1
Form/Setting/BaseSettingType.php Parādīt failu

@@ -53,7 +53,10 @@ abstract class BaseSettingType extends AbstractType
'text',
CKEditorType::class,
[
'label' => $label
'label' => $label,
'attr' => [
'class' => 'field-text_editor'
]
]
);
} elseif ($settingType == 'select') {

+ 0
- 5
Resources/views/adminlte/crud/form.html.twig Parādīt failu

@@ -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 %}

+ 6
- 1
Resources/views/adminlte/layout.html.twig Parādīt failu

@@ -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 }}

Notiek ielāde…
Atcelt
Saglabāt