From e4dd61df37472ba91398a63b86117017249ecac2 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 2 Oct 2006 12:15:14 +0000 Subject: [PATCH] Clear template file cache when changing template sets (skins) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11802 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/options/display.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/options/display.php b/include/options/display.php index 2774c9c3..9dd03d1d 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -453,7 +453,7 @@ FIXME! function save_option_template($option) { global $aTemplateSet; - /* Do checking to make sure $new_theme is in the array. */ + /* Do checking to make sure new template is in the available templates array. */ $templateset_in_array = false; for ($i = 0; $i < count($aTemplateSet); ++$i) { if ($aTemplateSet[$i]['ID'] == $option->new_value) { @@ -464,7 +464,20 @@ function save_option_template($option) { if (!$templateset_in_array) { $option->new_value = ''; + } else { + + // clear template cache when changing template sets + // (in order to do so, we have to change the global + // template set ID now... should not be a problem -- + // in fact, if we don't do it now, very anomalous + // problems occur) + // + global $sTemplateID; + $sTemplateID = $option->new_value; + Template::cache_template_file_hierarchy(TRUE); + } + /* Save the option like normal. */ save_option($option); } -- 2.25.1