mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
FIX: Theme detection
This commit is contained in:
parent
04405b1ba3
commit
a3c4e19f95
@ -79,7 +79,19 @@ class WebpackTemplateProvider implements TemplateGlobalProvider
|
|||||||
public static function mainTheme()
|
public static function mainTheme()
|
||||||
{
|
{
|
||||||
$themes = Config::inst()->get(SSViewer::class, 'themes');
|
$themes = Config::inst()->get(SSViewer::class, 'themes');
|
||||||
return is_array($themes) && $themes[0] !== '$public' && $themes[0] !== '$default' ? $themes[0] : false;
|
if (!is_array($themes)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$theme = null;
|
||||||
|
foreach ($themes as $t) {
|
||||||
|
if ($t !== '$public' && $t !== '$default') {
|
||||||
|
$theme = $t;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function resourcesURL($link = null): string
|
public static function resourcesURL($link = null): string
|
||||||
|
Loading…
Reference in New Issue
Block a user