Removed outdated package-based style handling
authorAlexander Ebert <ebert@woltlab.com>
Sun, 30 Dec 2012 01:54:19 +0000 (02:54 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 30 Dec 2012 01:54:19 +0000 (02:54 +0100)
Fixes #1031

wcfsetup/install/files/lib/system/style/StyleHandler.class.php

index bac726d53f25ea6afe2310f1520a22db1fa718d2..74221c7b5457fb8724af697e5b45f702dcd3082d 100644 (file)
@@ -53,7 +53,7 @@ class StyleHandler extends SingletonFactory {
                $styles = array();
                
                foreach ($this->cache['styles'] as $styleID => $style) {
-                       if ((!$style->isDisabled && empty($this->cache['packages'][PACKAGE_ID]['disabled'][$styleID])) || WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
+                       if (!$style->isDisabled || WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
                                $styles[$styleID] = $style;
                        }
                }
@@ -84,7 +84,7 @@ class StyleHandler extends SingletonFactory {
                // check permission
                if (!$ignorePermissions) {
                        if (isset($this->cache['styles'][$styleID])) {
-                               if (($this->cache['styles'][$styleID]->isDisabled || !empty($this->cache['packages'][PACKAGE_ID]['disabled'][$styleID])) && !WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
+                               if ($this->cache['styles'][$styleID]->isDisabled && !WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
                                        $styleID = 0;
                                }
                        }
@@ -92,14 +92,8 @@ class StyleHandler extends SingletonFactory {
                
                // fallback to default style
                if (!isset($this->cache['styles'][$styleID])) {
-                       // get package default style
-                       if (!empty($this->cache['packages'][PACKAGE_ID]['default'])) {
-                               $styleID = $this->cache['packages'][PACKAGE_ID]['default'];
-                       }
-                       // get global default style
-                       else {
-                               $styleID = $this->cache['default'];
-                       }
+                       // get default style
+                       $styleID = $this->cache['default'];
                        
                        if (!isset($this->cache['styles'][$styleID])) {
                                throw new SystemException('no default style defined');