feat(navigation): hard-switch to Zibll navigation and Font Awesome 5

This commit is contained in:
kate522 committed 2026-08-18 20:46:21 +08:00
1 parent 3c3ddac8be
commit a0b84977a2
630 files changed
+101647 -11293

No files matched your search

+52 -42
View File
@@ -315,58 +315,68 @@ class GlobalSchema {
'version' => '2.0.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'basic', 'title' => '搜索基础', 'fields' => [
['key' => 'search_mode', 'label' => '搜索模式', 'type' => 'radio', 'default' => 'default', 'options' => [
['label' => '默认搜索', 'value' => 'default'],
['label' => 'AJAX 实时搜索', 'value' => 'ajax'],
['label' => '跳转搜索', 'value' => 'redirect'],
]],
['key' => 'search_placeholder', 'label' => '搜索框提示文字', 'type' => 'input', 'default' => '开启精彩搜索'],
]],
['key' => 'content-types', 'title' => '搜索内容类型', 'fields' => [
['key' => 'search_type_post', 'label' => '文章', 'type' => 'switch', 'default' => true],
['key' => 'search_type_user', 'label' => '用户', 'type' => 'switch', 'default' => false],
['key' => 'search_type_category', 'label' => '分类', 'type' => 'switch', 'default' => true],
['key' => 'search_type_tag', 'label' => '标签', 'type' => 'switch', 'default' => true],
['key' => 'search_type_product', 'label' => '商品', 'type' => 'switch', 'default' => false],
['key' => 'search_default_type', 'label' => '默认类型', 'type' => 'select', 'default' => 'post', 'options' => [
['label' => '文章', 'value' => 'post'],
['label' => '用户', 'value' => 'user'],
['label' => '分类', 'value' => 'category'],
['label' => '标签', 'value' => 'tag'],
['label' => '商品', 'value' => 'product'],
]],
]],
['key' => 'features', 'title' => '搜索功能', 'fields' => [
['key' => 'search_history_enabled', 'label' => '搜索历史', 'type' => 'switch', 'default' => true],
['key' => 'hot_search_enabled', 'label' => '热门搜索', 'type' => 'switch', 'default' => true],
['key' => 'hot_search_keywords', 'label' => '热门搜索关键词', 'type' => 'textarea', 'default' => ''],
['key' => 'search_suggestions_enabled', 'label' => '搜索建议', 'type' => 'switch', 'default' => false],
['key' => 'basic', 'title' => '搜索基础', 'fields' => [
['key' => 'search_placeholder', 'label' => '搜索框提示文字', 'type' => 'input', 'default' => '开启精彩搜索'],
]],
['key' => 'content-types', 'title' => '搜索内容类型', 'fields' => [
['key' => 'search_type', 'label' => '显示切换搜索类型按钮', 'type' => 'switch', 'default' => true],
['key' => 'search_type_in', 'label' => '默认搜索类型', 'type' => 'radio', 'default' => 'post', 'options' => [
['label' => '文章', 'value' => 'post'],
['label' => '用户', 'value' => 'user'],
]],
]],
['key' => 'features', 'title' => '搜索功能', 'fields' => [
['key' => 'search_history', 'label' => '搜索历史', 'type' => 'switch', 'default' => true],
['key' => 'search_popular_key', 'label' => '热门搜索', 'type' => 'switch', 'default' => true],
['key' => '404_search_s', 'label' => '在 404 页面显示搜索功能', 'type' => 'switch', 'default' => true],
['key' => 'search_posts', 'label' => '搜索框热门文章', 'type' => 'switch', 'default' => true, 'help' => '在搜索面板中显示热门文章列表'],
['key' => 'search_no_page', 'label' => '排除页面', 'type' => 'switch', 'default' => true, 'help' => '搜索结果中排除页面(仅显示文章)'],
['key' => 'search_exclude_cats', 'label' => '排除分类', 'type' => 'textarea', 'default' => '', 'help' => '搜索结果中排除的分类 ID(逗号分隔)'],
['key' => 'search_exclude_cats', 'label' => '排除分类', 'type' => 'taxonomy_select', 'taxonomy' => ['category', 'shop_cat'], 'multiple' => true, 'default' => [], 'help' => '搜索结果中排除的文章或商品分类'],
['key' => 'search_custom_key_s', 'label' => '自定义匹配范围', 'type' => 'switch', 'default' => true, 'help' => '启用后可配置搜索匹配字段范围(标题/内容/分类/标签等)'],
['key' => 'search_custom_key', 'label' => '匹配字段', 'type' => 'textarea', 'default' => 'title,content', 'help' => '搜索匹配的字段范围(逗号分隔:title/content/excerpt/category/tag/author)'],
['key' => 'search_facets', 'label' => '搜索结果筛选', 'type' => 'switch', 'default' => false, 'help' => '启用搜索结果 taxonomy 筛选面板'],
['key' => 'search_facets_order', 'label' => '筛选排序', 'type' => 'textarea', 'default' => "category\ntag", 'help' => '筛选 fieldset 显示顺序(每行一个 taxonomy slug)'],
['key' => 'search_custom_key', 'label' => '匹配字段', 'type' => 'checkbox', 'default' => ['title', 'content', 'excerpt', 'post_tag', 'forum_topic', 'shop_cat', 'shop_discount'], 'options' => [
['label' => '标题', 'value' => 'title'], ['label' => '内容', 'value' => 'content'], ['label' => '简介', 'value' => 'excerpt'],
['label' => '分类', 'value' => 'category'], ['label' => '标签', 'value' => 'post_tag'], ['label' => '专题', 'value' => 'topics'],
['label' => '评论', 'value' => 'coment'], ['label' => '作者昵称', 'value' => 'user'],
['label' => '[帖子]话题', 'value' => 'forum_topic'], ['label' => '[帖子]标签', 'value' => 'forum_tag'],
['label' => '[商品]分类', 'value' => 'shop_cat'], ['label' => '[商品]特色标签', 'value' => 'shop_tag'], ['label' => '[商品]优惠活动', 'value' => 'shop_discount'],
]],
['key' => 'search_facets', 'label' => '搜索筛选', 'type' => 'fieldset', 'sanitize_type' => 'array', 'default' => [], 'dependsOn' => ['key' => 'search_ms_s', 'value' => false], 'help' => '搜索结果中显示的筛选列表;启用 Meilisearch 后由搜索引擎生成关联筛选。', 'fields' => [
['key' => 'category', 'label' => '[文章] 分类', 'type' => 'taxonomy_select', 'taxonomy' => 'category', 'multiple' => true, 'default' => []],
['key' => 'topics', 'label' => '[文章] 专题', 'type' => 'taxonomy_select', 'taxonomy' => 'topics', 'multiple' => true, 'default' => []],
['key' => 'post_tag', 'label' => '[文章] 标签', 'type' => 'taxonomy_select', 'taxonomy' => 'post_tag', 'multiple' => true, 'default' => []],
['key' => 'plate_id', 'label' => '[论坛帖子] 板块 ID', 'type' => 'input', 'default' => ''],
['key' => 'forum_topic', 'label' => '[论坛帖子] 话题', 'type' => 'taxonomy_select', 'taxonomy' => 'forum_topic', 'multiple' => true, 'default' => []],
['key' => 'forum_tag', 'label' => '[论坛帖子] 标签', 'type' => 'taxonomy_select', 'taxonomy' => 'forum_tag', 'multiple' => true, 'default' => []],
['key' => 'shop_cat', 'label' => '[商品] 分类', 'type' => 'taxonomy_select', 'taxonomy' => 'shop_cat', 'multiple' => true, 'default' => []],
['key' => 'shop_discount', 'label' => '[商品] 优惠活动', 'type' => 'taxonomy_select', 'taxonomy' => 'shop_discount', 'multiple' => true, 'default' => []],
['key' => 'shop_tag', 'label' => '[商品] 特色标签', 'type' => 'taxonomy_select', 'taxonomy' => 'shop_tag', 'multiple' => true, 'default' => []],
]],
]],
['key' => 'category-search', 'title' => '分类搜索', 'fields' => [
['key' => 'search_cat', 'label' => '启用分类搜索', 'type' => 'switch', 'default' => true, 'help' => '在搜索框旁显示分类选择器'],
['key' => 'search_cat_in', 'label' => '默认分类', 'type' => 'input', 'default' => '', 'help' => '默认搜索的分类 ID(留空为全部分类)'],
['key' => 'search_more_cat_obj', 'label' => '显示更多分类', 'type' => 'switch', 'default' => true, 'help' => '展开显示全部分类列表'],
['key' => 'search_cat_in', 'label' => '默认分类', 'type' => 'taxonomy_select', 'taxonomy' => 'category', 'multiple' => false, 'default' => '', 'help' => '留空为全部分类'],
['key' => 'search_more_cat_obj', 'label' => '允许选择的更多分类', 'type' => 'taxonomy_select', 'taxonomy' => 'category', 'multiple' => true, 'default' => []],
]],
['key' => 'popular', 'title' => '热门搜索', 'fields' => [
['key' => 'search_popular_title', 'label' => '标题', 'type' => 'input', 'default' => '热门搜索'],
['key' => 'search_popular_key_num', 'label' => '显示数量', 'type' => 'number', 'default' => 20, 'min' => 1, 'max' => 50],
['key' => 'search_popular_sticky', 'label' => '置顶词(每行一个)', 'type' => 'textarea', 'default' => ''],
]],
['key' => 'meilisearch', 'title' => 'Meilisearch 集成', 'fields' => [
['key' => 'search_ms_enabled', 'label' => '启用 Meilisearch', 'type' => 'switch', 'default' => false, 'help' => '启用后搜索请求将发送至 Meilisearch 服务器'],
['key' => 'search_ms_api_url', 'label' => 'API 地址', 'type' => 'input', 'default' => '', 'help' => 'Meilisearch 服务器 URL'],
['key' => 'search_ms_api_key', 'label' => 'API Key', 'type' => 'input', 'default' => '', 'help' => 'Meilisearch Search API Key(只读密钥)'],
['key' => 'search_ms_index_prefix', 'label' => '索引前缀', 'type' => 'input', 'default' => 'aksrt', 'help' => '索引名称前缀'],
['key' => 'search_ms_synonyms', 'label' => '同义词(JSON)', 'type' => 'textarea', 'default' => '', 'help' => 'Meilisearch 同义词配置 JSON'],
['key' => 'search_popular_key_num', 'label' => '显示数量', 'type' => 'number', 'default' => 20, 'min' => 10, 'max' => 50, 'step' => 2],
['key' => 'search_popular_sticky', 'label' => '置顶关键词', 'type' => 'input', 'default' => '', 'help' => '使用逗号分隔;可追加 &type=user 指定搜索类型'],
]],
['key' => 'meilisearch', 'title' => 'Meilisearch 智能搜索', 'fields' => [
['key' => 'search_ms_s', 'label' => '启用 Meilisearch', 'type' => 'switch', 'default' => false],
['key' => 'search_ms_opt', 'label' => 'Meilisearch 参数', 'type' => 'fieldset', 'sanitize_type' => 'array', 'default' => [
'api_url' => 'http://127.0.0.1:7700', 'api_key' => '', 'index_prefix' => 'aksrt',
'synonyms' => [['key' => 'wordpress', 'val' => 'wp,wordp,wordpre']],
], 'dependsOn' => ['key' => 'search_ms_s', 'value' => true], 'fields' => [
['key' => 'api_url', 'label' => 'API 地址', 'type' => 'input', 'default' => 'http://127.0.0.1:7700'],
['key' => 'api_key', 'label' => 'API 密钥', 'type' => 'input', 'default' => ''],
['key' => 'index_prefix', 'label' => '索引前缀', 'type' => 'input', 'default' => 'aksrt'],
['key' => 'synonyms', 'label' => '同义词', 'type' => 'repeater', 'default' => [['key' => 'wordpress', 'val' => 'wp,wordp,wordpre']], 'addText' => '添加同义词', 'fields' => [
['key' => 'key', 'label' => '关键词', 'type' => 'input', 'default' => ''],
['key' => 'val', 'label' => '同义词', 'type' => 'textarea', 'default' => ''],
]],
]],
]],
],
],
'email' => [
@@ -119,7 +119,7 @@ class SchemaPostListList {
]],
['key' => 'paging_ajax_ias_s', 'label' => 'AJAX 自动加载', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'paging_ajax_s', 'value' => '1']],
['key' => 'ias_max', 'label' => '自动加载页数', 'type' => 'number', 'default' => 3, 'min' => 0, 'max' => 10, 'dependsOn' => ['key' => 'paging_ajax_s', 'value' => '1']],
['key' => 'ajax_trigger', 'label' => '翻页按钮文字', 'type' => 'textarea', 'sanitize_type' => 'html', 'default' => '<i class="fa fa-angle-right"></i>加载更多'],
['key' => 'ajax_trigger', 'label' => '翻页按钮文字', 'type' => 'textarea', 'sanitize_type' => 'html', 'default' => '<i class="fa fas fa-angle-right"></i>加载更多'],
['key' => 'ajax_nomore', 'label' => '列表全部加载完毕文案', 'type' => 'textarea', 'sanitize_type' => 'html', 'default' => '没有更多内容了'],
],
],
+152 -153
View File
@@ -20,16 +20,10 @@ class SchemaPageDisplay {
'version' => '1.1.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'layout', 'title' => '导航栏布局', 'fields' => [
['key' => 'header_fixed', 'label' => '固定导航栏', 'type' => 'switch', 'default' => true],
['key' => 'header_nav_style', 'label' => '导航栏风格', 'type' => 'radio', 'default' => 'default', 'options' => [
['label' => '默认', 'value' => 'default'],
['label' => '透明', 'value' => 'transparent'],
['label' => '毛玻璃', 'value' => 'blur'],
]],
['key' => 'header_max_width', 'label' => '导航栏最大宽度', 'type' => 'number', 'default' => 1200, 'min' => 0, 'max' => 1600],
['key' => 'header_scroll_down_hide', 'label' => '下滑隐藏导航栏', 'type' => 'switch', 'default' => true],
]],
['key' => 'layout', 'title' => '导航栏布局', 'fields' => [
['key' => 'nav_fixed', 'label' => '导航栏一直固定在顶部', 'type' => 'switch', 'default' => true],
['key' => 'nav_scroll_down_hide', 'label' => '下滚动隐藏,上滚动显示', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'nav_fixed', 'value' => true]],
]],
['key' => 'layout-type', 'title' => '布局类型', 'fields' => [
['key' => 'header_layout', 'label' => '桌面端布局', 'type' => 'image_select', 'default' => '1', 'options' => self::header_layout_options()],
['key' => 'mobile_header_layout', 'label' => '移动端布局', 'type' => 'image_select', 'default' => 'center', 'options' => self::mobile_header_layout_options()],
@@ -39,18 +33,15 @@ class SchemaPageDisplay {
['label' => '右侧滑出', 'value' => 'right'],
]],
]],
['key' => 'components', 'title' => '导航组件', 'fields' => [
['key' => 'header_search_enabled', 'label' => '搜索入口', 'type' => 'switch', 'default' => true],
['key' => 'header_user_menu', 'label' => '用户菜单', 'type' => 'switch', 'default' => true],
['key' => 'header_mobile_drawer', 'label' => '移动端抽屉导航', 'type' => 'switch', 'default' => true],
['key' => 'header_nav_pay_vip', 'label' => '导航栏开通会员按钮', 'type' => 'switch', 'default' => true],
['key' => 'header_nav_user_pay_vip', 'label' => '用户框开通会员按钮', 'type' => 'switch', 'default' => true],
]],
['key' => 'newposts', 'title' => '发布按钮', 'fields' => [
['key' => 'header_newposts_enabled', 'label' => '启用发布按钮', 'type' => 'switch', 'default' => true],
['key' => 'header_newposts_text', 'label' => '按钮文案', 'type' => 'input', 'default' => '<i class="fa fa-pencil"></i> 发布'],
['key' => 'header_newposts_radius', 'label' => '按钮圆角(胶囊)', 'type' => 'switch', 'default' => true],
['key' => 'header_newposts_class', 'label' => '按钮颜色', 'type' => 'select', 'default' => 'jb-blue', 'options' => [
['key' => 'components', 'title' => '导航组件', 'fields' => [
['key' => 'nav_pay_vip', 'label' => '导航栏开通会员按钮', 'type' => 'switch', 'default' => true],
['key' => 'nav_user_pay_vip', 'label' => '用户框开通会员按钮', 'type' => 'switch', 'default' => true],
]],
['key' => 'newposts', 'title' => '发布按钮', 'fields' => [
['key' => 'nav_newposts', 'label' => '启用发布按钮', 'type' => 'switch', 'default' => true],
['key' => 'nav_newposts_text', 'label' => '按钮文案', 'type' => 'input', 'default' => '<i class="fa fas fa-fw fa-pen"></i>发布', 'dependsOn' => ['key' => 'nav_newposts', 'value' => true]],
['key' => 'nav_newposts_radius', 'label' => '按钮圆角(胶囊)', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'nav_newposts', 'value' => true]],
['key' => 'nav_newposts_class', 'label' => '按钮颜色', 'type' => 'select', 'default' => 'jb-blue', 'dependsOn' => ['key' => 'nav_newposts', 'value' => true], 'options' => [
['label' => '蓝色', 'value' => 'jb-blue'],
['label' => '红色', 'value' => 'jb-red'],
['label' => '绿色', 'value' => 'jb-green'],
@@ -58,13 +49,16 @@ class SchemaPageDisplay {
['label' => '紫色', 'value' => 'jb-purple'],
['label' => '粉色', 'value' => 'jb-pink'],
]],
['key' => 'header_newposts_types', 'label' => '发布类型', 'type' => 'checkbox', 'default' => ['post'], 'options' => [
['label' => '文章', 'value' => 'post'],
]],
['key' => 'header_user_newposts_btn', 'label' => '用户卡发布类型', 'type' => 'select', 'default' => 'post', 'options' => [
['label' => '文章', 'value' => 'post'],
]],
['key' => 'header_user_newposts_text', 'label' => '用户卡发布文案', 'type' => 'input', 'default' => '发布内容'],
['key' => 'nav_newposts_btns', 'label' => '需显示的按钮', 'type' => 'checkbox', 'default' => ['post', 'bbs_topic', 'bbs_plate', 'bbs_posts'], 'dependsOn' => ['key' => 'nav_newposts', 'value' => true], 'options' => [
['label' => '文章', 'value' => 'post'],
['label' => '论坛话题', 'value' => 'bbs_topic'],
['label' => '论坛版块', 'value' => 'bbs_plate'],
['label' => '论坛帖子', 'value' => 'bbs_posts'],
]],
['key' => 'nav_user_newposts_btn', 'label' => '用户卡发布类型', 'type' => 'select', 'default' => 'post', 'options' => [
['label' => '文章', 'value' => 'post'],
]],
['key' => 'nav_user_newposts_btn_text', 'label' => '用户卡发布文案', 'type' => 'input', 'default' => '发布文章'],
]],
['key' => 'color', 'title' => '颜色设置', 'fields' => [
['key' => 'header_theme_custom', 'label' => '自定义导航栏颜色', 'type' => 'switch', 'default' => false],
@@ -74,91 +68,59 @@ class SchemaPageDisplay {
]],
],
],
'header-components' => [
'key' => 'header-components',
'title' => '顶部多功能组件',
'description' => '配置顶部组件的显示范围、设备规则、轮播参数、搜索覆盖层与图标卡片。幻灯片图片/文案内容请到「Hero 轮播」「Banner 轮播」管理。',
'version' => '1.1.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'visibility', 'title' => '显示规则', 'fields' => [
['key' => 'header_components_search_enabled', 'label' => '启用搜索覆盖层', 'type' => 'switch', 'default' => true],
['key' => 'header_components_cards_enabled', 'label' => '启用图标卡片', 'type' => 'switch', 'default' => false],
['key' => 'header_components_show_on', 'label' => '按页面类型启用', 'type' => 'checkbox', 'default' => ['home'], 'options' => [
['label' => '首页', 'value' => 'home'],
['label' => '分类页', 'value' => 'category'],
['label' => '标签页', 'value' => 'tag'],
['label' => '用户页', 'value' => 'author'],
['label' => '文章页', 'value' => 'single'],
['label' => '搜索页', 'value' => 'search'],
['label' => '其它页面', 'value' => 'page'],
]],
['key' => 'header_components_device_visibility', 'label' => '设备显示规则', 'type' => 'radio', 'default' => '', 'options' => [
['label' => '全部', 'value' => ''],
['label' => '仅电脑', 'value' => 'only_pc'],
['label' => '仅移动', 'value' => 'only_sm'],
]],
]],
['key' => 'nav-color', 'title' => '导航栏配色', 'fields' => [
['key' => 'header_components_nav_color', 'label' => '导航栏文字颜色', 'type' => 'color', 'default' => '#ffffff'],
]],
['key' => 'slider-config', 'title' => '幻灯片配置', 'fields' => [
['key' => 'slider_config_direction', 'label' => '滑动方向', 'type' => 'radio', 'default' => 'horizontal', 'dependsOn' => ['key' => 'header_components_show_on', 'not' => []], 'options' => [
['label' => '水平', 'value' => 'horizontal'],
['label' => '垂直', 'value' => 'vertical'],
]],
['key' => 'slider_config_speed', 'label' => '切换速度(ms)', 'type' => 'number', 'default' => 300, 'min' => 100, 'max' => 3000, 'dependsOn' => ['key' => 'header_components_show_on', 'not' => []]],
['key' => 'slider_config_button', 'label' => '显示前进后退按钮', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'header_components_show_on', 'not' => []]],
['key' => 'slider_config_scale_height', 'label' => '缩放高度', 'type' => 'switch', 'default' => false, 'dependsOn' => ['key' => 'header_components_show_on', 'not' => []]],
['key' => 'slider_config_scale', 'label' => '缩放效果', 'type' => 'switch', 'default' => false, 'dependsOn' => ['key' => 'header_components_show_on', 'not' => []]],
['key' => 'slider_config_max_height', 'label' => '最大高度', 'type' => 'input', 'default' => '', 'dependsOn' => ['key' => 'header_components_show_on', 'not' => []]],
['key' => 'slider_config_min_height', 'label' => '最小高度', 'type' => 'input', 'default' => '', 'dependsOn' => ['key' => 'header_components_show_on', 'not' => []]],
]],
['key' => 'search', 'title' => '搜索组件', 'fields' => [
['key' => 'header_components_search_pc', 'label' => 'PC 端显示搜索', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'header_components_search_enabled', 'value' => true]],
['key' => 'header_components_search_mobile', 'label' => '移动端显示搜索', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'header_components_search_enabled', 'value' => true]],
['key' => 'header_components_search_show_keywords', 'label' => '热门搜索', 'type' => 'switch', 'default' => true, 'dependsOn' => ['key' => 'header_components_search_enabled', 'value' => true]],
['key' => 'header_components_search_popular_limit', 'label' => '关键词最多显示', 'type' => 'number', 'default' => 6, 'min' => 2, 'max' => 50, 'dependsOn' => ['key' => 'header_components_search_show_keywords', 'value' => true]],
['key' => 'header_components_search_show_input_cat', 'label' => '显示分类搜索', 'type' => 'switch', 'default' => false, 'dependsOn' => ['key' => 'header_components_search_enabled', 'value' => true]],
['key' => 'header_components_search_show_type', 'label' => '显示类型切换', 'type' => 'switch', 'default' => false, 'dependsOn' => ['key' => 'header_components_search_enabled', 'value' => true]],
[
'key' => 'header_components_search_before_html',
'label' => '搜索上方额外内容',
'type' => 'textarea',
'sanitize_type' => 'html',
'default' => '<div class="em16 font-bold mb10">更优雅的Wordpress主题</div>
<div>这是导航栏幻灯片多功能组件,可在后台进行配置</div>',
'dependsOn' => ['key' => 'header_components_search_enabled', 'value' => true],
'help' => 'Hero 主标题/副标题写在这里(支持 HTML)。勿依赖幻灯片文案,以免与搜索重叠;请注意组件总高度。',
],
[
'key' => 'header_components_search_after_html',
'label' => '搜索下方额外内容',
'type' => 'textarea',
'sanitize_type' => 'html',
'default' => '',
'dependsOn' => ['key' => 'header_components_search_enabled', 'value' => true],
'help' => '支持 HTML;请注意组件总高度。',
],
]],
['key' => 'cards', 'title' => '图标卡片样式', 'fields' => [
['key' => 'header_components_filter_blur_devices', 'label' => '组件高斯模糊特效', 'type' => 'checkbox', 'default' => ['pc', 'mobile'], 'options' => [
['label' => 'PC', 'value' => 'pc'],
['label' => '移动端', 'value' => 'mobile'],
]],
['key' => 'header_components_card_show_devices', 'label' => '卡片显示设备', 'type' => 'checkbox', 'default' => ['pc', 'mobile'], 'dependsOn' => ['key' => 'header_components_cards_enabled', 'value' => true], 'options' => [
['label' => 'PC', 'value' => 'pc'],
['label' => '移动端', 'value' => 'mobile'],
]],
['key' => 'header_components_card_shared_bg', 'label' => '共享卡片背景', 'type' => 'switch', 'default' => false, 'dependsOn' => ['key' => 'header_components_cards_enabled', 'value' => true]],
['key' => 'header_components_card_icon_shape', 'label' => '图标形状', 'type' => 'radio', 'default' => 'circle', 'dependsOn' => ['key' => 'header_components_cards_enabled', 'value' => true], 'options' => [
['label' => '圆形', 'value' => 'circle'],
['label' => '方形', 'value' => 'square'],
]],
]],
['key' => 'icon-cards', 'title' => '图标卡片列表', 'fields' => [
['key' => 'header_components_icon_cards', 'label' => '图标卡片', 'type' => 'repeater', 'sanitize_type' => 'array', 'default' => [], 'dependsOn' => ['key' => 'header_components_cards_enabled', 'value' => true]],
]],
'header-components' => [
'key' => 'header-components',
'title' => '顶部多功能组件',
'description' => 'Zibll 顶部幻灯、搜索覆盖层与图标卡片的原始字段契约。',
'version' => '2.0.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'visibility', 'title' => '显示规则', 'fields' => [
['key' => 'header_slider_show', 'label' => '启用顶部多功能组件的页面', 'type' => 'checkbox', 'default' => [], 'options' => [
['label' => '首页', 'value' => 'home'],
['label' => '分类页', 'value' => 'category'],
['label' => '标签页', 'value' => 'tag'],
['label' => '用户页', 'value' => 'author'],
['label' => '文章页', 'value' => 'single'],
['label' => '搜索页', 'value' => 'search'],
['label' => '其它页面', 'value' => 'page'],
['label' => '专题页', 'value' => 'topics'],
['label' => '论坛首页', 'value' => 'forum_home'],
['label' => '论坛版块', 'value' => 'forum_plate'],
['label' => '论坛帖子', 'value' => 'forum_post'],
]],
['key' => 'header_slider_show_type', 'label' => '显示规则', 'type' => 'radio', 'default' => '', 'dependsOn' => ['key' => 'header_slider_show', 'not' => []], 'options' => [
['label' => '全部', 'value' => ''],
['label' => '仅电脑', 'value' => 'only_pc'],
['label' => '仅移动', 'value' => 'only_sm'],
]],
['key' => 'header_slider_nav_color', 'label' => '导航栏文字颜色', 'type' => 'color', 'default' => '#ffffff', 'dependsOn' => ['key' => 'header_slider_show', 'not' => []]],
]],
['key' => 'slides', 'title' => '幻灯片', 'fields' => [
['key' => 'header_slider', 'label' => '幻灯片项目', 'type' => 'repeater', 'sanitize_type' => 'array', 'default' => self::header_slider_defaults(), 'addText' => '添加幻灯片', 'fields' => [
['key' => 'background', 'label' => '背景图片', 'type' => 'media', 'default' => ''],
['key' => 'background_video', 'label' => '视频背景', 'type' => 'media', 'default' => '', 'help' => 'PC 端视频优先;移动端仅显示背景图片。'],
['key' => 'video', 'label' => '视频内容', 'type' => 'input', 'default' => ''],
['key' => 'hide', 'label' => '隐藏设备', 'type' => 'radio', 'default' => '', 'options' => [
['label' => '不隐藏', 'value' => ''],
['label' => 'PC 端不显示', 'value' => 'pc'],
['label' => '移动端不显示', 'value' => 'm'],
]],
['key' => 'link', 'label' => '跳转链接', 'type' => 'json', 'sanitize_type' => 'array', 'default' => ['url' => '', 'target' => '', 'text' => '']],
['key' => 'image_layer', 'label' => '叠加图层', 'type' => 'json', 'sanitize_type' => 'array', 'default' => [], 'help' => '每层支持 image、free_size、align、parallax、parallax_scale、parallax_opacity。'],
['key' => 'text', 'label' => '叠加文案', 'type' => 'json', 'sanitize_type' => 'array', 'default' => ['title' => '', 'desc' => '', 'text_align' => 'left-bottom', 'text_size_pc' => 30, 'text_size_m' => 20, 'parallax' => 40]],
]],
['key' => 'header_slider_option', 'label' => '幻灯片参数', 'type' => 'json', 'sanitize_type' => 'array', 'default' => self::header_slider_option_defaults()],
]],
['key' => 'search', 'title' => '搜索组件', 'fields' => [
['key' => 'header_slider_search_s', 'label' => '显示搜索组件', 'type' => 'checkbox', 'default' => ['pc_s', 'm_s'], 'options' => self::device_options()],
['key' => 'header_slider_search_option', 'label' => '搜索组件参数', 'type' => 'json', 'sanitize_type' => 'array', 'default' => self::header_slider_search_defaults()],
]],
['key' => 'cards', 'title' => '图标卡片组件', 'fields' => [
['key' => 'header_slider_card_s', 'label' => '显示图标卡片', 'type' => 'checkbox', 'default' => ['pc_s', 'm_s'], 'options' => self::device_options()],
['key' => 'header_slider_card_option', 'label' => '图标卡片参数', 'type' => 'json', 'sanitize_type' => 'array', 'default' => self::header_slider_card_defaults()],
['key' => 'header_slider_filter_blur', 'label' => '组件高斯模糊特效', 'type' => 'checkbox', 'default' => ['pc_s', 'm_s'], 'options' => self::device_options()],
]],
],
],
'category' => [
@@ -341,43 +303,6 @@ class SchemaPageDisplay {
]],
],
],
'menu-decoration' => [
'key' => 'menu-decoration',
'title' => '菜单装饰',
'version' => '1.0.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'icon', 'title' => '菜单图标', 'fields' => [
['key' => 'menu_icon_enabled', 'label' => '显示菜单图标', 'type' => 'switch', 'default' => true],
['key' => 'menu_badge_enabled', 'label' => '显示菜单徽章', 'type' => 'switch', 'default' => true],
]],
['key' => 'submenu', 'title' => '下拉子菜单', 'fields' => [
['key' => 'menu_submenu_style', 'label' => '子菜单样式', 'type' => 'radio', 'default' => 'dropdown', 'options' => [
['label' => '普通下拉', 'value' => 'dropdown'],
['label' => '多列下拉', 'value' => 'mega'],
['label' => '图文卡片', 'value' => 'cards'],
]],
['key' => 'menu_submenu_columns', 'label' => '多列列数', 'type' => 'number', 'default' => 1, 'min' => 1, 'max' => 5],
['key' => 'menu_submenu_width', 'label' => '子菜单宽度 (px)', 'type' => 'number', 'default' => 220, 'min' => 160, 'max' => 800],
]],
['key' => 'effect', 'title' => '交互效果', 'fields' => [
['key' => 'menu_hover_effect', 'label' => 'Hover 效果', 'type' => 'radio', 'default' => 'underline', 'options' => [
['label' => '下划线', 'value' => 'underline'],
['label' => '背景色', 'value' => 'background'],
['label' => '文字变色', 'value' => 'color'],
['label' => '无效果', 'value' => 'none'],
]],
['key' => 'menu_item_padding', 'label' => '菜单项内边距 (px)', 'type' => 'number', 'default' => 12, 'min' => 4, 'max' => 32],
]],
['key' => 'mobile', 'title' => '移动端菜单', 'fields' => [
['key' => 'menu_mobile_style', 'label' => '移动端菜单样式', 'type' => 'radio', 'default' => 'drawer', 'options' => [
['label' => '抽屉', 'value' => 'drawer'],
['label' => '全屏', 'value' => 'fullscreen'],
['label' => '下拉', 'value' => 'dropdown'],
]],
]],
],
],
'footer' => [
'key' => 'footer',
'title' => '底部页脚',
@@ -465,8 +390,82 @@ class SchemaPageDisplay {
];
}
/** @return list<array{label:string,value:string,image:string}> */
private static function header_layout_options(): array {
/** @return list<array{label:string,value:string}> */
private static function device_options(): array {
return [
['label' => '电脑端', 'value' => 'pc_s'],
['label' => '移动端', 'value' => 'm_s'],
];
}
/** @return list<array<string,mixed>> */
private static function header_slider_defaults(): array {
$base = defined('AKSRT_URI') ? trailingslashit(AKSRT_URI) . 'assets/vendor/zibll/img/' : '';
$slides = [];
foreach (['slider-bg.jpg', 'user_t.jpg'] as $image) {
$slides[] = [
'background' => $base . $image,
'link' => ['url' => 'https://www.zibll.com/', 'target' => '_blank'],
'text' => ['desc' => '', 'title' => ''],
'text_align' => 'left-bottom',
'text_parallax' => 30,
'text_size_m' => 20,
'text_size_pc' => 30,
];
}
return $slides;
}
/** @return array<string,mixed> */
private static function header_slider_option_defaults(): array {
return [
'direction' => 'horizontal',
'loop' => true,
'button' => true,
'pagination' => true,
'effect' => 'slide',
'scale_height' => false,
'auto_height' => false,
'pc_height' => 550,
'm_height' => 280,
'spacebetween' => 0,
'speed' => 0,
'autoplay' => true,
'interval' => 6,
];
}
/** @return array<string,mixed> */
private static function header_slider_search_defaults(): array {
return [
'show_keywords' => true,
'popular_limit' => 6,
'show_input_cat' => false,
'in_cat' => '',
'more_cats' => [],
'show_type' => false,
'in_type' => 'post',
'before_html' => '<div class="em16 font-bold mb10">更优雅的WordPress主题</div><div>这是导航栏幻灯片多功能组件,可在后台进行配置</div>',
'after_html' => '',
];
}
/** @return array<string,mixed> */
private static function header_slider_card_defaults(): array {
return [
'show_widget_bg' => false,
'icon_radius4' => false,
'cards' => [
['icon' => 'zibsvg-vip_1', 'customize_icon' => '', 'icon_class' => 'c-yellow', 'link' => [], 'title' => '图标卡片', 'desc' => '这是一个图标卡片示例'],
['icon' => 'zibsvg-vip_2', 'customize_icon' => '', 'icon_class' => 'c-blue-2', 'link' => [], 'title' => '原创作品', 'desc' => '这是一个图标卡片示例'],
['icon' => 'zibsvg-hot', 'customize_icon' => '', 'icon_class' => 'jb-pink', 'link' => [], 'title' => '灵感来源<badge class="ml6 jb-yellow">NEW</badge>', 'desc' => '这是一个图标卡片示例'],
['icon' => 'fa fas fa-ioxhost', 'customize_icon' => '', 'icon_class' => 'jb-cyan', 'link' => [], 'title' => '系统工具 <badge class="ml6 jb-blue">GO <span class="fa fas fa-angle-right em12"></span></badge>', 'desc' => '这是一个图标卡片示例'],
],
];
}
/** @return list<array{label:string,value:string,image:string}> */
private static function header_layout_options(): array {
$base = defined('AKSRT_URI') ? trailingslashit(AKSRT_URI) . 'assets/images/header-layout/' : '';
return [
['label' => '布局 1(经典)', 'value' => '1', 'image' => $base . 'header_layout_1.png'],