/** * Deletes theme by id. * throws InvalidArgumentException * * @param integer $themeId */ public function deleteTheme($themeId) { $theme = $this->getThemeById($themeId); // delete theme static files $this->unlinkTheme($theme->getId()); // delete theme DB entry $this->themeDao->deleteById($theme->getId()); }
/** * Deletes theme by id. * throws InvalidArgumentException * * @param integer $themeId */ public function deleteTheme($themeId, $deleteControlValues = false) { $theme = $this->getThemeById($themeId); // delete theme static files $this->unlinkTheme($theme->getId()); if ($deleteControlValues) { $this->themeControlValueDao->deleteThemeControlValues($themeId); $curentValue = json_decode(OW::getConfig()->getValue('base', 'master_page_theme_info'), true); unset($curentValue[$themeId]); OW::getConfig()->getValue('base', 'master_page_theme_info', json_encode($curentValue)); } // delete theme DB entry $this->themeDao->deleteById($theme->getId()); }
/** * Deletes theme by id. * @throws InvalidArgumentException * * @param integer $themeId */ public function deleteTheme($themeId, $deleteControlValues = false) { $theme = $this->getThemeById($themeId); if (empty($theme)) { throw new InvalidArgumentException("Can't delete theme with id `" . $themeId . "`, not found!"); } // delete theme static files $this->unlinkTheme($theme->getId()); if ($deleteControlValues) { $this->themeControlValueDao->deleteThemeControlValues($themeId); //TODO remove dirty hack $curentValue = json_decode(OW::getConfig()->getValue("base", "master_page_theme_info"), true); unset($curentValue[$themeId]); OW::getConfig()->getValue("base", "master_page_theme_info", json_encode($curentValue)); } // delete theme DB entry $this->themeDao->deleteById($theme->getId()); }