diff --git a/recipes/2.0/manifest.json b/recipes/2.0/manifest.json index a33a848a..b13c2b36 100644 --- a/recipes/2.0/manifest.json +++ b/recipes/2.0/manifest.json @@ -6,5 +6,9 @@ }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" + }, + "env": { + "MONSIEURBIZ_SYLIUS_RICH_EDITOR_UPLOAD_DIR": "/media/rich-editor", + "MONSIEURBIZ_SYLIUS_RICH_EDITOR_IMAGE_UPLOAD_DIR": "/media/image" } } diff --git a/src/Resources/config/config.yaml b/src/Resources/config/config.yaml index b7c77796..fc87185a 100644 --- a/src/Resources/config/config.yaml +++ b/src/Resources/config/config.yaml @@ -13,3 +13,14 @@ knp_gaufrette: filesystems: monsieurbiz_rich_editor_fixture_file: adapter: 'monsieurbiz_rich_editor_fixture_file' + +parameters: + env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UPLOAD_DIR): /media/rich-editor + env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_IMAGE_UPLOAD_DIR): /media/image + +liip_imagine: + loaders: + default: + filesystem: + data_root: + - "%sylius_core.public_dir%/%env(MONSIEURBIZ_SYLIUS_RICH_EDITOR_UPLOAD_DIR)%" diff --git a/src/Resources/config/images.yaml b/src/Resources/config/images.yaml index ce90e568..f034af7c 100644 --- a/src/Resources/config/images.yaml +++ b/src/Resources/config/images.yaml @@ -4,3 +4,4 @@ liip_imagine: filters: thumbnail: { size: [400, 400], mode: inset } relative_resize: { widen: 32 } + monsieurbiz_rich_editor_image: ~ diff --git a/src/Resources/config/richeditor.yaml b/src/Resources/config/richeditor.yaml index 812cb3ba..5262b866 100644 --- a/src/Resources/config/richeditor.yaml +++ b/src/Resources/config/richeditor.yaml @@ -1,6 +1,6 @@ monsieurbiz_sylius_richeditor: - upload_directory: '/media/rich-editor' - image_upload_directory: '/media/image' + upload_directory: "%env(resolve:MONSIEURBIZ_SYLIUS_RICH_EDITOR_UPLOAD_DIR)%" + image_upload_directory: "%env(resolve:MONSIEURBIZ_SYLIUS_RICH_EDITOR_IMAGE_UPLOAD_DIR)%" ui_elements: monsieurbiz.html: alias: html diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index c899cd58..068ea8c6 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -7,6 +7,7 @@ services: bind: string $monsieurbizRicheditorDefaultElement: '%monsieurbiz.richeditor.config.default_element%' string $monsieurbizRicheditorDefaultElementDataField: '%monsieurbiz.richeditor.config.default_element_data_field%' + string $monsieurbizRicheditorUploadDirectory: '%monsieurbiz.richeditor.config.upload_directory%' Gaufrette\FilesystemInterface $filesystem: '@gaufrette.monsieurbiz_rich_editor_fixture_file_filesystem' MonsieurBiz\SyliusRichEditorPlugin\Controller\: diff --git a/src/Resources/views/Admin/UiElement/image.html.twig b/src/Resources/views/Admin/UiElement/image.html.twig index 01d59184..bb7513ad 100644 --- a/src/Resources/views/Admin/UiElement/image.html.twig +++ b/src/Resources/views/Admin/UiElement/image.html.twig @@ -13,10 +13,10 @@
{% if element.link is not empty %} - + {% else %} - + {% endif %}
{% endif %} diff --git a/src/Resources/views/Admin/UiElement/image_collection.html.twig b/src/Resources/views/Admin/UiElement/image_collection.html.twig index 2875d203..79f1e772 100644 --- a/src/Resources/views/Admin/UiElement/image_collection.html.twig +++ b/src/Resources/views/Admin/UiElement/image_collection.html.twig @@ -9,10 +9,10 @@
{{ 'monsieurbiz_richeditor_plugin.form.current_image' | trans }}
-
+
diff --git a/src/Resources/views/Shop/UiElement/image.html.twig b/src/Resources/views/Shop/UiElement/image.html.twig index 01d59184..bb7513ad 100644 --- a/src/Resources/views/Shop/UiElement/image.html.twig +++ b/src/Resources/views/Shop/UiElement/image.html.twig @@ -13,10 +13,10 @@
{% if element.link is not empty %} - + {% else %} - + {% endif %}
{% endif %} diff --git a/src/Resources/views/Shop/UiElement/image_collection.html.twig b/src/Resources/views/Shop/UiElement/image_collection.html.twig index 2875d203..79f1e772 100644 --- a/src/Resources/views/Shop/UiElement/image_collection.html.twig +++ b/src/Resources/views/Shop/UiElement/image_collection.html.twig @@ -9,10 +9,10 @@