2016-12-04 12:51:58 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 00:30:12 +00:00
|
|
|
namespace Wallabag\Form\Type;
|
2016-12-04 12:51:58 +00:00
|
|
|
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
2024-02-19 00:30:12 +00:00
|
|
|
use Wallabag\Entity\SiteCredential;
|
2016-12-04 12:51:58 +00:00
|
|
|
|
|
|
|
class SiteCredentialType extends AbstractType
|
|
|
|
{
|
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
|
|
{
|
|
|
|
$builder
|
|
|
|
->add('host', TextType::class, [
|
|
|
|
'label' => 'site_credential.form.host_label',
|
|
|
|
])
|
|
|
|
->add('username', TextType::class, [
|
|
|
|
'label' => 'site_credential.form.username_label',
|
2017-06-14 13:02:34 +00:00
|
|
|
'data' => '',
|
2016-12-04 12:51:58 +00:00
|
|
|
])
|
|
|
|
->add('password', PasswordType::class, [
|
|
|
|
'label' => 'site_credential.form.password_label',
|
|
|
|
])
|
|
|
|
->add('save', SubmitType::class, [
|
|
|
|
'label' => 'config.form.save',
|
|
|
|
])
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
|
|
{
|
|
|
|
$resolver->setDefaults([
|
2022-09-01 18:54:56 +00:00
|
|
|
'data_class' => SiteCredential::class,
|
2016-12-04 12:51:58 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBlockPrefix()
|
|
|
|
{
|
|
|
|
return 'site_credential';
|
|
|
|
}
|
|
|
|
}
|