getInstalled(); foreach ($installed as $code => $name) { if ($dirName == $name) { return $code; } } return null; } // // Management // /** * Completely delete a theme from the system. * @param string $theme Theme code/namespace * @return void */ public function deleteTheme($theme) { if (!$theme) { return false; } if (is_string($theme)) { $theme = CmsTheme::load($theme); } if ($theme->isActiveTheme()) { throw new ApplicationException(trans('cms::lang.theme.delete_active_theme_failed')); } $theme->removeCustomData(); /* * Delete from file system */ $themePath = $theme->getPath(); if (File::isDirectory($themePath)) { File::deleteDirectory($themePath); } /* * Set uninstalled */ if ($themeCode = $this->findByDirName($theme->getDirName())) { $this->setUninstalled($themeCode); } } }