From 2a1378464c407661ebe8c4a7009485d71893d9a0 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 12 May 2021 16:13:03 +0200 Subject: [PATCH] add settings (stats, giphy) --- src/EventSuscriber/SettingEventSubscriber.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/EventSuscriber/SettingEventSubscriber.php b/src/EventSuscriber/SettingEventSubscriber.php index d070e5f..d0695eb 100644 --- a/src/EventSuscriber/SettingEventSubscriber.php +++ b/src/EventSuscriber/SettingEventSubscriber.php @@ -7,6 +7,7 @@ use App\Core\EventSuscriber\SettingEventSubscriber as EventSubscriber; use App\Core\Setting\SettingManager; use Symfony\Component\Form\Extension\Core\Type\EmailType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; +use Symfony\Component\Form\Extension\Core\Type\TextType; /** * class SettingEventSubscriber. @@ -52,20 +53,17 @@ class SettingEventSubscriber extends EventSubscriber ); } - if ('blog_footer_p1' === $entity->getCode()) { + if (in_array($entity->getCode(), ['giphy_api_key', 'stats_umami_url'])) { $builder->add( 'value', - TextareaType::class, + TextType::class, [ 'label' => $entity->getLabel(), - 'attr' => [ - 'rows' => 10, - ], ] ); } - if ('blog_footer_p2' === $entity->getCode()) { + if (in_array($entity->getCode(), ['blog_footer_p1', 'blog_footer_p2'])) { $builder->add( 'value', TextareaType::class,