myvideogamelist.com/app/Core/Adapters/BootstrapBase.php
Jimmy Brancaccio b39ecf1638 Initial Commit
The initial public commit of MVGL website code.
2024-01-14 13:51:43 -06:00

47 lines
1.4 KiB
PHP

<?php
namespace App\Core\Adapters;
abstract class BootstrapBase
{
public static function initBase()
{
theme()->addHtmlAttribute('body', 'id', 'kt_body');
if (theme()->isDarkModeEnabled() && theme()->getCurrentMode() === 'dark') {
theme()->addHtmlClass('body', 'dark-mode');
}
if (theme()->getOption('layout', 'main/body/background-image')) {
theme()->addHtmlAttribute('body', 'style', 'background-image: url(' . asset(theme()->getMediaUrlPath() . theme()->getOption('layout', 'main/body/background-image')) . ')');
}
if (theme()->getOption('layout', 'main/body/class')) {
theme()->addHtmlClass('body', theme()->getOption('layout', 'main/body/class'));
}
if (theme()->getOption('layout', 'main/body/attributes')) {
theme()->addHtmlAttributes('body', theme()->getOption('layout', 'main/body/attributes'));
}
if (theme()->getOption('layout', 'loader/display') === true) {
theme()->addHtmlClass('body', 'page-loading-enabled');
theme()->addHtmlClass('body', 'page-loading');
}
}
public static function run()
{
if (theme()->getOption('layout', 'base') === 'docs') {
return;
}
// Init base
static::initBase();
// Init layout
if (theme()->getOption('layout', 'main/type') === 'default') {
static::initLayout();
}
}
}