public function toArray() { $themes = $this->_collectionThemeFactory->create(); $file = $this->_filesystem->getDirectoryRead(DirectoryList::APP)->getAbsolutePath('design/frontend/'); $vesPackagePaths = glob($file . '*/*/config.xml'); $output = []; foreach ($vesPackagePaths as $k => $v) { $v = str_replace("/config.xml", "", $v); $output[str_replace($file, "", $v)] = ucfirst(str_replace($file, "", $v)); } return $output; }
public function getExportPackages() { $themes = $this->_collectionThemeFactory->create(); $file = $this->_filesystem->getDirectoryRead(DirectoryList::APP)->getAbsolutePath('design/frontend/'); $vesPackagePaths = glob($file . '*/config.xml'); $output = []; foreach ($vesPackagePaths as $k => $v) { $v = str_replace("config.xml", "", $v); $themes = array_filter(glob($v . '*'), 'is_dir'); foreach ($themes as $k => $v) { $output[] = array('label' => ucfirst(str_replace($file, "", $v)), 'value' => str_replace($file, "", $v)); } } return $output; }