コード例 #1
0
ファイル: theme_service.php プロジェクト: vazahat/dudex
 /**
  * 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());
 }
コード例 #2
0
ファイル: theme_service.php プロジェクト: hardikamutech/loov
 /**
  * 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());
 }
コード例 #3
0
ファイル: theme_service.php プロジェクト: ZyXelP/oxwall
 /**
  * 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());
 }