59 private $_scopeConfig;
95 $this->_flyweightFactory = $flyweightFactory;
96 $this->_themeFactory = $themeFactory;
97 $this->_scopeConfig = $scopeConfig;
98 $this->_appState = $appState;
99 $this->_themes = $themes;
111 $this->_area = $area;
112 $this->_theme =
null;
124 if ($this->_area && !$this->_appState->isAreaCodeEmulated()) {
127 return $this->_appState->getAreaCode();
148 $this->_theme = $this->_flyweightFactory->create(
$theme, $area);
172 if ($this->_isThemePerStoreView($area)) {
173 if ($this->_storeManager->isSingleStoreMode()) {
174 $theme = $this->_scopeConfig->getValue(
175 self::XML_PATH_THEME_ID,
179 $theme = (string) $this->_scopeConfig->getValue(
180 self::XML_PATH_THEME_ID,
187 if (!
$theme && isset($this->_themes[$area])) {
188 $theme = $this->_themes[$area];
200 private function _isThemePerStoreView($area)
223 if ($this->_theme ===
null) {
224 $this->_theme = $this->_themeFactory->create();
234 $themePath =
$theme->getThemePath();
236 $themeId =
$theme->getId();
238 $themePath = self::PUBLIC_THEME_DIR . $themeId;
253 if (
null === $this->_locale) {
254 $this->_locale = $this->objectManager->get(\
Magento\Framework\Locale\ResolverInterface::class);
256 return $this->_locale->getLocale();
265 $this->_locale = $locale;
setLocale(\Magento\Framework\Locale\ResolverInterface $locale)
__construct(\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\View\Design\Theme\FlyweightFactory $flyweightFactory, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Theme\Model\ThemeFactory $themeFactory, \Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\App\State $appState, array $themes)
getConfigurationDesignTheme($area=null, array $params=[])
getThemePath(\Magento\Framework\View\Design\ThemeInterface $theme)
setDesignTheme($theme, $area=null)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]