用户中心 PHP 整包减层:修复 profile 面板映射并模块化上下文组装

This commit is contained in:
kate522 committed 2026-07-10 22:34:00 +08:00
1 parent e97654aab3
commit f43519b1df
9 files changed
+215 -190

No files matched your search

+1 -1
View File
@@ -63,7 +63,7 @@ get_header();
<?php endif; ?>
<?php get_template_part('templates/parts/user-center/mobile-tabs', null, ['context' => $render_context]); ?>
<?php foreach ($render_context['panels'] as $panel) : ?>
<?php get_template_part('templates/parts/user-center/panel', $panel['key'], ['panel' => $panel]); ?>
<?php get_template_part('templates/parts/user-center/panel', null, ['panel' => $panel]); ?>
<?php endforeach; ?>
<?php get_template_part('templates/parts/user-center/account-modals', null, ['context' => $render_context]); ?>
</div>
+7 -7
View File
@@ -2,19 +2,19 @@
当前主路径:
- 壳层:templates/pages/page-profile.php
- 挂载点:header / sidebar / mobile-tabs / panel-* / account-modals / runtime-config
- 上下文:inc/helpers/aksrt-user-center.php
- aksrt_get_user_center_render_context()
- aksrt_user_center_resolve_tabs()
- aksrt_capture_user_center_view() (profile → form 映射)
- 挂载点:header / sidebar / mobile-tabs / panel / account-modals / runtime-config
- 渲染器:inc/helpers/user-center-renderers/profile-*.php
- profile 面板内容文件为 profile-form.php
样式归属:
- assets/css/routes/user-center.css
- shell.css — 容器/侧栏/内容区/抽屉
- credits.css — 余额卡/流水
- settings.css — 设置区/邀请面板
- responsive.css — 移动端 tabs/断点/a11y
- shell.css / credits.css / settings.css / responsive.css
- assets/css/routes/profile.css — 共享头区/列表/弹窗
脚本归属:
- assets/js/routes/user-center.js
旧 uc-* 草稿 partial 与 templates/parts/profile/part-* 拆分残片已删除,勿再引入。
-->
@@ -1,8 +0,0 @@
<?php
/** User center comments panel. @package AKSRT */
defined('ABSPATH') || exit;
$panel = is_array($args['panel'] ?? null) ? $args['panel'] : [];
?>
<div id="panel-<?php echo esc_attr($panel['key'] ?? 'comments'); ?>" class="dashboard-panel<?php echo !empty($panel['is_active']) ? ' is-active' : ''; ?>" role="tabpanel"<?php echo empty($panel['is_active']) ? ' hidden' : ''; ?> data-panel-loaded="<?php echo !empty($panel['is_loaded']) ? 'true' : 'false'; ?>" data-tab-url="<?php echo esc_url($panel['url'] ?? ''); ?>">
<?php echo $panel['html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
@@ -1,8 +0,0 @@
<?php
/** User center credits panel. @package AKSRT */
defined('ABSPATH') || exit;
$panel = is_array($args['panel'] ?? null) ? $args['panel'] : [];
?>
<div id="panel-<?php echo esc_attr($panel['key'] ?? 'credits'); ?>" class="dashboard-panel<?php echo !empty($panel['is_active']) ? ' is-active' : ''; ?>" role="tabpanel"<?php echo empty($panel['is_active']) ? ' hidden' : ''; ?> data-panel-loaded="<?php echo !empty($panel['is_loaded']) ? 'true' : 'false'; ?>" data-tab-url="<?php echo esc_url($panel['url'] ?? ''); ?>">
<?php echo $panel['html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
@@ -1,8 +0,0 @@
<?php
/** User center favorites panel. @package AKSRT */
defined('ABSPATH') || exit;
$panel = is_array($args['panel'] ?? null) ? $args['panel'] : [];
?>
<div id="panel-<?php echo esc_attr($panel['key'] ?? 'favorites'); ?>" class="dashboard-panel<?php echo !empty($panel['is_active']) ? ' is-active' : ''; ?>" role="tabpanel"<?php echo empty($panel['is_active']) ? ' hidden' : ''; ?> data-panel-loaded="<?php echo !empty($panel['is_loaded']) ? 'true' : 'false'; ?>" data-tab-url="<?php echo esc_url($panel['url'] ?? ''); ?>">
<?php echo $panel['html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
@@ -1,8 +0,0 @@
<?php
/** User center posts panel. @package AKSRT */
defined('ABSPATH') || exit;
$panel = is_array($args['panel'] ?? null) ? $args['panel'] : [];
?>
<div id="panel-<?php echo esc_attr($panel['key'] ?? 'posts'); ?>" class="dashboard-panel<?php echo !empty($panel['is_active']) ? ' is-active' : ''; ?>" role="tabpanel"<?php echo empty($panel['is_active']) ? ' hidden' : ''; ?> data-panel-loaded="<?php echo !empty($panel['is_loaded']) ? 'true' : 'false'; ?>" data-tab-url="<?php echo esc_url($panel['url'] ?? ''); ?>">
<?php echo $panel['html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
@@ -1,8 +0,0 @@
<?php
/** User center profile panel. @package AKSRT */
defined('ABSPATH') || exit;
$panel = is_array($args['panel'] ?? null) ? $args['panel'] : [];
?>
<div id="panel-<?php echo esc_attr($panel['key'] ?? 'profile'); ?>" class="dashboard-panel<?php echo !empty($panel['is_active']) ? ' is-active' : ''; ?>" role="tabpanel"<?php echo empty($panel['is_active']) ? ' hidden' : ''; ?> data-panel-loaded="<?php echo !empty($panel['is_loaded']) ? 'true' : 'false'; ?>" data-tab-url="<?php echo esc_url($panel['url'] ?? ''); ?>">
<?php echo $panel['html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
@@ -1,8 +0,0 @@
<?php
/** User center settings panel. @package AKSRT */
defined('ABSPATH') || exit;
$panel = is_array($args['panel'] ?? null) ? $args['panel'] : [];
?>
<div id="panel-<?php echo esc_attr($panel['key'] ?? 'settings'); ?>" class="dashboard-panel<?php echo !empty($panel['is_active']) ? ' is-active' : ''; ?>" role="tabpanel"<?php echo empty($panel['is_active']) ? ' hidden' : ''; ?> data-panel-loaded="<?php echo !empty($panel['is_loaded']) ? 'true' : 'false'; ?>" data-tab-url="<?php echo esc_url($panel['url'] ?? ''); ?>">
<?php echo $panel['html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>