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/Controller | |
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/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ConfigController.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 68e034fa..4e895875 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php | |||
@@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |||
7 | use Symfony\Component\HttpFoundation\Request; | 7 | use Symfony\Component\HttpFoundation\Request; |
8 | use Wallabag\CoreBundle\Entity\Config; | 8 | use Wallabag\CoreBundle\Entity\Config; |
9 | use Wallabag\CoreBundle\Entity\User; | 9 | use Wallabag\CoreBundle\Entity\User; |
10 | use Wallabag\CoreBundle\Form\Type\ConfigType; | ||
11 | use Wallabag\CoreBundle\Form\Type\ChangePasswordType; | 10 | use Wallabag\CoreBundle\Form\Type\ChangePasswordType; |
12 | use Wallabag\CoreBundle\Form\Type\UserType; | 11 | use Wallabag\CoreBundle\Form\Type\UserType; |
13 | use Wallabag\CoreBundle\Form\Type\NewUserType; | 12 | use Wallabag\CoreBundle\Form\Type\NewUserType; |
@@ -25,14 +24,18 @@ class ConfigController extends Controller | |||
25 | $config = $this->getConfig(); | 24 | $config = $this->getConfig(); |
26 | $user = $this->getUser(); | 25 | $user = $this->getUser(); |
27 | 26 | ||
28 | // handle basic config detail | 27 | // handle basic config detail (this form is defined as a service) |
29 | $configForm = $this->createForm(new ConfigType(), $config); | 28 | $configForm = $this->createForm('config', $config); |
30 | $configForm->handleRequest($request); | 29 | $configForm->handleRequest($request); |
31 | 30 | ||
32 | if ($configForm->isValid()) { | 31 | if ($configForm->isValid()) { |
33 | $em->persist($config); | 32 | $em->persist($config); |
34 | $em->flush(); | 33 | $em->flush(); |
35 | 34 | ||
35 | // switch active theme | ||
36 | $activeTheme = $this->get('liip_theme.active_theme'); | ||
37 | $activeTheme->setName($config->getTheme()); | ||
38 | |||
36 | $this->get('session')->getFlashBag()->add( | 39 | $this->get('session')->getFlashBag()->add( |
37 | 'notice', | 40 | 'notice', |
38 | 'Config saved' | 41 | 'Config saved' |