@ -6,6 +6,7 @@ $controllerPath = $root . '/app/Controllers/AdminController.php';
$templatePath = $root . '/resources/views/venix/admin/index.tpl';
$headerPath = $root . '/resources/views/venix/admin/static_header.tpl';
$footerPath = $root . '/resources/views/venix/admin/static_footer.tpl';
$assetsPath = $root . '/resources/views/venix/layout_assets.tpl';
$sharedStylePath = $root . '/public/theme/venix/css/admin-home.css';
$removedStylePath = $root . '/public/cloud/admin-overview.css';
$schemaPath = $root . '/sql/cloud.sql';
@ -25,6 +26,7 @@ $controller = file_get_contents($controllerPath);
$template = file_get_contents($templatePath);
$header = file_get_contents($headerPath);
$footer = file_get_contents($footerPath);
$assets = file_get_contents($assetsPath);
$styles = file_get_contents($sharedStylePath);
$schema = file_get_contents($schemaPath);
$baseSchema = file_get_contents($baseSchemaPath);
@ -103,16 +105,36 @@ $assert(str_contains($header, '/theme/venix/css/admin-home.css')
& & str_contains($styles, '@media (max-width: 575.98px)'),
'Overview must inherit the existing administrator component and responsive rules.');
$assert(preg_match('/\.admin-template \.app-sidebar-menu\s*\{(?=[^}]*height:\s*100vh)(?=[^}]*height:\s*100dvh)[^}]*\}/s', $styles)
& & preg_match('/\.admin-template-body\.admin-sidebar-open \.admin-sidebar-backdrop\s*\{(?=[^}]*height:\s*100vh)(?=[^}]*height:\s*100dvh)[^}]*\}/s', $styles)
& & str_contains($footer, "window.addEventListener('pagehide', closeSidebar)")
$assert(preg_match('/\.admin-template-body\s*\{(?=[^}]*--admin-viewport-height:\s*100vh)(?=[^}]*padding-bottom:\s*0\s*!important)[^}]*\}/s', $styles)
& & preg_match('/@supports\s*\(height:\s*100dvh\)\s*\{\s*\.admin-template-body\s*\{[^}]*--admin-viewport-height:\s*100dvh/s', $styles)
& & preg_match('/\.admin-template#app-layout\s*\{(?=[^}]*height:\s*auto\s*!important)(?=[^}]*overflow:\s*visible\s*!important)[^}]*\}/s', $styles)
& & preg_match('/\.admin-template \.content-page\s*\{(?=[^}]*display:\s*flex)(?=[^}]*flex-direction:\s*column)[^}]*\}/s', $styles)
& & preg_match('/\.admin-template \.content\s*\{(?=[^}]*flex:\s*1 0 auto)[^}]*\}/s', $styles)
& & preg_match('/\.admin-template \.footer\s*\{(?=[^}]*position:\s*static)[^}]*\}/s', $styles)
& & preg_match('/\.admin-template \.app-sidebar-menu\s*\{(?=[^}]*inset:\s*0 auto auto 0)(?=[^}]*height:\s*var\(--admin-viewport-height,\s*100dvh\))[^}]*\}/s', $styles)
& & preg_match('/\.admin-template-body\.admin-sidebar-open \.admin-sidebar-backdrop\s*\{(?=[^}]*inset:\s*0 0 auto)(?=[^}]*height:\s*var\(--admin-viewport-height,\s*100dvh\))[^}]*\}/s', $styles)
& & str_contains($styles, '.admin-template-body.admin-sidebar-no-transition .app-sidebar-menu')
& & str_contains($footer, 'function measureViewportHeight()')
& & str_contains($footer, 'window.visualViewport')
& & str_contains($footer, "window.visualViewport.addEventListener('resize', scheduleViewportHeight")
& & str_contains($footer, "window.visualViewport.addEventListener('scroll', scheduleViewportHeight")
& & !str_contains($footer, "window.addEventListener('pagehide', closeSidebar)")
& & str_contains($footer, "window.addEventListener('pageshow'")
& & str_contains($footer, 'event.persisted')
& & str_contains($footer, 'closeSidebarImmediately();')
& & substr_count($footer, 'window.requestAnimationFrame(function ()') >= 2
& & str_contains($footer, "document.body.classList.toggle('admin-sidebar-open');\n scheduleViewportHeight();")
& & str_contains($footer, 'target.pathname === current.pathname')
& & str_contains($footer, 'target.search === current.search')
& & str_contains($footer, 'target.hash === current.hash')
& & str_contains($footer, 'event.preventDefault();')
& & !preg_match('/link\.addEventListener\(\'click\'.*?window\.innerWidth < = 991.*?closeSidebar\(\);/s', $footer),
'Mobile administrator navigation must cover the dynamic viewport and keep its overlay during cross-page navigation.');
'Mobile administrator navigation must cover the measured viewport and keep its overlay during cross-page navigation.');
$assetVersion = [];
$assert(preg_match("/venix_asset_version value='([0-9]+)'/", $assets, $assetVersion) === 1
& & (int) $assetVersion[1] >= 2026092904
& & str_contains($assets, 'cache key'),
'This administrator asset release must use cache key 2026092904 or newer.');
echo 'Administrator operational overview contracts passed.' . PHP_EOL;