2017-05-07 15:21:30 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 00:30:12 +00:00
|
|
|
namespace Wallabag\Form\Type;
|
2017-05-07 15:21:30 +00:00
|
|
|
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
|
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
2024-02-19 00:30:12 +00:00
|
|
|
use Wallabag\Entity\Annotation;
|
2017-05-07 15:21:30 +00:00
|
|
|
|
|
|
|
class NewAnnotationType extends AbstractType
|
|
|
|
{
|
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
|
|
{
|
|
|
|
$builder
|
|
|
|
->add('text', null, [
|
|
|
|
'empty_data' => '',
|
|
|
|
])
|
|
|
|
->add('quote', null, [
|
2019-11-24 09:44:26 +00:00
|
|
|
'empty_data' => '',
|
2019-10-27 17:51:32 +00:00
|
|
|
'trim' => false,
|
2017-05-07 15:21:30 +00:00
|
|
|
])
|
|
|
|
->add('ranges', CollectionType::class, [
|
|
|
|
'entry_type' => RangeType::class,
|
|
|
|
'allow_add' => true,
|
|
|
|
])
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
|
|
{
|
|
|
|
$resolver->setDefaults([
|
|
|
|
'data_class' => Annotation::class,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|