X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FConfigType.php;h=1f0ad89dfad578ffeac5c5067a0748da61dfe3fd;hb=77a7752a592af9ac821621a34d9955533baf40a0;hp=0c8706e2ae592c95f99acea375316313ddb4c64e;hpb=ba7b9d48d407f87690a3fdc199b37714d2a52897;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 0c8706e2..1f0ad89d 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -1,36 +1,46 @@ themes = array_combine( $themes, array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s))); }, $themes) ); + + $this->languages = $languages; } public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('theme', 'choice', array('choices' => $this->themes)) - ->add('items_per_page', 'text') - ->add('language') + ->add('theme', 'choice', array( + 'choices' => array_flip($this->themes), + 'choices_as_values' => true, + )) + ->add('items_per_page') + ->add('language', 'choice', array( + 'choices' => $this->languages, + )) ->add('save', 'submit') ; } - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Wallabag\CoreBundle\Entity\Config',