diff options
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | 12 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Resources/config/services.yml | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php index 054a3752..489f39d1 100644 --- a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php +++ b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace Wallabag\CoreBundle\Helper; | 3 | namespace Wallabag\CoreBundle\Helper; |
4 | 4 | ||
5 | use Liip\ThemeBundle\Helper\DeviceDetectionInterface; | 5 | use Liip\ThemeBundle\Helper\DeviceDetectionInterface; |
6 | use Symfony\Component\Security\Core\SecurityContextInterface; | 6 | use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; |
7 | use Wallabag\UserBundle\Entity\User; | 7 | use Wallabag\UserBundle\Entity\User; |
8 | 8 | ||
9 | /** | 9 | /** |
@@ -14,16 +14,16 @@ use Wallabag\UserBundle\Entity\User; | |||
14 | */ | 14 | */ |
15 | class DetectActiveTheme implements DeviceDetectionInterface | 15 | class DetectActiveTheme implements DeviceDetectionInterface |
16 | { | 16 | { |
17 | protected $securityContext; | 17 | protected $tokenStorage; |
18 | protected $defaultTheme; | 18 | protected $defaultTheme; |
19 | 19 | ||
20 | /** | 20 | /** |
21 | * @param SecurityContextInterface $securityContext Needed to retrieve the current user | 21 | * @param TokenStorageInterface $tokenStorage Needed to retrieve the current user |
22 | * @param string $defaultTheme Default theme when user isn't logged in | 22 | * @param string $defaultTheme Default theme when user isn't logged in |
23 | */ | 23 | */ |
24 | public function __construct(SecurityContextInterface $securityContext, $defaultTheme) | 24 | public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme) |
25 | { | 25 | { |
26 | $this->securityContext = $securityContext; | 26 | $this->tokenStorage = $tokenStorage; |
27 | $this->defaultTheme = $defaultTheme; | 27 | $this->defaultTheme = $defaultTheme; |
28 | } | 28 | } |
29 | 29 | ||
@@ -42,7 +42,7 @@ class DetectActiveTheme implements DeviceDetectionInterface | |||
42 | */ | 42 | */ |
43 | public function getType() | 43 | public function getType() |
44 | { | 44 | { |
45 | $token = $this->securityContext->getToken(); | 45 | $token = $this->tokenStorage->getToken(); |
46 | 46 | ||
47 | if (is_null($token)) { | 47 | if (is_null($token)) { |
48 | return $this->defaultTheme; | 48 | return $this->defaultTheme; |
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 3c479ff6..debbf39e 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml | |||
@@ -2,7 +2,7 @@ services: | |||
2 | wallabag_core.helper.detect_active_theme: | 2 | wallabag_core.helper.detect_active_theme: |
3 | class: Wallabag\CoreBundle\Helper\DetectActiveTheme | 3 | class: Wallabag\CoreBundle\Helper\DetectActiveTheme |
4 | arguments: | 4 | arguments: |
5 | - @security.context | 5 | - @security.token_storage |
6 | - %theme% # default theme from parameters.yml | 6 | - %theme% # default theme from parameters.yml |
7 | 7 | ||
8 | # custom form type | 8 | # custom form type |