X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FConfigType.php;h=25ea9efa2c9ea07ba3b14252b2db8bdb97a28160;hb=0d42217e4e8210dd2cf86f35ba9662ca02c8a2dc;hp=0fcf020add5ef5495f1a341ba52e03ca3fe17992;hpb=371ac69a6bd6325929e4efee7958682a6b1666f7;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 0fcf020a..25ea9efa 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -1,43 +1,71 @@ 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') - ->add('language') - ->add('save', 'submit') + ->add('theme', ChoiceType::class, array( + 'choices' => array_flip($this->themes), + 'choices_as_values' => true, + 'label' => 'config.form_settings.theme_label', + )) + ->add('items_per_page', null, array( + 'label' => 'config.form_settings.items_per_page_label', + )) + ->add('reading_speed', ChoiceType::class, array( + 'label' => 'config.form_settings.reading_speed', + 'choices' => array( + 'I read ~100 words per minute' => '0.5', + 'I read ~200 words per minute' => '1', + 'I read ~300 words per minute' => '1.5', + 'I read ~400 words per minute' => '2', + ), + )) + ->add('language', ChoiceType::class, array( + 'choices' => array_flip($this->languages), + 'choices_as_values' => true, + 'label' => 'config.form_settings.language_label', + )) + ->add('save', SubmitType::class, array( + 'label' => 'config.form.save', + )) ; } - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'Wallabag\CoreBundle\Entity\Config', )); } - public function getName() + public function getBlockPrefix() { return 'config'; }