aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/ConfigController.php
diff options
context:
space:
mode:
authorJeremy <jeremy.benoist@gmail.com>2015-02-23 22:55:06 +0100
committerJeremy <jeremy.benoist@gmail.com>2015-03-01 10:49:16 +0100
commit32da2a70ef278bd42f66eb82c3fbf1905a417b87 (patch)
tree587ef3bae1f4881047eb1ceb0c005e7a8287bb71 /src/Wallabag/CoreBundle/Controller/ConfigController.php
parentfca3c757233940cbe4c431e3e05fe74893225fe0 (diff)
downloadwallabag-32da2a70ef278bd42f66eb82c3fbf1905a417b87.tar.gz
wallabag-32da2a70ef278bd42f66eb82c3fbf1905a417b87.tar.zst
wallabag-32da2a70ef278bd42f66eb82c3fbf1905a417b87.zip
Add LiipThemeBundle
Re-defined the config / user relation to be OneToOne bidirectionnal. ConfigType is now a service so I can inject the list of available themes that are also used by LiipThemeBundle Force sqlite for test In case of people use a different driver in parameter.yml (yes I do :))
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php9
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;
7use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
8use Wallabag\CoreBundle\Entity\Config; 8use Wallabag\CoreBundle\Entity\Config;
9use Wallabag\CoreBundle\Entity\User; 9use Wallabag\CoreBundle\Entity\User;
10use Wallabag\CoreBundle\Form\Type\ConfigType;
11use Wallabag\CoreBundle\Form\Type\ChangePasswordType; 10use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
12use Wallabag\CoreBundle\Form\Type\UserType; 11use Wallabag\CoreBundle\Form\Type\UserType;
13use Wallabag\CoreBundle\Form\Type\NewUserType; 12use 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'