2015-02-17 21:45:20 +00:00
|
|
|
<?php
|
2015-05-30 11:52:26 +00:00
|
|
|
|
2024-02-19 00:30:12 +00:00
|
|
|
namespace Wallabag\Form\Type;
|
2015-02-17 21:45:20 +00:00
|
|
|
|
2022-09-01 18:54:56 +00:00
|
|
|
use FOS\UserBundle\Form\Type\RegistrationFormType;
|
2015-02-17 21:45:20 +00:00
|
|
|
use Symfony\Component\Form\AbstractType;
|
2015-12-22 09:16:34 +00:00
|
|
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
2015-02-17 21:45:20 +00:00
|
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
2015-06-02 14:58:19 +00:00
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
2024-02-19 00:30:12 +00:00
|
|
|
use Wallabag\Entity\User;
|
2015-02-17 21:45:20 +00:00
|
|
|
|
2015-03-27 23:10:39 +00:00
|
|
|
class UserInformationType extends AbstractType
|
2015-02-17 21:45:20 +00:00
|
|
|
{
|
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
|
|
{
|
|
|
|
$builder
|
2016-04-12 09:36:01 +00:00
|
|
|
->add('name', TextType::class, [
|
2016-03-09 07:59:08 +00:00
|
|
|
'label' => 'config.form_user.name_label',
|
2016-04-12 09:36:01 +00:00
|
|
|
])
|
|
|
|
->add('email', EmailType::class, [
|
2016-03-09 07:59:08 +00:00
|
|
|
'label' => 'config.form_user.email_label',
|
2016-04-12 09:36:01 +00:00
|
|
|
])
|
|
|
|
->add('save', SubmitType::class, [
|
2016-03-09 07:59:08 +00:00
|
|
|
'label' => 'config.form.save',
|
2016-04-12 09:36:01 +00:00
|
|
|
])
|
2015-08-25 14:29:22 +00:00
|
|
|
->remove('username')
|
|
|
|
->remove('plainPassword')
|
2015-02-17 21:45:20 +00:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2015-08-25 14:29:22 +00:00
|
|
|
public function getParent()
|
|
|
|
{
|
2022-09-01 18:54:56 +00:00
|
|
|
return RegistrationFormType::class;
|
2015-08-25 14:29:22 +00:00
|
|
|
}
|
|
|
|
|
2015-06-02 14:58:19 +00:00
|
|
|
public function configureOptions(OptionsResolver $resolver)
|
2015-02-17 21:45:20 +00:00
|
|
|
{
|
2016-04-12 09:36:01 +00:00
|
|
|
$resolver->setDefaults([
|
2022-09-01 18:54:56 +00:00
|
|
|
'data_class' => User::class,
|
2016-04-12 09:36:01 +00:00
|
|
|
]);
|
2015-02-17 21:45:20 +00:00
|
|
|
}
|
|
|
|
|
2015-12-22 09:16:34 +00:00
|
|
|
public function getBlockPrefix()
|
2015-02-17 21:45:20 +00:00
|
|
|
{
|
2015-03-27 23:10:39 +00:00
|
|
|
return 'update_user';
|
2015-02-17 21:45:20 +00:00
|
|
|
}
|
|
|
|
}
|