Refactor Theme::getStylesheetPath to return faster if theme style.php doesn't exist
This commit is contained in:
parent
abf20368b0
commit
a9b8eb4d56
1 changed files with 5 additions and 5 deletions
|
@ -193,6 +193,10 @@ class Theme
|
||||||
*/
|
*/
|
||||||
public static function getStylesheetPath($theme)
|
public static function getStylesheetPath($theme)
|
||||||
{
|
{
|
||||||
|
if (!file_exists('view/theme/' . $theme . '/style.php')) {
|
||||||
|
return 'view/theme/' . $theme . '/style.css';
|
||||||
|
}
|
||||||
|
|
||||||
$a = BaseObject::getApp();
|
$a = BaseObject::getApp();
|
||||||
|
|
||||||
$query_params = [];
|
$query_params = [];
|
||||||
|
@ -202,10 +206,6 @@ class Theme
|
||||||
$query_params['puid'] = $puid;
|
$query_params['puid'] = $puid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists('view/theme/' . $theme . '/style.php')) {
|
|
||||||
return 'view/theme/' . $theme . '/style.pcss' . (!empty($query_params) ? '?' . http_build_query($query_params) : '');
|
return 'view/theme/' . $theme . '/style.pcss' . (!empty($query_params) ? '?' . http_build_query($query_params) : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'view/theme/' . $theme . '/style.css';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue