Skip to content

Commit

Permalink
[AllBundles] Update default form types (Kunstmaan#1353)
Browse files Browse the repository at this point in the history
* Fix form types

* Change to email type
  • Loading branch information
dannyvw authored and cv65kr committed Nov 17, 2017
1 parent 8d55662 commit eb2eff0
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Kunstmaan\AdminBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;

Expand All @@ -17,7 +18,7 @@ class DashboardConfigurationType extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('title', null, array(
$builder->add('title', TextType::class, array(
'label' => 'kuma_admin.dashboard.configuration.title.label',
));
$builder->add('content', TextareaType::class, array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Kunstmaan\NodeBundle\Form\PageAdminType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand Down Expand Up @@ -37,8 +38,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'date_format' => 'dd/MM/yyyy'
)
);
$builder->add('summary', null, array(
'label' => 'article.form.summary.label'

$builder->add('summary', TextType::class, array(
'label' => 'article.form.summery.label'
));
}

Expand Down
5 changes: 3 additions & 2 deletions src/Kunstmaan/ArticleBundle/Form/AbstractAuthorAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
namespace Kunstmaan\ArticleBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

class AbstractAuthorAdminType extends AbstractType
{

public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('name', null, array(
$builder->add('name', TextType::class, array(
'label' => 'article.author.form.name.label',
));
$builder->add('link', null, array(
$builder->add('link', TextType::class, array(
'label' => 'article.author.form.link.label',
));
}
Expand Down
10 changes: 6 additions & 4 deletions src/Kunstmaan/FormBundle/Form/AbstractFormPageAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

use Kunstmaan\AdminBundle\Form\WysiwygType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -19,20 +21,20 @@ class AbstractFormPageAdminType extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('title', null, array(
$builder->add('title', TextType::class, array(
'label' => 'kuma_form.form.page_admin.title.label',
));
$builder->add('thanks', WysiwygType::class, array(
'label' => 'kuma_form.form.page_admin.thanks.label',
'required' => false,
));
$builder->add('subject', null, array(
$builder->add('subject', TextType::class, array(
'label' => 'kuma_form.form.page_admin.subject.label',
));
$builder->add('from_email', null, array(
$builder->add('from_email', EmailType::class, array(
'label' => 'kuma_form.form.page_admin.from_email.label',
));
$builder->add('to_email', null, array(
$builder->add('to_email', TextType::class, array(
'label' => 'kuma_form.form.page_admin.to_email.label',
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CheckboxPagePartAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', null, array(
->add('label', TextType::class, array(
'label' => 'kuma_form.form.checkbox_page_part.label.label',
'required' => false,
))
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/FormBundle/Form/ChoicePagePartAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ChoicePagePartAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', null, array(
->add('label', TextType::class, array(
'label' => 'kuma_form.form.choice_page_part.label.label',
'required' => false,
))
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/FormBundle/Form/EmailPagePartAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EmailPagePartAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', null, array(
->add('label', TextType::class, array(
'required' => false,
'label' => 'kuma_form.form.email_page_part.label.label',
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FileUploadPagePartAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', null, array(
->add('label', TextType::class, array(
'required' => true,
'label' => 'kuma_form.form.file_upload_page_part.label.label',
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MultiLineTextPagePartAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', null, array(
->add('label', TextType::class, array(
'required' => false,
'label' => 'kuma_form.form.multi_line_text_page_part.label.label',
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SingleLineTextPagePartAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', null, array(
->add('label', TextType::class, array(
'required' => false,
'label' => 'kuma_form.form.single_line_text_page_part.label.label',
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Kunstmaan\FormBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -18,7 +19,7 @@ class SubmitButtonPagePartAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', null, array(
->add('label', TextType::class, array(
'required' => false,
'label' => 'kuma_form.form.submit_button_page_part.label.label'
));
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/MediaBundle/Form/FolderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder
->add(
'name',
null,
TextType::class,
array(
'label' => 'media.folder.addsub.form.name'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
use Kunstmaan\NodeBundle\Form\Type\URLChooserType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;

use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

use Symfony\Component\OptionsResolver\OptionsResolver;

/**
Expand All @@ -32,7 +31,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder->add('media', MediaType::class, array(
'label' => 'mediapagepart.image.choosefile',
));
$builder->add('alttext', null, array(
$builder->add('alttext', TextType::class, array(
'required' => false,
'label' => 'mediapagepart.image.alttext',
));
Expand Down
3 changes: 2 additions & 1 deletion src/Kunstmaan/NodeBundle/Form/ControllerActionAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -20,7 +21,7 @@ class ControllerActionAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('id', HiddenType::class);
$builder->add('title', null, array(
$builder->add('title', TextType::class, array(
'label' => 'kuma_node.form.controller_action.title.label',
));
}
Expand Down
5 changes: 3 additions & 2 deletions src/Kunstmaan/NodeBundle/Form/PageAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -19,10 +20,10 @@ class PageAdminType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('id', HiddenType::class);
$builder->add('title', null, array(
$builder->add('title', TextType::class, array(
'label' => 'kuma_node.form.page.title.label',
));
$builder->add('pageTitle', null, array(
$builder->add('pageTitle', TextType::class, array(
'label' => 'kuma_node.form.page.page_title.label',
'attr' => array(
'info_text' => 'kuma_node.form.page.page_title.info_text',
Expand Down
3 changes: 2 additions & 1 deletion src/Kunstmaan/NodeSearchBundle/Form/NodeSearchAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Kunstmaan\NodeSearchBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -14,7 +15,7 @@ class NodeSearchAdminType extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('boost', null, array(
$builder->add('boost', TextType::class, array(
'label' => 'node_search.form.search.boost.label',
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -27,7 +28,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => true
)
);
$builder->add('title', null, array(
$builder->add('title', TextType::class, array(
'label' => 'pagepart.header.title',
'required' => true,
));
Expand Down
3 changes: 2 additions & 1 deletion src/Kunstmaan/PagePartBundle/Form/LinkPagePartAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Kunstmaan\NodeBundle\Form\Type\URLChooserType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -28,7 +29,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'label' => 'pagepart.link.openinnewwindow',
'required' => false,
))
->add('text', null, array(
->add('text', TextType::class, array(
'label' => 'pagepart.link.text',
'required' => false,
));
Expand Down
3 changes: 2 additions & 1 deletion src/Kunstmaan/TaggingBundle/Form/TagAdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
namespace Kunstmaan\TaggingBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

class TagAdminType extends AbstractType
{

public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('name', null, array(
$builder->add('name', TextType::class, array(
'label' => 'kuma_tagging.form.tag.name.label',
));
}
Expand Down

0 comments on commit eb2eff0

Please sign in to comment.