diff options
| author | czaks <marcin@6irc.net> | 2015-04-05 16:59:04 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2015-04-05 16:59:04 +0200 |
| commit | b78b3db0105c832f3e5b1f5cca019bb41a137662 (patch) | |
| tree | 9a77aa12e392c4d9e548c9be0712d5875a32266c /inc | |
| parent | 758cb94e01945b16f730c08775666d3f5e65eb86 (diff) | |
uncache themes on settings change
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/mod/pages.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index be713f57..969c570e 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2501,10 +2501,14 @@ function mod_theme_configure($theme_name) { $query->bindValue(':value', $_POST[$conf['name']]); $query->execute() or error(db_error($query)); } - + $query = prepare("INSERT INTO ``theme_settings`` VALUES(:theme, NULL, NULL)"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); + + // Clean cache + Cache::delete("themes"); + Cache::delete("theme_settings_".$theme); $result = true; $message = false; @@ -2552,11 +2556,15 @@ function mod_theme_uninstall($theme_name) { if (!hasPermission($config['mod']['themes'])) error($config['error']['noaccess']); - + $query = prepare("DELETE FROM ``theme_settings`` WHERE `theme` = :theme"); $query->bindValue(':theme', $theme_name); $query->execute() or error(db_error($query)); + // Clean cache + Cache::delete("themes"); + Cache::delete("theme_settings_".$theme); + header('Location: ?/themes', true, $config['redirect_http']); } |
