refactor: flatten src/AKSRT → src (drop theme-identifier dir)
Move all domain folders from src/AKSRT/{Domain} to src/{Domain}; remap
Composer PSR-4 "AKSRT\\": "src/"; update audit script + README + ADR
paths; remove dead tools/build-psr4-map.php (scanned deleted inc/classes).
This commit is contained in:
@@ -0,0 +1,257 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
trait HomepageReader {
|
||||
|
||||
/**
|
||||
* Allowed sort/orderby values for the homepage.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public static function homepage_allowed_sorts(): array {
|
||||
return HomeCms::homepage_allowed_sorts();
|
||||
}
|
||||
|
||||
/**
|
||||
* Full sort label map for admin UI and front-end rendering.
|
||||
*
|
||||
* @return array<string,string>
|
||||
*/
|
||||
public static function homepage_sort_labels(): array {
|
||||
return HomeCms::homepage_sort_labels();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixed homepage visual settings.
|
||||
*
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public static function get_homepage_fixed_settings(): array {
|
||||
return HomeCms::get_homepage_fixed_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Homepage always uses ordinary posts.
|
||||
*
|
||||
* @return string Always 'post'.
|
||||
*/
|
||||
public static function homepage_content_model(): string {
|
||||
return HomeCms::homepage_content_model();
|
||||
}
|
||||
|
||||
/**
|
||||
* Structured homepage tabs.
|
||||
*
|
||||
* @return array<int, array{term_id:int, title:string, orderby:string, enabled:bool}>
|
||||
*/
|
||||
public static function homepage_tabs(): array {
|
||||
return HomeCms::homepage_tabs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Homepage card view variant.
|
||||
*
|
||||
* @return string default|style2|style3
|
||||
*/
|
||||
public static function homepage_card_style(): string {
|
||||
return HomeCms::homepage_card_style();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether homepage list cards should switch to the multi-thumb layout.
|
||||
*/
|
||||
public static function homepage_multi_thumb_enabled(): bool {
|
||||
return HomeCms::homepage_multi_thumb_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimum image count required to trigger the multi-thumb layout.
|
||||
*/
|
||||
public static function homepage_multi_thumb_min_images(): int {
|
||||
return HomeCms::homepage_multi_thumb_min_images();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether homepage sidebar widgets should use the compact mini list style.
|
||||
*/
|
||||
public static function homepage_sidebar_mini_enabled(): bool {
|
||||
return HomeCms::homepage_sidebar_mini_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default homepage sort mode when no query override is present.
|
||||
*/
|
||||
public static function homepage_default_sort(): string {
|
||||
return HomeCms::homepage_default_sort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default homepage view mode.
|
||||
*/
|
||||
public static function homepage_default_view(): string {
|
||||
return HomeCms::homepage_default_view();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the homepage sortbar should refresh through AJAX.
|
||||
*/
|
||||
public static function homepage_sort_ajax_enabled(): bool {
|
||||
return HomeCms::homepage_sort_ajax_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the homepage tabs should use sticky/affix behaviour.
|
||||
*/
|
||||
public static function homepage_sticky_tabs_enabled(): bool {
|
||||
return HomeCms::homepage_sticky_tabs_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the main "latest posts" list is enabled on the homepage.
|
||||
*/
|
||||
public static function home_posts_list_enabled(): bool {
|
||||
return HomeCms::home_posts_list_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for the main homepage list section.
|
||||
*/
|
||||
public static function home_list_title(): string {
|
||||
return HomeCms::home_list_title();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the sort bar is enabled for the main stream.
|
||||
*/
|
||||
public static function home_list_sort_enabled(): bool {
|
||||
return HomeCms::home_list_sort_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configured sort option keys for the main stream sort bar.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public static function home_list_sort_options(): array {
|
||||
return HomeCms::home_list_sort_options();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the sort bar uses a dropdown instead of inline links.
|
||||
*/
|
||||
public static function home_list_sort_dropdown(): bool {
|
||||
return HomeCms::home_list_sort_dropdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Post IDs excluded from both main stream and tab queries.
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public static function home_exclude_post_ids(): array {
|
||||
return HomeCms::home_exclude_post_ids();
|
||||
}
|
||||
|
||||
/**
|
||||
* Category IDs excluded from the main stream.
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public static function home_exclude_category_ids(): array {
|
||||
return HomeCms::home_exclude_category_ids();
|
||||
}
|
||||
|
||||
/**
|
||||
* Posts per page for each category tab.
|
||||
*/
|
||||
public static function homepage_tab_posts_per_page(): int {
|
||||
return HomeCms::homepage_tab_posts_per_page();
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum number of category tabs to display.
|
||||
*/
|
||||
public static function homepage_tab_limit(): int {
|
||||
return HomeCms::homepage_tab_limit();
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 顶部多功能组件设置(图标卡片 + 搜索覆盖)
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* 是否显示顶部组件搜索覆盖框
|
||||
*/
|
||||
public static function header_components_search_enabled(): bool {
|
||||
return DisplayRuntime::header_components_search_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部组件搜索详细配置(PC/移动分别 + 子选项)
|
||||
*
|
||||
* @return array{pc:bool,mobile:bool,show_keywords:bool,popular_limit:int,show_input_cat:bool,show_type:bool,keywords:string[],categories:array,type_options:array}
|
||||
*/
|
||||
public static function get_header_components_search_config(): array {
|
||||
return DisplayRuntime::get_header_components_search_config();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否显示顶部组件图标卡片覆盖
|
||||
*/
|
||||
public static function header_components_cards_enabled(): bool {
|
||||
return DisplayRuntime::header_components_cards_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取顶部组件图标卡片配置
|
||||
* @return array
|
||||
*/
|
||||
public static function homepage_module_hero_enabled(): bool {
|
||||
return DisplayRuntime::homepage_module_hero_enabled();
|
||||
}
|
||||
|
||||
public static function homepage_module_banner_enabled(): bool {
|
||||
return DisplayRuntime::homepage_module_banner_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Global slider configuration shared by Hero and Banner.
|
||||
*
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public static function get_slider_config(): array {
|
||||
return DisplayRuntime::get_slider_config();
|
||||
}
|
||||
|
||||
public static function get_header_components_icon_cards(): array {
|
||||
return DisplayRuntime::get_header_components_icon_cards();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取顶部组件卡片列数
|
||||
*/
|
||||
public static function get_header_components_card_columns(): int {
|
||||
return DisplayRuntime::get_header_components_card_columns();
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否显示顶部组件卡片背景色
|
||||
*/
|
||||
public static function header_components_card_bg_enabled(): bool {
|
||||
return DisplayRuntime::header_components_card_bg_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页脚配色配置
|
||||
*/
|
||||
public static function get_footer_theme_config(): array {
|
||||
return HomeCms::get_footer_theme_config();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user