Browse Source

Refactor Theme::getStylesheetPath to return faster if theme style.php doesn't exist

pull/6428/head
Hypolite Petovan 2 years ago
parent
commit
a9b8eb4d56
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/Core/Theme.php

+ 5
- 5
src/Core/Theme.php View File

@ -193,6 +193,10 @@ class Theme
*/
public static function getStylesheetPath($theme)
{
if (!file_exists('view/theme/' . $theme . '/style.php')) {
return 'view/theme/' . $theme . '/style.css';
}
$a = BaseObject::getApp();
$query_params = [];
@ -202,10 +206,6 @@ class Theme
$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.css';
return 'view/theme/' . $theme . '/style.pcss' . (!empty($query_params) ? '?' . http_build_query($query_params) : '');
}
}

Loading…
Cancel
Save