All stylesheets are now reseted upon (un-)installation
authorAlexander Ebert <ebert@woltlab.com>
Fri, 7 Dec 2012 14:54:51 +0000 (15:54 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 7 Dec 2012 14:54:51 +0000 (15:54 +0100)
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php
wcfsetup/install/files/lib/system/style/StyleHandler.class.php

index 50c3ea4ba6c5827122c2639fe2b276551771979f..b221662b13dfd7d34c6e83156e4b7f1cbe52aaa8 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 namespace wcf\system\package;
+use wcf\system\style\StyleHandler;
+
 use wcf\data\application\Application;
 use wcf\data\application\ApplicationEditor;
 use wcf\data\language\category\LanguageCategory;
@@ -155,6 +157,9 @@ class PackageInstallationDispatcher {
                        // reset language cache
                        LanguageFactory::getInstance()->clearCache();
                        LanguageFactory::getInstance()->deleteLanguageCache();
+                       
+                       // reset stylesheets
+                       StyleHandler::resetStylesheets();
                }
                
                return $step;
index 7da14fd96ab0046eddbcf384cee22622f0d4e387..69c3523fbc61d5047ba5e93f2ddcd442ddd6fb18 100644 (file)
@@ -90,6 +90,9 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher {
                        LanguageFactory::getInstance()->clearCache();
                        LanguageFactory::getInstance()->deleteLanguageCache();
                        
+                       // reset stylesheets
+                       StyleHandler::resetStylesheets();
+                       
                        // rebuild application paths
                        ApplicationHandler::rebuild();
                }
index 7570e0561ea7358f30d756f90ed3dd730652c824..2951d33a528a73493e201483a3817caa00c02c57 100644 (file)
@@ -152,4 +152,21 @@ class StyleHandler extends SingletonFactory {
                        @unlink($stylesheet);
                }
        }
+       
+       /**
+        * Resets all stylesheets.
+        */
+       public static function resetStylesheets() {
+               // frontend stylesheets
+               $stylesheets = glob(WCF_DIR.'style/style-*.css');
+               foreach ($stylesheets as $stylesheet) {
+                       @unlink($stylesheet);
+               }
+               
+               // ACP stylesheets
+               $stylesheets = glob(WCF_DIR.'acp/style/style*.css');
+               foreach ($stylesheets as $stylesheet) {
+                       @unlink($stylesheet);
+               }
+       }
 }