Added cache for installed themes
authorDan
Wed, 13 May 2009 09:49:15 -0400
changeset 976 50f8eb4f53e1
parent 975 bff25c6113ae
child 977 322a9bf1e280
Added cache for installed themes
plugins/admin/ThemeManager.php
--- a/plugins/admin/ThemeManager.php	Wed May 13 09:48:59 2009 -0400
+++ b/plugins/admin/ThemeManager.php	Wed May 13 09:49:15 2009 -0400
@@ -16,6 +16,8 @@
 {
   global $db, $session, $paths, $template, $plugins; // Common objects
   global $lang;
+  global $cache;
+  
   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   {
     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
@@ -161,6 +163,8 @@
 {
   global $db, $session, $paths, $template, $plugins; // Common objects
   global $lang;
+  global $cache;
+  
   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   {
     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
@@ -329,6 +333,8 @@
         setConfig('theme_default', $theme_data['theme_id']);
       }
       
+      $cache->purge('themes');
+      
       echo '<div class="info-box"><b>' . $lang->get('acptm_msg_save_success') . '</b>' . $warn_default . '</div>';
       
       page_Admin_ThemeManager(true);
@@ -360,6 +366,8 @@
       if ( !$q )
         $db->die_json();
       
+      $cache->purge('themes');
+      
       // The response isn't processed unless it's in JSON.
       echo 'Roger that, over and out.';
       
@@ -399,6 +407,8 @@
       if ( !$q )
         $db->die_json();
       
+      $cache->purge('themes');
+      
       // Change all the users that were on that theme to the default
       $default_style = $template->named_theme_list[$theme_default]['default_style'];
       $default_style = preg_replace('/\.css$/', '', $default_style);