|
|
|
|
|
|
|
|
use FOS\CKEditorBundle\Form\Type\CKEditorType; |
|
|
use FOS\CKEditorBundle\Form\Type\CKEditorType; |
|
|
use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; |
|
|
use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; |
|
|
use Lc\SovBundle\Form\Common\FileManagerType; |
|
|
use Lc\SovBundle\Form\Common\FileManagerType; |
|
|
|
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\DateType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\DateType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
protected EntityManagerInterface $em; |
|
|
protected EntityManagerInterface $em; |
|
|
protected SiteSettingDefinitionInterface $settingDefinition; |
|
|
protected SiteSettingDefinitionInterface $settingDefinition; |
|
|
|
|
|
protected TranslatorAdmin $translatorAdmin; |
|
|
|
|
|
|
|
|
public function __construct( |
|
|
public function __construct( |
|
|
EntityManagerInterface $entityManager, |
|
|
EntityManagerInterface $entityManager, |
|
|
SiteSettingDefinitionInterface $settingDefinition |
|
|
|
|
|
|
|
|
SiteSettingDefinitionInterface $settingDefinition, |
|
|
|
|
|
TranslatorAdmin $translatorAdmin |
|
|
) { |
|
|
) { |
|
|
$this->em = $entityManager; |
|
|
$this->em = $entityManager; |
|
|
$this->settingDefinition = $settingDefinition; |
|
|
$this->settingDefinition = $settingDefinition; |
|
|
|
|
|
$this->translatorAdmin = $translatorAdmin; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function buildFormSetting($label, $form, $settingDefinition, $settingEntity) |
|
|
public function buildFormSetting($label, $form, $settingDefinition, $settingEntity) |
|
|
|
|
|
|
|
|
'text', |
|
|
'text', |
|
|
TextType::class, |
|
|
TextType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label |
|
|
|
|
|
|
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
} elseif ($settingType == 'textarea') { |
|
|
} elseif ($settingType == 'textarea') { |
|
|
|
|
|
|
|
|
'text', |
|
|
'text', |
|
|
TextareaType::class, |
|
|
TextareaType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label |
|
|
|
|
|
|
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
} elseif ($settingType == 'textarea_advanced') { |
|
|
} elseif ($settingType == 'textarea_advanced') { |
|
|
|
|
|
|
|
|
CKEditorType::class, |
|
|
CKEditorType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label, |
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
'attr' => [ |
|
|
'attr' => [ |
|
|
'class' => 'field-text_editor' |
|
|
'class' => 'field-text_editor' |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
ChoiceType::class, |
|
|
ChoiceType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label, |
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
'expanded' => false, |
|
|
'expanded' => false, |
|
|
'multiple' => false, |
|
|
'multiple' => false, |
|
|
'placeholder' => false, |
|
|
'placeholder' => false, |
|
|
|
|
|
|
|
|
ChoiceType::class, |
|
|
ChoiceType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label, |
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
'expanded' => true, |
|
|
'expanded' => true, |
|
|
'multiple' => false, |
|
|
'multiple' => false, |
|
|
'placeholder' => false, |
|
|
'placeholder' => false, |
|
|
|
|
|
|
|
|
DateType::class, |
|
|
DateType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label, |
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
'widget' => 'single_text', |
|
|
'widget' => 'single_text', |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
TimeType::class, |
|
|
TimeType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label, |
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
'input' => 'datetime', |
|
|
'input' => 'datetime', |
|
|
'widget' => 'single_text', |
|
|
'widget' => 'single_text', |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
FileManagerType::class, |
|
|
FileManagerType::class, |
|
|
[ |
|
|
[ |
|
|
'label' => $label, |
|
|
'label' => $label, |
|
|
|
|
|
'translation_domain' => 'admin', |
|
|
'attr' => [ |
|
|
'attr' => [ |
|
|
'type' => $settingType |
|
|
'type' => $settingType |
|
|
] |
|
|
] |