1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-11 17:51:02 +00:00

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 :))
This commit is contained in:
Jeremy 2015-02-23 22:55:06 +01:00
parent fca3c75723
commit 32da2a70ef
247 changed files with 938 additions and 143 deletions

View file

@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\User;
use Wallabag\CoreBundle\Form\Type\ConfigType;
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
use Wallabag\CoreBundle\Form\Type\UserType;
use Wallabag\CoreBundle\Form\Type\NewUserType;
@ -25,14 +24,18 @@ class ConfigController extends Controller
$config = $this->getConfig();
$user = $this->getUser();
// handle basic config detail
$configForm = $this->createForm(new ConfigType(), $config);
// handle basic config detail (this form is defined as a service)
$configForm = $this->createForm('config', $config);
$configForm->handleRequest($request);
if ($configForm->isValid()) {
$em->persist($config);
$em->flush();
// switch active theme
$activeTheme = $this->get('liip_theme.active_theme');
$activeTheme->setName($config->getTheme());
$this->get('session')->getFlashBag()->add(
'notice',
'Config saved'