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,181 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
trait DomainGroups {
|
||||
|
||||
/**
|
||||
* 获取微信通知设置
|
||||
*
|
||||
* @return array{enabled:bool,app_id:string,app_secret:string,template_id:string}
|
||||
*/
|
||||
public static function get_wechat_settings(): array {
|
||||
return Integration::get_wechat_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新微信通知设置
|
||||
*
|
||||
* @param array $settings 合并后的完整微信配置
|
||||
*/
|
||||
public static function update_wechat_settings(array $settings): void {
|
||||
Integration::update_wechat_settings($settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档模式设置
|
||||
*/
|
||||
public static function get_docs_mode_settings(): array {
|
||||
return Integration::get_docs_mode_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全局背景设置
|
||||
*/
|
||||
public static function get_global_background_settings(): array {
|
||||
return DisplayRuntime::get_global_background_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页脚布局模板
|
||||
*/
|
||||
public static function get_footer_layout_template(): string {
|
||||
$footer = self::get_footer_settings();
|
||||
$template = sanitize_key((string) ($footer['layout_template'] ?? 'template_1'));
|
||||
// Legacy aliases map onto Zibll template_1 shell.
|
||||
if (in_array($template, ['default', 'compact', 'centered', 'template_1'], true)) {
|
||||
return 'template_1';
|
||||
}
|
||||
return 'template_1';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邮件事件配置
|
||||
*
|
||||
* @param string $event 事件类型,留空返回全部
|
||||
* @return array 单个事件配置或全部事件数组
|
||||
*/
|
||||
public static function get_email_event_config(string $event = ''): array {
|
||||
return Mail::get_email_event_config($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮件事件是否启用
|
||||
*/
|
||||
public static function is_email_event_enabled(string $event): bool {
|
||||
return Mail::is_email_event_enabled($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过邮件事件体系发送邮件
|
||||
*/
|
||||
public static function send_event_email(
|
||||
string $event,
|
||||
string $to,
|
||||
string $default_subject,
|
||||
string $default_content,
|
||||
array $placeholders = []
|
||||
): bool {
|
||||
return Mail::send_event_email($event, $to, $default_subject, $default_content, $placeholders);
|
||||
}
|
||||
|
||||
/** 禁封设置 */
|
||||
public static function ban_settings(): array {
|
||||
return UserRuntime::ban_settings();
|
||||
}
|
||||
|
||||
/** 举报设置 */
|
||||
public static function report_settings(): array {
|
||||
return UserRuntime::report_settings();
|
||||
}
|
||||
|
||||
/** 站内通知总开关 */
|
||||
public static function message_enabled(): bool {
|
||||
return Integration::message_enabled();
|
||||
}
|
||||
|
||||
/** 通知基础设置(basic group) */
|
||||
public static function notification_settings(): array {
|
||||
return Integration::notification_settings();
|
||||
}
|
||||
|
||||
/** 已关闭的通知推送类型列表 */
|
||||
public static function notification_closed_types(): array {
|
||||
return Integration::notification_closed_types();
|
||||
}
|
||||
|
||||
/** 自动清理已读消息配置 */
|
||||
public static function auto_clear_settings(): array {
|
||||
return Integration::auto_clear_settings();
|
||||
}
|
||||
|
||||
/** 私信功能配置 */
|
||||
public static function private_message_settings(): array {
|
||||
return Integration::private_message_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单项扩展 meta 字段列表
|
||||
*/
|
||||
public static function get_menu_item_meta_fields(): array {
|
||||
return [
|
||||
'icon_class',
|
||||
'icon_svg',
|
||||
'badge_text',
|
||||
'badge_color',
|
||||
'menu_card_image',
|
||||
'menu_card_desc',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Capability definitions registry.
|
||||
*
|
||||
* @return array<string, array{label:string, roles?:string[], exclude_roles?:string[], default?:array<string,mixed>}>
|
||||
*/
|
||||
public static function cap_definitions(): array {
|
||||
return Capabilities::cap_definitions();
|
||||
}
|
||||
|
||||
/**
|
||||
* All role columns in the capability matrix.
|
||||
*/
|
||||
public static function cap_role_columns(): array {
|
||||
return Capabilities::cap_role_columns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the user_caps matrix from settings.
|
||||
*
|
||||
* @return array<string, array<string, mixed>>
|
||||
*/
|
||||
public static function get_user_capabilities(): array {
|
||||
return Capabilities::get_user_capabilities();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve whether a user has a specific capability.
|
||||
*/
|
||||
public static function user_can(string $cap, int $user_id = 0, ?int $context = null): bool {
|
||||
return Capabilities::user_can($cap, $user_id, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取"网站安全"设置
|
||||
*/
|
||||
public static function get_security_settings(): array {
|
||||
return Capabilities::get_security_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取"系统工具"设置
|
||||
*/
|
||||
public static function get_system_tools_settings(): array {
|
||||
return Capabilities::get_system_tools_settings();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user