feat(navigation): hard-switch to Zibll navigation and Font Awesome 5
This commit is contained in:
1 parent
3c3ddac8be
commit
a0b84977a2
630 files changed
+101647
-11293
No files matched your search
@@ -49,45 +49,109 @@ trait DisplayPageGroups {
|
||||
/**
|
||||
* 获取顶部多功能组件设置
|
||||
*/
|
||||
public static function get_header_components_settings(): array {
|
||||
$s = self::get_all();
|
||||
$allowed_page_types = [
|
||||
'home',
|
||||
'category',
|
||||
'tag',
|
||||
'author',
|
||||
'single',
|
||||
'search',
|
||||
'page',
|
||||
];
|
||||
$show_on = isset($s['header_components_show_on']) ? (array) $s['header_components_show_on'] : ['home'];
|
||||
$show_on = array_values(array_intersect(
|
||||
array_map('sanitize_key', $show_on),
|
||||
$allowed_page_types
|
||||
));
|
||||
$show_type = $s['header_components_device_visibility'] ?? '';
|
||||
if (!in_array($show_type, ['', 'only_pc', 'only_sm'], true)) {
|
||||
$show_type = '';
|
||||
}
|
||||
return [
|
||||
'search_enabled' => self::header_components_search_enabled(),
|
||||
'search_config' => self::get_header_components_search_config(),
|
||||
'cards_enabled' => self::header_components_cards_enabled(),
|
||||
'show_on_pages' => $show_on,
|
||||
'show_type' => $show_type,
|
||||
'filter_blur' => isset($s['header_components_filter_blur_devices']) ? array_values(array_intersect(array_map('sanitize_key', (array) $s['header_components_filter_blur_devices']), ['pc', 'mobile'])) : [],
|
||||
'card_show' => isset($s['header_components_card_show_devices']) ? array_values(array_intersect(array_map('sanitize_key', (array) $s['header_components_card_show_devices']), ['pc', 'mobile'])) : ['pc', 'mobile'],
|
||||
'slider_config' => self::get_slider_config(),
|
||||
'icon_cards' => self::get_header_components_icon_cards(),
|
||||
'card_columns' => self::get_header_components_card_columns(),
|
||||
'card_bg_enabled' => self::header_components_card_bg_enabled(),
|
||||
];
|
||||
}
|
||||
public static function get_header_slider_settings(): array {
|
||||
$s = self::get_all();
|
||||
$allowed_page_types = [
|
||||
'home',
|
||||
'category',
|
||||
'tag',
|
||||
'author',
|
||||
'single',
|
||||
'search',
|
||||
'page',
|
||||
'topics',
|
||||
'forum_home',
|
||||
'forum_plate',
|
||||
'forum_post',
|
||||
];
|
||||
$show_on = isset($s['header_slider_show']) ? (array) $s['header_slider_show'] : [];
|
||||
$show_on = array_values(array_intersect(
|
||||
array_map('sanitize_key', $show_on),
|
||||
$allowed_page_types
|
||||
));
|
||||
$show_type = $s['header_slider_show_type'] ?? '';
|
||||
if (!in_array($show_type, ['', 'only_pc', 'only_sm'], true)) {
|
||||
$show_type = '';
|
||||
}
|
||||
$slider_option = is_array($s['header_slider_option'] ?? null) ? $s['header_slider_option'] : self::header_slider_option_defaults();
|
||||
$search_option = is_array($s['header_slider_search_option'] ?? null) ? $s['header_slider_search_option'] : self::header_slider_search_defaults();
|
||||
$card_option = is_array($s['header_slider_card_option'] ?? null) ? $s['header_slider_card_option'] : self::header_slider_card_defaults();
|
||||
return [
|
||||
'slides' => is_array($s['header_slider'] ?? null) ? $s['header_slider'] : self::header_slider_default_slides(),
|
||||
'show_on_pages' => $show_on,
|
||||
'show_type' => $show_type,
|
||||
'nav_color' => sanitize_hex_color((string) ($s['header_slider_nav_color'] ?? '')) ?: '',
|
||||
'slider_config' => $slider_option,
|
||||
'search_show' => self::sanitize_device_visibility($s['header_slider_search_s'] ?? ['pc_s', 'm_s']),
|
||||
'search_config' => $search_option,
|
||||
'card_show' => self::sanitize_device_visibility($s['header_slider_card_s'] ?? ['pc_s', 'm_s']),
|
||||
'card_config' => $card_option,
|
||||
'filter_blur' => self::sanitize_device_visibility($s['header_slider_filter_blur'] ?? ['pc_s', 'm_s']),
|
||||
];
|
||||
}
|
||||
|
||||
/** @return list<array<string,mixed>> */
|
||||
private static function header_slider_default_slides(): 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<string> */
|
||||
private static function sanitize_device_visibility($value): array {
|
||||
return array_values(array_intersect(array_map('sanitize_key', (array) $value), ['pc_s', 'm_s']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取"全局&功能"域的合并设置
|
||||
*/
|
||||
public static function get_global_settings(): array {
|
||||
$s = self::get_all();
|
||||
return [
|
||||
'site_logo' => self::logo_url(),
|
||||
'site_logo_dark' => self::logo_dark_url(),
|
||||
@@ -105,12 +169,14 @@ trait DisplayPageGroups {
|
||||
'qj_dh_xs' => self::get_qj_loading_style(),
|
||||
'container_max_width' => self::container_max_width(),
|
||||
'font_family' => self::font_family(),
|
||||
'search_type' => self::search_mode(),
|
||||
'search_placeholder' => self::search_placeholder(),
|
||||
'search_history_enabled' => self::search_history_enabled(),
|
||||
'hot_search_enabled' => self::hot_search_enabled(),
|
||||
'hot_search_keywords' => self::hot_search_keywords(),
|
||||
'search_suggestions_enabled' => self::search_suggestions_enabled(),
|
||||
'search_type' => !isset($s['search_type']) || !empty($s['search_type']),
|
||||
'search_type_in' => sanitize_key((string) ($s['search_type_in'] ?? 'post')),
|
||||
'search_placeholder' => self::search_placeholder(),
|
||||
'search_history' => self::search_history_enabled(),
|
||||
'search_popular_key' => self::hot_search_enabled(),
|
||||
'search_popular_title' => self::search_popular_title(),
|
||||
'search_popular_sticky' => self::search_popular_sticky(),
|
||||
'search_popular_key_num' => max(10, min(50, (int) ($s['search_popular_key_num'] ?? 20))),
|
||||
'search_posts' => self::search_posts_enabled(),
|
||||
'search_no_page' => self::search_no_page(),
|
||||
'search_exclude_cats' => self::search_exclude_cats(),
|
||||
@@ -132,8 +198,6 @@ trait DisplayPageGroups {
|
||||
'footer' => self::get_footer_settings(),
|
||||
'tabbar' => self::get_footer_tabbar_settings(),
|
||||
'floating_buttons' => self::get_floating_buttons_settings(),
|
||||
'header_nav' => self::get_header_nav_settings(),
|
||||
'header_newposts' => self::get_header_newposts_config(),
|
||||
'header_theme' => self::get_header_theme_config(),
|
||||
'friend_links' => self::get_friend_links(),
|
||||
'cms_features' => self::get_cms_features(),
|
||||
@@ -147,7 +211,7 @@ trait DisplayPageGroups {
|
||||
*/
|
||||
public static function get_page_display_settings(): array {
|
||||
return [
|
||||
'header_components' => self::get_header_components_settings(),
|
||||
'header_slider' => self::get_header_slider_settings(),
|
||||
'homepage' => self::get_homepage_fixed_settings(),
|
||||
'category_recommend' => self::get_category_recommend_settings(),
|
||||
'category' => self::get_category_page_settings(),
|
||||
@@ -155,9 +219,6 @@ trait DisplayPageGroups {
|
||||
'user_home' => self::get_user_home_settings(),
|
||||
'other' => self::get_other_page_settings(),
|
||||
'background' => self::get_global_background_settings(),
|
||||
'menu_decoration' => function_exists('aksrt_get_menu_decoration_settings')
|
||||
? aksrt_get_menu_decoration_settings()
|
||||
: [],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user