- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css, js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img, fonts→assets/fonts; 删除 assets/vendor - libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向 - 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入 路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_* - 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化 - 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→ window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel, .zib-slider→.aksrt-slider, zib_menu_options meta 键等 - 自有 CSS 改名: legacy-utilities/compat-vars/footer shell - admin SPA 重建; 契约测试同步(路径/断言/文件更名) - 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用) 验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过; 契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
68 lines
2.7 KiB
PHP
68 lines
2.7 KiB
PHP
<?php
|
|
/**
|
|
* Site header: document shell + legacy-contract top navigation.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$aksrt_header_settings = class_exists('\AKSRT\Settings\Settings')
|
|
? \AKSRT\Settings\Settings::read_domain('page_display', 'header-nav')
|
|
: [];
|
|
$aksrt_header_layout = sanitize_key((string) ($aksrt_header_settings['header_layout'] ?? '1'));
|
|
if (!in_array($aksrt_header_layout, ['1', '2', '3'], true)) {
|
|
$aksrt_header_layout = '1';
|
|
}
|
|
$aksrt_mobile_layout = sanitize_key((string) ($aksrt_header_settings['mobile_header_layout'] ?? 'center'));
|
|
if (!in_array($aksrt_mobile_layout, ['center', 'left'], true)) {
|
|
$aksrt_mobile_layout = 'center';
|
|
}
|
|
$aksrt_mobile_align = sanitize_key((string) ($aksrt_header_settings['mobile_navbar_align'] ?? 'left'));
|
|
if (!in_array($aksrt_mobile_align, ['top', 'left', 'right'], true)) {
|
|
$aksrt_mobile_align = 'left';
|
|
}
|
|
|
|
$aksrt_initial_theme_mode = '';
|
|
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'initial_theme_mode')) {
|
|
$aksrt_initial_theme_mode = \AKSRT\Settings\Settings::initial_theme_mode();
|
|
}
|
|
$aksrt_has_initial_theme = in_array($aksrt_initial_theme_mode, ['dark', 'light'], true);
|
|
|
|
$aksrt_body_classes = [];
|
|
// legacy: body.nav-fixed drives top padding + hero pull-under-nav.
|
|
if (!isset($aksrt_header_settings['nav_fixed']) || !empty($aksrt_header_settings['nav_fixed'])) {
|
|
$aksrt_body_classes[] = 'nav-fixed';
|
|
} else {
|
|
$aksrt_body_classes[] = 'has-static-nav';
|
|
}
|
|
|
|
if ($aksrt_initial_theme_mode === 'dark') {
|
|
$aksrt_body_classes[] = 'theme-dark';
|
|
$aksrt_body_classes[] = 'dark-theme';
|
|
} elseif ($aksrt_initial_theme_mode === 'light') {
|
|
$aksrt_body_classes[] = 'white-theme';
|
|
}
|
|
$aksrt_body_classes[] = 'header-layout-' . $aksrt_header_layout;
|
|
$aksrt_body_classes[] = 'mobile-header-' . $aksrt_mobile_layout;
|
|
$aksrt_body_classes[] = 'mobile-nav-' . $aksrt_mobile_align;
|
|
|
|
?><!DOCTYPE html>
|
|
<html lang="<?php echo esc_attr(str_replace('_', '-', get_bloginfo('language'))); ?>"<?php echo $aksrt_initial_theme_mode === 'dark' ? ' class="dark"' : ''; ?><?php echo $aksrt_has_initial_theme ? ' data-theme="' . esc_attr($aksrt_initial_theme_mode) . '"' : ''; ?>>
|
|
<head>
|
|
<meta charset="<?php bloginfo('charset'); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
<body <?php body_class($aksrt_body_classes); ?><?php echo $aksrt_has_initial_theme ? ' data-theme="' . esc_attr($aksrt_initial_theme_mode) . '"' : ''; ?>>
|
|
<?php wp_body_open(); ?>
|
|
|
|
|
|
<?php
|
|
if (function_exists('aksrt_header')) {
|
|
aksrt_header();
|
|
}
|
|
|
|
\AKSRT\WidgetSystem\WidgetAreas::render('all_top_fluid', 'fluid-widget-wrap');
|
|
?>
|