Removed old, not so maintained and buggy baggy theme

This commit is contained in:
Nicolas Lœuillet
2020-04-14 16:01:14 +02:00
committed by Nicolas Lœuillet
parent 0883bda18d
commit 29308024ac
52 changed files with 42 additions and 4736 deletions

View File

@ -16,15 +16,18 @@ class DetectActiveTheme implements DeviceDetectionInterface
{
protected $tokenStorage;
protected $defaultTheme;
protected $themes;
/**
* @param TokenStorageInterface $tokenStorage Needed to retrieve the current user
* @param string $defaultTheme Default theme when user isn't logged in
* @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes)
*/
public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme)
public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme, $themes)
{
$this->tokenStorage = $tokenStorage;
$this->defaultTheme = $defaultTheme;
$this->themes = $themes;
}
public function setUserAgent($userAgent)
@ -60,6 +63,10 @@ class DetectActiveTheme implements DeviceDetectionInterface
return $this->defaultTheme;
}
if (!\in_array($config->getTheme(), $this->themes, true)) {
return $this->defaultTheme;
}
return $config->getTheme();
}
}