72 if (!$this->themeFiles) {
73 $this->themeFiles = $this->fileProvider->getItems($this->theme);
86 if (!isset($this->themeFilesByType[
$type])) {
87 $this->themeFilesByType[
$type] = $this->fileProvider->getItems($this->theme, [
'file_type' =>
$type]);
89 return $this->themeFilesByType[
$type];
98 public function generateFileInfo(array
$files)
102 foreach (
$files as $file) {
104 $filesInfo[] = $file->getFileInfo();
117 return $this->customizationPath->getCustomizationPath($this->theme);
127 return $this->theme->isPhysical() ? $this->customizationPath->getThemeFilesPath(
129 ) : $this->customizationPath->getCustomizationPath(
141 return $this->customizationPath->getCustomViewConfigPath($this->theme);
153 $sortOrderSequence = array_flip(array_values($sequence));
156 if (isset($sortOrderSequence[$file->getId()])) {
157 $prevSortOrder = $file->getData(
'sort_order');
158 $currentSortOrder = $sortOrderSequence[$file->getId()];
159 if ($prevSortOrder !== $currentSortOrder) {
160 $file->setData(
'sort_order', $currentSortOrder);
174 public function delete(array $fileIds)
177 foreach ($this->
getFiles() as $file) {
178 if (in_array($file->getId(), $fileIds)) {
__construct(\Magento\Framework\View\Design\Theme\FileProviderInterface $fileProvider, \Magento\Framework\View\Design\Theme\Customization\Path $customizationPath, \Magento\Framework\View\Design\ThemeInterface $theme=null)
reorder($type, array $sequence)
getCustomViewConfigPath()
foreach($appDirs as $dir) $files