Beispiel #1
0
 /**
  * @return array
  */
 protected function getConfigFiles()
 {
     $configFiles = [];
     foreach ($this->themeCollection->loadRegisteredThemes() as $theme) {
         $configFiles = array_merge($configFiles, $this->fileCollector->getFilesContent($theme, 'layouts.xml'));
     }
     return $configFiles;
 }
Beispiel #2
0
 public function testGetByAreaWithOtherAreaAndNumericThemeId()
 {
     $this->designMock->expects($this->once())->method('getDesignTheme')->will($this->returnValue($this->themeMock));
     $this->designMock->expects($this->once())->method('getArea')->will($this->returnValue('design_area'));
     $this->designMock->expects($this->once())->method('getConfigurationDesignTheme')->will($this->returnValue(12));
     $this->themeMock->expects($this->once())->method('getArea')->will($this->returnValue('theme_area'));
     $this->themeCollectionFactoryMock->expects($this->once())->method('create')->will($this->returnValue($this->themeCollectionMock));
     $this->themeCollectionMock->expects($this->once())->method('getItemById')->with(12)->will($this->returnValue($this->themeMock));
     $this->appStateMock->expects($this->once())->method('getAreaCode')->will($this->returnValue('other_area'));
     $this->assertEquals($this->themeMock, $this->model->get());
 }
Beispiel #3
0
 /**
  * Get virtual theme title
  *
  * @param \Magento\Framework\View\Design\ThemeInterface $theme
  * @return string
  */
 protected function _getVirtualThemeTitle($theme)
 {
     $themeCopyCount = $this->_themeCollection->addAreaFilter(\Magento\Framework\App\Area::AREA_FRONTEND)->addTypeFilter(\Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL)->addFilter('parent_id', $theme->getId())->count();
     $title = sprintf("%s - %s #%s", $theme->getThemeTitle(), __('Copy'), $themeCopyCount + 1);
     return $title;
 }
Beispiel #4
0
 /**
  * Add area filter
  *
  * @return $this
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->filterVisibleThemes()->addAreaFilter(\Magento\Framework\App\Area::AREA_FRONTEND)->addParentTitle();
     return $this;
 }