Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.
Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)
Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
(dropped 3 stale entries, added the 17 missing ones)
Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
when it is empty
Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.
Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
101 lines
3.2 KiB
PHP
101 lines
3.2 KiB
PHP
<?php
|
|
/**
|
|
* User center sidebar: services and account settings.
|
|
*
|
|
* Icon set mirrors the reference theme user-center sidebar: every entry renders
|
|
* an inline SVG from the theme sprite through jio_icon_markup().
|
|
*
|
|
* @package Jio
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$level_url = isset($dashboard_tabs['level'])
|
|
? jio_get_user_center_tab_url('level')
|
|
: '';
|
|
$auth_url = isset($dashboard_tabs['auth']) ? jio_get_user_center_tab_url('auth') : '';
|
|
$orders_available = isset($dashboard_tabs['orders']);
|
|
$orders_url = $orders_available ? (string) ($orders_url ?? '') : '';
|
|
$tickets_available = isset($dashboard_tabs['tickets']);
|
|
$tickets_url = $tickets_available ? jio_get_user_center_tab_url('tickets') : '';
|
|
|
|
// 参考主题由 zibpay 把「我的订单」前插到按钮组最前,其后才是等级 / 认证。
|
|
$services = array_values(array_filter([
|
|
[
|
|
'label' => __('我的订单', 'jio'),
|
|
'icon' => 'order-color',
|
|
'url' => $orders_url,
|
|
'tab' => 'orders',
|
|
],
|
|
[
|
|
'label' => __('我的等级', 'jio'),
|
|
'icon' => 'trend-color',
|
|
'url' => $level_url,
|
|
'tab' => 'level',
|
|
],
|
|
[
|
|
'label' => __('官方认证', 'jio'),
|
|
'icon' => 'user-auth',
|
|
'url' => $auth_url,
|
|
'tab' => 'auth',
|
|
],
|
|
[
|
|
'label' => __('工单中心', 'jio'),
|
|
'icon' => 'comment-color',
|
|
'url' => $tickets_url,
|
|
'tab' => 'tickets',
|
|
],
|
|
], static fn(array $item): bool => (string) $item['url'] !== ''));
|
|
|
|
$settings = array_values(array_filter([
|
|
[
|
|
'label' => __('消息通知', 'jio'),
|
|
'icon' => 'msg-color',
|
|
'url' => isset($dashboard_tabs['msg']) ? jio_get_user_center_tab_url('msg') : '',
|
|
'tab' => 'msg',
|
|
],
|
|
[
|
|
'label' => __('个人资料', 'jio'),
|
|
'icon' => 'user-color',
|
|
'url' => isset($dashboard_tabs['profile']) ? jio_get_user_center_tab_url('profile') : '',
|
|
'tab' => 'profile',
|
|
],
|
|
[
|
|
'label' => __('账户安全', 'jio'),
|
|
'icon' => 'security-color',
|
|
'url' => isset($dashboard_tabs['settings']) ? jio_get_user_center_tab_url('settings') : '',
|
|
'tab' => 'settings',
|
|
],
|
|
], static fn(array $item): bool => (string) $item['url'] !== ''));
|
|
|
|
$render_grid = static function (array $items): void {
|
|
?>
|
|
<div class="flex ac hh text-center icon-but-box user-icon-but-box">
|
|
<?php foreach ($items as $item) :
|
|
$tab = (string) ($item['tab'] ?? '');
|
|
$item_class = 'icon-but-' . ($tab !== '' ? $tab : 'item');
|
|
$icon_html = jio_icon_markup('zibsvg-' . (string) $item['icon']);
|
|
?>
|
|
<a class="<?php echo esc_attr($item_class); ?>" href="<?php echo esc_url((string) $item['url']); ?>"<?php if ($tab !== '') : ?> data-tab="<?php echo esc_attr($tab); ?>"<?php endif; ?>>
|
|
<div class="em16"><?php echo $icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
|
<div class="px12 muted-color mt3"><?php echo esc_html((string) $item['label']); ?></div>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php
|
|
};
|
|
?>
|
|
<?php if ($services) : ?>
|
|
<div class="uc-sidebar-iconbox zib-widget padding-6 mb10-sm">
|
|
<div class="padding-6 ml3"><?php esc_html_e('我的服务', 'jio'); ?></div>
|
|
<?php $render_grid($services); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($settings) : ?>
|
|
<div class="uc-sidebar-iconbox zib-widget padding-6">
|
|
<div class="padding-6 ml3"><?php esc_html_e('功能设置', 'jio'); ?></div>
|
|
<?php $render_grid($settings); ?>
|
|
</div>
|
|
<?php endif; ?>
|