$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;
}
}
// 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;
}
}
// 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');