Пример #1
0
 /**
  * Get directory where themes files are stored
  *
  * @return null|string
  */
 public function getThemeFilesPath()
 {
     return $this->theme->isPhysical() ? $this->customizationPath->getThemeFilesPath($this->theme) : $this->customizationPath->getCustomizationPath($this->theme);
 }
Пример #2
0
 /**
  * Recursively add parent theme configs
  *
  * @param ThemeInterface $theme
  * @param array $iterator
  * @param int $index
  * @return array
  */
 private function getParentConfigs(ThemeInterface $theme, array $iterator, $index = 0)
 {
     if ($theme->getParentTheme() && $theme->isPhysical()) {
         $parentDesignPath = $this->resolver->resolve(RulePool::TYPE_FILE, 'etc/view.xml', $this->area, $theme->getParentTheme());
         $parentDom = new \DOMDocument();
         $parentDom->load($parentDesignPath);
         $iterator[$index] = $parentDom->saveXML();
         $iterator = $this->getParentConfigs($theme->getParentTheme(), $iterator, ++$index);
     }
     return $iterator;
 }
Пример #3
0
 /**
  * Get path to preview image
  *
  * @param \Magento\Core\Model\Theme|ThemeInterface $theme
  * @return string
  */
 public function getPreviewImagePath(ThemeInterface $theme)
 {
     return $theme->isPhysical() ? $this->assetRepo->createAsset($theme->getPreviewImage(), ['area' => $theme->getData('area'), 'themeModel' => $theme])->getSourceFile() : $this->mediaDirectory->getAbsolutePath(self::PREVIEW_DIRECTORY_PATH . '/' . $theme->getPreviewImage());
 }