From f861cd22a4cab8cd756f40583e070bd5c0688236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20B=C5=82oszyk?= Date: Fri, 22 May 2020 00:43:49 +0200 Subject: [PATCH] Add SonataFormBundle bridge --- .../SonataCoreExtension.php | 26 +++-- src/CoreBundle/Resources/config/core_date.xml | 8 ++ .../Resources/config/core_form_types.xml | 97 ++++++++++++++++++ .../Resources/config/core_validator.xml | 11 +++ src/CoreBundle/Resources/config/date.xml | 4 +- .../Resources/config/form_types.xml | 96 +++--------------- src/CoreBundle/Resources/config/validator.xml | 5 +- .../DependencyInjection/Configuration.php | 87 ++++++++++++++++ .../SonataFormExtension.php | 69 +++++++++++++ .../Bridge/Symfony/Resources/config/date.xml | 6 ++ .../Symfony/Resources/config/form_types.xml | 44 +++++++++ .../Symfony/Resources/config/validator.xml | 10 ++ .../Bridge/Symfony/Resources/meta/LICENSE | 21 ++++ .../translations/SonataFormBundle.ar.xliff | 35 +++++++ .../translations/SonataFormBundle.bg.xliff | 35 +++++++ .../translations/SonataFormBundle.ca.xliff | 35 +++++++ .../translations/SonataFormBundle.cs.xliff | 35 +++++++ .../translations/SonataFormBundle.de.xliff | 35 +++++++ .../translations/SonataFormBundle.en.xliff | 35 +++++++ .../translations/SonataFormBundle.es.xliff | 35 +++++++ .../translations/SonataFormBundle.eu.xliff | 35 +++++++ .../translations/SonataFormBundle.fa.xliff | 35 +++++++ .../translations/SonataFormBundle.fi.xliff | 35 +++++++ .../translations/SonataFormBundle.fr.xliff | 35 +++++++ .../translations/SonataFormBundle.hr.xliff | 35 +++++++ .../translations/SonataFormBundle.hu.xliff | 35 +++++++ .../translations/SonataFormBundle.it.xliff | 35 +++++++ .../translations/SonataFormBundle.ja.xliff | 35 +++++++ .../translations/SonataFormBundle.lb.xliff | 35 +++++++ .../translations/SonataFormBundle.lt.xliff | 35 +++++++ .../translations/SonataFormBundle.nl.xliff | 35 +++++++ .../translations/SonataFormBundle.pl.xliff | 35 +++++++ .../translations/SonataFormBundle.pt.xliff | 35 +++++++ .../translations/SonataFormBundle.pt_BR.xliff | 35 +++++++ .../translations/SonataFormBundle.ro.xliff | 35 +++++++ .../translations/SonataFormBundle.ru.xliff | 39 ++++++++ .../translations/SonataFormBundle.sk.xliff | 35 +++++++ .../translations/SonataFormBundle.sl.xliff | 35 +++++++ .../translations/SonataFormBundle.uk.xliff | 35 +++++++ .../translations/SonataFormBundle.zh_CN.xliff | 35 +++++++ .../Resources/views/Form/color.html.twig | 15 +++ .../views/Form/colorpicker.html.twig | 33 +++++++ .../Resources/views/Form/datepicker.html.twig | 99 +++++++++++++++++++ src/Form/Bridge/Symfony/SonataFormBundle.php | 20 ++++ 44 files changed, 1496 insertions(+), 104 deletions(-) create mode 100644 src/CoreBundle/Resources/config/core_date.xml create mode 100644 src/CoreBundle/Resources/config/core_form_types.xml create mode 100644 src/CoreBundle/Resources/config/core_validator.xml create mode 100644 src/Form/Bridge/Symfony/DependencyInjection/Configuration.php create mode 100644 src/Form/Bridge/Symfony/DependencyInjection/SonataFormExtension.php create mode 100644 src/Form/Bridge/Symfony/Resources/config/date.xml create mode 100644 src/Form/Bridge/Symfony/Resources/config/form_types.xml create mode 100644 src/Form/Bridge/Symfony/Resources/config/validator.xml create mode 100644 src/Form/Bridge/Symfony/Resources/meta/LICENSE create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ar.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.bg.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ca.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.cs.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.de.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.en.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.es.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.eu.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fa.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fi.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fr.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hr.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hu.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.it.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ja.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lb.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lt.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.nl.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pl.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt_BR.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ro.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ru.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sk.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sl.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.uk.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.zh_CN.xliff create mode 100644 src/Form/Bridge/Symfony/Resources/views/Form/color.html.twig create mode 100644 src/Form/Bridge/Symfony/Resources/views/Form/colorpicker.html.twig create mode 100644 src/Form/Bridge/Symfony/Resources/views/Form/datepicker.html.twig create mode 100644 src/Form/Bridge/Symfony/SonataFormBundle.php diff --git a/src/CoreBundle/DependencyInjection/SonataCoreExtension.php b/src/CoreBundle/DependencyInjection/SonataCoreExtension.php index afb98805..d0fa644c 100644 --- a/src/CoreBundle/DependencyInjection/SonataCoreExtension.php +++ b/src/CoreBundle/DependencyInjection/SonataCoreExtension.php @@ -92,14 +92,20 @@ public function load(array $configs, ContainerBuilder $container) } $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('date.xml'); + $loader->load('commands.xml'); + $loader->load('core.xml'); + $loader->load('core_form_types.xml'); + $loader->load('core_date.xml'); $loader->load('flash.xml'); - $loader->load('form_types.xml'); - $loader->load('validator.xml'); - $loader->load('twig.xml'); $loader->load('model_adapter.xml'); - $loader->load('core.xml'); - $loader->load('commands.xml'); + $loader->load('twig.xml'); + $loader->load('core_validator.xml'); + + if (!isset($bundles['SonataFormBundle'])) { + $loader->load('form_types.xml'); + $loader->load('date.xml'); + $loader->load('validator.xml'); + } $this->registerFlashTypes($container, $config); $container->setParameter('sonata.core.form_type', $config['form_type']); @@ -109,8 +115,6 @@ public function load(array $configs, ContainerBuilder $container) $this->configureClassesToCompile(); } - $this->deprecateSlugify($container); - $this->configureSerializerFormats($config); } @@ -203,10 +207,4 @@ public function configureSerializerFormats($config) BaseSerializerHandler::setFormats($config['serializer']['formats']); } } - - protected function deprecateSlugify(ContainerBuilder $container) - { - $container->getDefinition('sonata.core.slugify.cocur')->setDeprecated(true); - $container->getDefinition('sonata.core.slugify.native')->setDeprecated(true); - } } diff --git a/src/CoreBundle/Resources/config/core_date.xml b/src/CoreBundle/Resources/config/core_date.xml new file mode 100644 index 00000000..eac86daf --- /dev/null +++ b/src/CoreBundle/Resources/config/core_date.xml @@ -0,0 +1,8 @@ + + + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + diff --git a/src/CoreBundle/Resources/config/core_form_types.xml b/src/CoreBundle/Resources/config/core_form_types.xml new file mode 100644 index 00000000..1b724794 --- /dev/null +++ b/src/CoreBundle/Resources/config/core_form_types.xml @@ -0,0 +1,97 @@ + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.array" instead. + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.boolean" instead. + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.collection" instead. + + + + The "%service_id%" service is deprecated since 2.2.0 and will be removed in 4.0. + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.date_range" instead. + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_range" instead. + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.date_picker" instead. + + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_picker" instead. + + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.date_range_picker" instead. + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_range_picker" instead. + + + + + The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.equal" instead. + + + + + The "%service_id%" service is deprecated since 3.5 and will be removed in 4.0. + + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. + + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead. + + + diff --git a/src/CoreBundle/Resources/config/core_validator.xml b/src/CoreBundle/Resources/config/core_validator.xml new file mode 100644 index 00000000..553631f7 --- /dev/null +++ b/src/CoreBundle/Resources/config/core_validator.xml @@ -0,0 +1,11 @@ + + + + + The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.validator.inline" instead. + + + + + + diff --git a/src/CoreBundle/Resources/config/date.xml b/src/CoreBundle/Resources/config/date.xml index 79a4de6a..539bc77b 100644 --- a/src/CoreBundle/Resources/config/date.xml +++ b/src/CoreBundle/Resources/config/date.xml @@ -1,8 +1,6 @@ - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.date.moment_format_converter" instead. - + diff --git a/src/CoreBundle/Resources/config/form_types.xml b/src/CoreBundle/Resources/config/form_types.xml index a93a5cc6..d3d6606d 100644 --- a/src/CoreBundle/Resources/config/form_types.xml +++ b/src/CoreBundle/Resources/config/form_types.xml @@ -1,114 +1,42 @@ - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.array" instead. - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.boolean" instead. - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.collection" instead. - - - - The "%service_id%" service is deprecated since 2.2.0 and will be removed in 4.0. - - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.date_range" instead. - - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_range" instead. - - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.date_picker" instead. - - - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_picker" instead. - - - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.date_range_picker" instead. - - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_range_picker" instead. - - - - - The "%service_id%" service is deprecated since 3.x and will be removed in 4.0. Use "sonata.form.type.equal" instead. - - - - - The "%service_id%" service is deprecated since 3.5 and will be removed in 4.0. - - - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. - - - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.array" instead. + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.boolean" instead. + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.collection" instead. + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.date_range" instead. + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_range" instead. + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.date_picker" instead. + - + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_picker" instead. + - + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.date_range_picker" instead. + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.datetime_range_picker" instead. + - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.type.equal" instead. + diff --git a/src/CoreBundle/Resources/config/validator.xml b/src/CoreBundle/Resources/config/validator.xml index 553631f7..2cee884e 100644 --- a/src/CoreBundle/Resources/config/validator.xml +++ b/src/CoreBundle/Resources/config/validator.xml @@ -1,11 +1,10 @@ - - The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.form.validator.inline" instead. + - + diff --git a/src/Form/Bridge/Symfony/DependencyInjection/Configuration.php b/src/Form/Bridge/Symfony/DependencyInjection/Configuration.php new file mode 100644 index 00000000..33ec3736 --- /dev/null +++ b/src/Form/Bridge/Symfony/DependencyInjection/Configuration.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\Form\Bridge\Symfony\DependencyInjection; + +use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; +use Symfony\Component\Config\Definition\Builder\TreeBuilder; +use Symfony\Component\Config\Definition\ConfigurationInterface; + +/** + * This is the class that validates and merges configuration from your app/config files. + * + * @author Thomas Rabaix + * @author Alexander + */ +class Configuration implements ConfigurationInterface +{ + public function getConfigTreeBuilder(): TreeBuilder + { + $treeBuilder = new TreeBuilder('sonata_form'); + + // Keep compatibility with symfony/config < 4.2 + if (!method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->root('sonata_form'); + } else { + $rootNode = $treeBuilder->getRootNode(); + } + + $this->addFlashMessageSection($rootNode); + $this->addSerializerFormats($rootNode); + + return $treeBuilder; + } + + /** + * Returns configuration for flash messages. + */ + private function addFlashMessageSection(ArrayNodeDefinition $node): void + { + $node + ->children() + ->scalarNode('form_type') + ->defaultValue('standard') + ->validate() + ->ifNotInArray($validFormTypes = ['standard', 'horizontal']) + ->thenInvalid(sprintf( + 'The form_type option value must be one of %s', + $validFormTypesString = implode(', ', $validFormTypes) + )) + ->end() + ->info(sprintf('Must be one of %s', $validFormTypesString)) + ->end() + ->end() + ; + } + + /** + * Adds configuration for serializer formats. + */ + private function addSerializerFormats(ArrayNodeDefinition $node): void + { + $node + ->children() + ->arrayNode('serializer') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('formats') + ->prototype('scalar')->end() + ->defaultValue(['json', 'xml', 'yml']) + ->info('Default serializer formats, will be used while getting subscribing methods.') + ->end() + ->end() + ->end() + ->end() + ; + } +} diff --git a/src/Form/Bridge/Symfony/DependencyInjection/SonataFormExtension.php b/src/Form/Bridge/Symfony/DependencyInjection/SonataFormExtension.php new file mode 100644 index 00000000..9da3517c --- /dev/null +++ b/src/Form/Bridge/Symfony/DependencyInjection/SonataFormExtension.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\Form\Bridge\Symfony\DependencyInjection; + +use JMS\Serializer\Handler\SubscribingHandlerInterface; +use Sonata\Form\Serializer\BaseSerializerHandler; +use Symfony\Component\Config\Definition\Processor; +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; + +/** + * @author Thomas Rabaix + */ +final class SonataFormExtension extends Extension implements PrependExtensionInterface +{ + public function prepend(ContainerBuilder $container): void + { + $configs = $container->getExtensionConfig('sonata_admin'); + + foreach ($configs as $config) { + if (isset($config['options']['form_type'])) { + $container->prependExtensionConfig( + $this->getAlias(), + ['form_type' => $config['options']['form_type']] + ); + } + } + } + + public function load(array $configs, ContainerBuilder $container): void + { + $processor = new Processor(); + $configuration = new Configuration(); + $config = $processor->processConfiguration($configuration, $configs); + + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('date.xml'); + $loader->load('form_types.xml'); + $loader->load('validator.xml'); + + $container->setParameter('sonata.form.form_type', $config['form_type']); + + $this->configureSerializerFormats($config); + } + + /** + * @param mixed[] $config + */ + private function configureSerializerFormats(array $config): void + { + if (interface_exists(SubscribingHandlerInterface::class)) { + BaseSerializerHandler::setFormats($config['serializer']['formats']); + } + } +} diff --git a/src/Form/Bridge/Symfony/Resources/config/date.xml b/src/Form/Bridge/Symfony/Resources/config/date.xml new file mode 100644 index 00000000..539bc77b --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/config/date.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Form/Bridge/Symfony/Resources/config/form_types.xml b/src/Form/Bridge/Symfony/Resources/config/form_types.xml new file mode 100644 index 00000000..d3d6606d --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/config/form_types.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Form/Bridge/Symfony/Resources/config/validator.xml b/src/Form/Bridge/Symfony/Resources/config/validator.xml new file mode 100644 index 00000000..2cee884e --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/config/validator.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/Form/Bridge/Symfony/Resources/meta/LICENSE b/src/Form/Bridge/Symfony/Resources/meta/LICENSE new file mode 100644 index 00000000..ad4c9cc7 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/meta/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010-2015 thomas.rabaix@sonata-project.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ar.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ar.xliff new file mode 100644 index 00000000..0b467d92 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ar.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + إضافة جديدة + + + label_type_yes + نعم + + + label_type_no + لا يحتوي + + + label_type_equals + يساوي + + + label_type_not_equals + لا تساوي + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.bg.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.bg.xliff new file mode 100644 index 00000000..d883c9c5 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.bg.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Добавяне + + + label_type_yes + да + + + label_type_no + не + + + label_type_equals + съвпада със + + + label_type_not_equals + не съвпада със + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ca.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ca.xliff new file mode 100644 index 00000000..9310d65a --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ca.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Afegeix + + + label_type_yes + + + + label_type_no + no + + + label_type_equals + és igual a + + + label_type_not_equals + no és igual a + + + date_range_start + Data inicial + + + date_range_end + Data final + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.cs.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.cs.xliff new file mode 100644 index 00000000..410210ac --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.cs.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Přidat nový + + + label_type_yes + ano + + + label_type_no + ne + + + label_type_equals + rovná se + + + label_type_not_equals + nerovná se + + + date_range_start + Od + + + date_range_end + Do + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.de.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.de.xliff new file mode 100644 index 00000000..cfb8b6bd --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.de.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Neu + + + label_type_yes + ja + + + label_type_no + nein + + + label_type_equals + ist gleich + + + label_type_not_equals + ist nicht gleich + + + date_range_start + Von + + + date_range_end + Bis + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.en.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.en.xliff new file mode 100644 index 00000000..85c45f17 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.en.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Add new + + + label_type_yes + yes + + + label_type_no + no + + + label_type_equals + is equal to + + + label_type_not_equals + is not equal to + + + date_range_start + From + + + date_range_end + To + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.es.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.es.xliff new file mode 100644 index 00000000..e912ae5b --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.es.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Agregar nuevo + + + label_type_yes + + + + label_type_no + no + + + label_type_equals + igual a + + + label_type_not_equals + diferente a + + + date_range_start + Fecha inicial + + + date_range_end + Fecha final + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.eu.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.eu.xliff new file mode 100644 index 00000000..56845f58 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.eu.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Berria gehitu + + + label_type_yes + Bai + + + label_type_no + Ez + + + label_type_equals + berdina da + + + label_type_not_equals + ez da berdina + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fa.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fa.xliff new file mode 100644 index 00000000..b8368676 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fa.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + اضافه کردن جدید + + + label_type_yes + بله + + + label_type_no + خیر + + + label_type_equals + برابر است با + + + label_type_not_equals + برابر نیست با + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fi.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fi.xliff new file mode 100644 index 00000000..4ff43e47 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fi.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Lisää uusi + + + label_type_yes + kyllä + + + label_type_no + ei + + + label_type_equals + on yhtä kuin + + + label_type_not_equals + ei ole yhtä kuin + + + date_range_start + Alkaen + + + date_range_end + Saakka + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fr.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fr.xliff new file mode 100644 index 00000000..f7c3e39a --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.fr.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Ajouter + + + label_type_yes + oui + + + label_type_no + non + + + label_type_equals + Est égal à + + + label_type_not_equals + Ne contient pas + + + date_range_start + Du + + + date_range_end + Au + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hr.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hr.xliff new file mode 100644 index 00000000..d3c149ce --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hr.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Novi unos + + + label_type_yes + da + + + label_type_no + ne + + + label_type_equals + jednak + + + label_type_not_equals + nije jednak + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hu.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hu.xliff new file mode 100644 index 00000000..c276dd70 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.hu.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Új hozzáadása + + + label_type_yes + igen + + + label_type_no + nem + + + label_type_equals + egyenlő + + + label_type_not_equals + nem egyenlő + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.it.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.it.xliff new file mode 100644 index 00000000..bfe914e3 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.it.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Aggiungi nuovo + + + label_type_yes + + + + label_type_no + no + + + label_type_equals + è uguale a + + + label_type_not_equals + non è uguale a + + + date_range_start + da + + + date_range_end + a + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ja.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ja.xliff new file mode 100644 index 00000000..62687a16 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ja.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + 追加 + + + label_type_yes + はい + + + label_type_no + いいえ + + + label_type_equals + 等しい + + + label_type_not_equals + 等しくない + + + date_range_start + From + + + date_range_end + To + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lb.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lb.xliff new file mode 100644 index 00000000..f4aa3ffe --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lb.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Nei + + + label_type_yes + jo + + + label_type_no + nee + + + label_type_equals + ass gläich + + + label_type_not_equals + label_type_not_equals + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lt.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lt.xliff new file mode 100644 index 00000000..0074d834 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.lt.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Sukurti naują + + + label_type_yes + taip + + + label_type_no + ne + + + label_type_equals + yra lygus + + + label_type_not_equals + nelygus + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.nl.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.nl.xliff new file mode 100644 index 00000000..bc49341e --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.nl.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Nieuwe toevoegen + + + label_type_yes + ja + + + label_type_no + nee + + + label_type_equals + is gelijk aan + + + label_type_not_equals + is niet gelijk aan + + + date_range_start + vanaf datum + + + date_range_end + tot datum + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pl.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pl.xliff new file mode 100644 index 00000000..128230ac --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pl.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Dodaj + + + label_type_yes + tak + + + label_type_no + nie + + + label_type_equals + jest równe + + + label_type_not_equals + nie jest równe + + + date_range_start + od + + + date_range_end + do + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt.xliff new file mode 100644 index 00000000..50381275 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Novo + + + label_type_yes + sim + + + label_type_no + não + + + label_type_equals + é igual a + + + label_type_not_equals + não é igual a + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt_BR.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt_BR.xliff new file mode 100644 index 00000000..a0255c32 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.pt_BR.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Adicionar novo + + + label_type_yes + sim + + + label_type_no + não + + + label_type_equals + é igual a + + + label_type_not_equals + não é igual a + + + date_range_start + De + + + date_range_end + Até + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ro.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ro.xliff new file mode 100644 index 00000000..55885499 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ro.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Adăugați + + + label_type_yes + da + + + label_type_no + nu + + + label_type_equals + este egal cu + + + label_type_not_equals + nu este egal cu + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ru.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ru.xliff new file mode 100644 index 00000000..dd7c36bd --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.ru.xliff @@ -0,0 +1,39 @@ + + + + + + link_add + Добавить новый + + + label_type_yes + да + + + label_type_no + нет + + + sonata_form_template_box_file_found_in + Этот файл можно найти в + + + label_type_equals + равен + + + label_type_not_equals + не равен + + + date_range_start + С + + + date_range_end + По + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sk.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sk.xliff new file mode 100644 index 00000000..16ad2839 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sk.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Pridať nový + + + label_type_yes + áno + + + label_type_no + nie + + + label_type_equals + sa rovná + + + label_type_not_equals + sa nerovná + + + date_range_start + Od + + + date_range_end + Do + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sl.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sl.xliff new file mode 100644 index 00000000..6f6118e4 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.sl.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Dodaj + + + label_type_yes + da + + + label_type_no + ne + + + label_type_equals + je točno enako + + + label_type_not_equals + ni enako + + + date_range_start + Od + + + date_range_end + Do + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.uk.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.uk.xliff new file mode 100644 index 00000000..291c5ffa --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.uk.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + Додати новий + + + label_type_yes + так + + + label_type_no + немає + + + label_type_equals + дорівнює + + + label_type_not_equals + не дорівнює + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.zh_CN.xliff b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.zh_CN.xliff new file mode 100644 index 00000000..2ba9671d --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/translations/SonataFormBundle.zh_CN.xliff @@ -0,0 +1,35 @@ + + + + + + link_add + 添加 + + + label_type_yes + + + + label_type_no + + + + label_type_equals + label_type_equals + + + label_type_not_equals + label_type_not_equals + + + date_range_start + date_range_start + + + date_range_end + date_range_end + + + + diff --git a/src/Form/Bridge/Symfony/Resources/views/Form/color.html.twig b/src/Form/Bridge/Symfony/Resources/views/Form/color.html.twig new file mode 100644 index 00000000..527f14e9 --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/views/Form/color.html.twig @@ -0,0 +1,15 @@ +{# + +This file is part of the Sonata package. + +(c) Thomas Rabaix + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. + +#} +{% block sonata_type_color_widget %} + {% spaceless %} + + {% endspaceless %} +{% endblock sonata_type_color_widget %} diff --git a/src/Form/Bridge/Symfony/Resources/views/Form/colorpicker.html.twig b/src/Form/Bridge/Symfony/Resources/views/Form/colorpicker.html.twig new file mode 100644 index 00000000..9a1698cd --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/views/Form/colorpicker.html.twig @@ -0,0 +1,33 @@ +{# + +This file is part of the Sonata package. + +(c) Thomas Rabaix + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. + +#} +{% block sonata_type_color_selector_widget %} + {{ block('choice_widget') }} + {% spaceless %} + + {% endspaceless %} +{% endblock sonata_type_color_selector_widget %} diff --git a/src/Form/Bridge/Symfony/Resources/views/Form/datepicker.html.twig b/src/Form/Bridge/Symfony/Resources/views/Form/datepicker.html.twig new file mode 100644 index 00000000..10a0bbfb --- /dev/null +++ b/src/Form/Bridge/Symfony/Resources/views/Form/datepicker.html.twig @@ -0,0 +1,99 @@ +{# + +This file is part of the Sonata package. + +(c) Thomas Rabaix + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. + +#} +{% block sonata_type_date_picker_widget_html %} + {% if datepicker_use_button %} +
+ {% endif %} + {% set attr = attr|merge({'data-date-format': moment_format}) %} + {{ block('date_widget') }} + {% if datepicker_use_button %} + +
+ {% endif %} +{% endblock sonata_type_date_picker_widget_html %} + +{% block sonata_type_date_picker_widget %} + {% spaceless %} + {% if wrap_fields_with_addons %} +
+ {{ block('sonata_type_date_picker_widget_html') }} +
+ {% else %} + {{ block('sonata_type_date_picker_widget_html') }} + {% endif %} + + {% endspaceless %} +{% endblock sonata_type_date_picker_widget %} + +{% block sonata_type_datetime_picker_widget_html %} + {% if datepicker_use_button %} +
+ {% endif %} + {% set attr = attr|merge({'data-date-format': moment_format}) %} + {{ block('datetime_widget') }} + {% if datepicker_use_button %} + + + +
+ {% endif %} +{% endblock sonata_type_datetime_picker_widget_html %} + +{% block sonata_type_datetime_picker_widget %} + {% spaceless %} + {% if wrap_fields_with_addons %} +
+ {{ block('sonata_type_datetime_picker_widget_html') }} +
+ {% else %} + {{ block('sonata_type_datetime_picker_widget_html') }} + {% endif %} + + {% endspaceless %} +{% endblock sonata_type_datetime_picker_widget %} + +{% block sonata_type_datetime_range_script_block %} + {% spaceless %} + {{ block('form_widget') }} + + {% endspaceless %} +{% endblock sonata_type_datetime_range_script_block %} + +{% block sonata_type_datetime_range_picker_widget %} + {% set startId = (form.children.start.vars.datepicker_use_button ? 'dtp_' : '') ~ form.children.start.vars.id %} + {% set endId = (form.children.end.vars.datepicker_use_button ? 'dtp_' : '') ~ form.children.end.vars.id %} + {{ block('sonata_type_datetime_range_script_block') }} +{% endblock sonata_type_datetime_range_picker_widget %} + +{% block sonata_type_date_range_picker_widget %} + {% set startId = (form.children.start.vars.datepicker_use_button ? 'dp_' : '') ~ form.children.start.vars.id %} + {% set endId = (form.children.end.vars.datepicker_use_button ? 'dp_' : '') ~ form.children.end.vars.id %} + {{ block('sonata_type_datetime_range_script_block') }} +{% endblock sonata_type_date_range_picker_widget %} diff --git a/src/Form/Bridge/Symfony/SonataFormBundle.php b/src/Form/Bridge/Symfony/SonataFormBundle.php new file mode 100644 index 00000000..ecf26303 --- /dev/null +++ b/src/Form/Bridge/Symfony/SonataFormBundle.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\Form\Bridge\Symfony; + +use Symfony\Component\HttpKernel\Bundle\Bundle; + +final class SonataFormBundle extends Bundle +{ +}