Beispiel #1
0
 /**
  * Returns theme inheritance hierarchy with root theme as first item
  *
  * @param string $themeName
  *
  * @return Theme[]
  */
 protected function getThemesHierarchy($themeName)
 {
     $hierarchy = [];
     while (null !== $themeName) {
         $theme = $this->themeManager->getTheme($themeName);
         $hierarchy[] = $theme;
         $themeName = $theme->getParentTheme();
     }
     return array_reverse($hierarchy);
 }
Beispiel #2
0
 /**
  * @param Theme $theme
  * @return array
  */
 protected function collectThemeAssets(Theme $theme)
 {
     $assets = $theme->getDataByKey('assets', []);
     $parentTheme = $theme->getParentTheme();
     if ($parentTheme) {
         $parentTheme = $this->themeManager->getTheme($parentTheme);
         $assets = array_merge_recursive($this->collectThemeAssets($parentTheme), $assets);
     }
     return $assets;
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function getData(ContextInterface $context)
 {
     return $this->themeManager->getTheme($context->get('theme'));
 }