diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-03-02 21:23:19 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-03-02 21:23:19 +0100 |
commit | ba7b9d48d407f87690a3fdc199b37714d2a52897 (patch) | |
tree | a15611f10d09749e82011e0d51532af3de8cfabd /src/Wallabag/CoreBundle/Form/Type | |
parent | fca3c757233940cbe4c431e3e05fe74893225fe0 (diff) | |
parent | 3e30422cdae3cc45f44c3039c2d38b99121dd9e9 (diff) | |
download | wallabag-ba7b9d48d407f87690a3fdc199b37714d2a52897.tar.gz wallabag-ba7b9d48d407f87690a3fdc199b37714d2a52897.tar.zst wallabag-ba7b9d48d407f87690a3fdc199b37714d2a52897.zip |
Merge pull request #1132 from wallabag/v2-theme
V2 theme
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index a1e0ce47..0c8706e2 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php | |||
@@ -7,20 +7,23 @@ use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |||
7 | 7 | ||
8 | class ConfigType extends AbstractType | 8 | class ConfigType extends AbstractType |
9 | { | 9 | { |
10 | private $themes = array(); | ||
11 | |||
12 | /** | ||
13 | * @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes) | ||
14 | */ | ||
15 | public function __construct($themes) | ||
16 | { | ||
17 | $this->themes = array_combine( | ||
18 | $themes, | ||
19 | array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s))); }, $themes) | ||
20 | ); | ||
21 | } | ||
22 | |||
10 | public function buildForm(FormBuilderInterface $builder, array $options) | 23 | public function buildForm(FormBuilderInterface $builder, array $options) |
11 | { | 24 | { |
12 | $builder | 25 | $builder |
13 | ->add('theme', 'choice', array( | 26 | ->add('theme', 'choice', array('choices' => $this->themes)) |
14 | 'choices' => array( | ||
15 | 'baggy' => 'Baggy', | ||
16 | 'courgette' => 'Courgette', | ||
17 | 'dark' => 'Dark', | ||
18 | 'default' => 'Default', | ||
19 | 'dmagenta' => 'Dmagenta', | ||
20 | 'solarized' => 'Solarized', | ||
21 | 'solarized_dark' => 'Solarized Dark', | ||
22 | ), | ||
23 | )) | ||
24 | ->add('items_per_page', 'text') | 27 | ->add('items_per_page', 'text') |
25 | ->add('language') | 28 | ->add('language') |
26 | ->add('save', 'submit') | 29 | ->add('save', 'submit') |