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>
96 lines
4.1 KiB
PHP
96 lines
4.1 KiB
PHP
<?php
|
|
/**
|
|
* User center assets panel orchestrator (wallet + points).
|
|
*
|
|
* legacy user-tab-balance parity: dual cards + tabbed ledgers.
|
|
*
|
|
* @package Jio
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
|
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
|
|
|
$dir = __DIR__;
|
|
$show_wallet = !empty($balance_enabled);
|
|
$show_credits = !empty($credits_enabled);
|
|
// 记录/任务页签文案跟随自定义货币名称(后台「积分配置 → 自定义货币名称」)。
|
|
$currency_name = (string) ($currency_name ?? __('积分', 'jio'));
|
|
$points_record_label = sprintf(__('%s记录', 'jio'), $currency_name);
|
|
$points_tasks_label = sprintf(__('%s任务', 'jio'), $currency_name);
|
|
|
|
// Dual cards row (legacy row gutters-10).
|
|
if ($show_wallet || $show_credits) :
|
|
?>
|
|
<div class="uc-assets-row<?php echo ($show_wallet && $show_credits) ? ' uc-assets-row--dual' : ''; ?>">
|
|
<?php if ($show_wallet) : ?>
|
|
<div class="uc-assets-col">
|
|
<?php require $dir . '/credits-wallet.php'; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if ($show_credits) : ?>
|
|
<div class="uc-assets-col">
|
|
<?php require $dir . '/credits-balance.php'; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php
|
|
endif;
|
|
|
|
if ($show_wallet || $show_credits) {
|
|
require $dir . '/transfer-modal.php';
|
|
}
|
|
|
|
// Tabbed ledgers (legacy record tabs).
|
|
if ($show_wallet || $show_credits) :
|
|
$show_tasks = $show_credits && class_exists('\Jio\Credits\PointsFree') && \Jio\Credits\PointsFree::enabled();
|
|
$asset_request = is_array($asset_request ?? null) ? $asset_request : [];
|
|
$requested_asset = in_array(($asset_request['asset'] ?? ''), ['balance', 'points'], true) ? $asset_request['asset'] : '';
|
|
$active_record = $requested_asset !== ''
|
|
? $requested_asset
|
|
: ($show_wallet ? 'balance' : 'points');
|
|
?>
|
|
<div class="uc-asset-tabs">
|
|
<ul class="uc-asset-tabs__nav list-inline tab-nav-theme font-bold">
|
|
<?php if ($show_wallet) : ?>
|
|
<li class="<?php echo $active_record === 'balance' ? 'active' : ''; ?>">
|
|
<a href="#record_tab_balance" data-jio-asset-tab="balance"><?php esc_html_e('余额记录', 'jio'); ?></a>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php if ($show_credits) : ?>
|
|
<li class="<?php echo $active_record === 'points' ? 'active' : ''; ?>">
|
|
<a href="#record_tab_points" data-jio-asset-tab="points"><?php echo esc_html($points_record_label); ?></a>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php if (!empty($show_tasks)) : ?>
|
|
<li class="<?php echo in_array($active_record, ['points_free', 'points_date'], true) ? 'active' : ''; ?>">
|
|
<a href="#record_tab_points_free" data-jio-asset-tab="points_free"><?php echo esc_html($points_tasks_label); ?></a>
|
|
</li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
<div class="uc-asset-tabs__content tab-content">
|
|
<?php if ($show_wallet) : ?>
|
|
<div class="tab-pane<?php echo $active_record === 'balance' ? ' is-active' : ''; ?>" id="record_tab_balance" data-jio-asset-pane="balance"<?php echo $active_record === 'balance' ? '' : ' hidden'; ?>>
|
|
<?php require $dir . '/credits-wallet-ledger.php'; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if ($show_credits) : ?>
|
|
<div class="tab-pane<?php echo $active_record === 'points' ? ' is-active' : ''; ?>" id="record_tab_points" data-jio-asset-pane="points"<?php echo $active_record === 'points' ? '' : ' hidden'; ?>>
|
|
<?php require $dir . '/credits-transactions.php'; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if (!empty($show_tasks)) : ?>
|
|
<div class="tab-pane<?php echo $active_record === 'points_free' ? ' is-active' : ''; ?>" id="record_tab_points_free" data-jio-asset-pane="points_free"<?php echo $active_record === 'points_free' ? '' : ' hidden'; ?>>
|
|
<?php $points_tasks_pane = 'tasks'; require $dir . '/credits-points-tasks.php'; ?>
|
|
</div>
|
|
<div class="tab-pane<?php echo $active_record === 'points_date' ? ' is-active' : ''; ?>" id="tab_points_date" data-jio-asset-pane="points_date"<?php echo $active_record === 'points_date' ? '' : ' hidden'; ?>>
|
|
<?php $points_tasks_pane = 'date'; require $dir . '/credits-points-tasks.php'; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
endif;
|
|
?>
|