Files
1sonhador 46b20cb1e2 fix: Remove WDMI-specific CSS blocks instead of replacing condition
- Remove entire conditional CSS blocks that were WDMI-specific
- These gradient styles were not needed for MoneyFlix
- Clean up main.php and public-blank.php layouts
2025-10-30 10:01:43 +00:00

150 lines
6.5 KiB
PHP

<?php
declare(strict_types=1);
use App\Core\View;
use App\Core\AppConfig;
use App\Core\AssetManager;
use App\Core\AlertManager;
use App\Core\Branding;
// REMOVIDO: Código de compilação SCSS PHP que não funciona com node_modules
// O build correto é sempre via npx sass (npm/sass) que resolve todas as dependências
// Iniciar sessão
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Obter estatísticas de alertas para o layout
$alertManager = new AlertManager();
$alertStats = $alertManager->getAlertStats();
// Sidebar só é ocultado se $hide_sidebar for explicitamente true
$hide_sidebar = (isset($hide_sidebar) && $hide_sidebar === true) ? true : false;
// Branding dinâmico
$branding = Branding::get();
?>
<!DOCTYPE html>
<html lang="pt" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg" data-sidebar-image="none" data-preloader="disable">
<head>
<meta charset="utf-8" />
<title><?php echo $title ?? 'Dashboard' ?> | <?php echo $branding['company_name'] ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="BitReport CRM - Sistema de Gestão Empresarial" name="description" />
<meta content="<?php echo $branding['company_name'] ?>" name="author" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?php echo $branding['favicon_url']; ?>">
<!-- Theme color for browser -->
<meta name="theme-color" content="<?php echo $branding['theme_color']; ?>">
<!-- Branding Theme Variants for JavaScript -->
<script>
window.brandingVariants = <?php echo json_encode($branding['theme_variants'] ?? []); ?>;
</script>
<!-- Force Theme Settings on Every Load -->
<script>
(function() {
// Define the desired theme attributes.
const themeSettings = {
'data-bs-theme': 'light',
'data-sidebar': 'dark',
'data-layout': 'vertical',
'data-layout-style': 'default',
'data-layout-mode': 'light',
'data-layout-width': 'fluid',
'data-sidebar-size': 'lg',
'data-layout-position': 'fixed',
'data-topbar': 'light'
};
// Apply settings to documentElement and sessionStorage.
for (const [key, value] of Object.entries(themeSettings)) {
if (document.documentElement.getAttribute(key) !== value) {
document.documentElement.setAttribute(key, value);
}
if (sessionStorage.getItem(key) !== value) {
sessionStorage.setItem(key, value);
}
}
})();
</script>
<?php View::include('layouts/head-css.php'); ?>
<!-- App Css-->
<link href="<?php echo View::asset('/assets/css/app.css'); ?>" rel="stylesheet" type="text/css" />
<!-- Sidebar Scroll Fix -->
<link href="<?php echo View::asset('/assets/css/custom-sidebar-fix.css'); ?>" rel="stylesheet" type="text/css" />
<!-- Mobile Menu Fix -->
<link href="<?php echo View::asset('/assets/css/custom-mobile-menu.css'); ?>" rel="stylesheet" type="text/css" />
<!-- Module-specific CSS (auto-loaded) -->
<?php if (isset($module_css)): ?>
<?php echo $module_css; ?>
<?php endif; ?>
<!-- Page specific styles -->
<?php
if (isset($styles) && $styles instanceof Closure) {
$styles();
}
?>
</head>
<body data-bs-theme="<?php echo htmlspecialchars($branding['theme_variants']['data-bs-theme'] ?? 'light'); ?>"
data-layout="<?php echo htmlspecialchars($branding['theme_variants']['data-layout'] ?? 'vertical'); ?>"
data-sidebar="<?php echo htmlspecialchars($branding['theme_variants']['data-sidebar'] ?? 'light'); ?>"
data-sidebar-size="<?php echo htmlspecialchars($branding['theme_variants']['data-sidebar-size'] ?? 'lg'); ?>"
data-layout-style="<?php echo htmlspecialchars($branding['theme_variants']['data-layout-style'] ?? 'default'); ?>"
data-topbar="<?php echo htmlspecialchars($branding['theme_variants']['data-topbar'] ?? 'light'); ?>"
data-layout-width="<?php echo htmlspecialchars($branding['theme_variants']['data-layout-width'] ?? 'fluid'); ?>"
data-layout-position="<?php echo htmlspecialchars($branding['theme_variants']['data-layout-position'] ?? 'fixed'); ?>"
data-sidebar-image="<?php echo htmlspecialchars($branding['theme_variants']['data-sidebar-image'] ?? 'none'); ?>"
data-preloader="<?php echo htmlspecialchars($branding['theme_variants']['data-preloader'] ?? 'enable'); ?>" <?php echo isset($page_name) ? 'data-page="' . htmlspecialchars($page_name) . '"' : '' ?>>
<!-- Begin page -->
<div id="layout-wrapper">
<?php View::include('layouts/menu.php'); ?>
<?php if (($branding['theme_variants']['data-layout'] ?? 'vertical') !== 'horizontal'): ?>
<?php View::include('layouts/sidebar.php'); ?>
<?php else: ?>
<?php View::include('layouts/horizontal-menu.php'); ?>
<?php endif; ?>
<!-- ============================================================== -->
<!-- Start right Content here -->
<!-- ============================================================== -->
<div class="main-content">
<div class="page-content">
<div class="container-fluid">
<?php
// Breadcrumbs/título da página
if (isset($page_title) && $page_title instanceof Closure) {
$page_title();
} elseif (isset($page_title)) {
echo $page_title;
}
// Conteúdo principal da página
if (isset($page_content) && $page_content instanceof Closure) {
$page_content();
} elseif (isset($page_content)) {
echo $page_content;
}
?>
</div>
</div>
<?php View::include('layouts/footer.php'); ?>
</div>
</div>
<?php View::include('layouts/customizer.php'); ?>
<!-- JAVASCRIPT -->
<?php View::include('layouts/vendor-scripts.php'); ?>
<!-- Log Processor - Processamento assíncrono de logs (TEMP DISABLED) -->
<!-- <script src="<?php echo View::asset('/assets/js/log-processor.js'); ?>"></script> -->
<!-- Initialize Customizer after Alpine.js is ready -->
</body>
</html>