From 0990434b4ef924ad02671542b0c84955e40383a5 Mon Sep 17 00:00:00 2001 From: wladyslaw Date: Tue, 21 Sep 2021 15:23:12 +0200 Subject: [PATCH] Added FileWithTitleType.php, update custom_bootstrap_4_horizontal_layout.html.twig --- composer.json | 4 ++- ...om_bootstrap_4_horizontal_layout.html.twig | 12 +------ src/Type/FileWithTitleType.php | 36 +++++++++++++++++++ src/Type/SingleAttachmentType.php | 2 +- 4 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 src/Type/FileWithTitleType.php diff --git a/composer.json b/composer.json index d999807..a32bd29 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,9 @@ ], "require": { "php": "^7.1.3", - "artgris/filemanager-bundle": "^2.2" + "artgris/filemanager-bundle": "^2.2", + "twin-elements/seo-bundle": "^1.0", + "symfony/framework-bundle": "^4.4" }, "autoload": { "psr-4": { diff --git a/src/Resources/views/custom_bootstrap_4_horizontal_layout.html.twig b/src/Resources/views/custom_bootstrap_4_horizontal_layout.html.twig index 83401c4..dc7e696 100644 --- a/src/Resources/views/custom_bootstrap_4_horizontal_layout.html.twig +++ b/src/Resources/views/custom_bootstrap_4_horizontal_layout.html.twig @@ -1,5 +1,6 @@ {% use 'bootstrap_4_horizontal_layout.html.twig' %} {% use '@TwinElementsAdmin/block/blocks.html.twig' %} +{% use '@TwinElementsSeo/seo-fields.html.twig' %} {% block tinymce_type_row %}
@@ -59,17 +60,6 @@
{% endblock choice_widget_expanded %} -{% block seo_type_row %} -
- -
- {% for child in form.children %} - {{ form_row(child) }} - {% endfor %} -
-
-{% endblock %} - {% block images_type_widget %} {% for choice in choices %}
diff --git a/src/Type/FileWithTitleType.php b/src/Type/FileWithTitleType.php new file mode 100644 index 0000000..d091f9d --- /dev/null +++ b/src/Type/FileWithTitleType.php @@ -0,0 +1,36 @@ +add('title', TextType::class, [ + 'label' => 'Tytuł pliku' + ]) + ->add('file', TEUploadType::class, [ + 'label' => 'Plik', + 'required' => false, + 'conf' => $options['conf'] + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('conf', null) + ->setDefault('file_type', null); + } + + public function getBlockPrefix() + { + return 'file_with_title_type'; + } +} diff --git a/src/Type/SingleAttachmentType.php b/src/Type/SingleAttachmentType.php index b0cf570..c223f31 100644 --- a/src/Type/SingleAttachmentType.php +++ b/src/Type/SingleAttachmentType.php @@ -29,6 +29,6 @@ public function configureOptions(OptionsResolver $resolver) public function getBlockPrefix() { - return 'custom_bundle_single_attachment_type'; + return 'single_attachment_type'; } }