refactor(autoload): migrate theme classes to Composer PSR-4
Move 288 types from global AKSRT_* + inc/classes manual requires into
namespace AKSRT\{Domain} under src/AKSRT/, wire composer.json psr-4,
and slim bootstrap to helpers/modules/hooks only. Split multi-class
widget/gateway files, update admin contract audit paths, and document
the layout in ADR/README.
This commit is contained in:
1 parent
8f349b40fb
commit
aaf458af1c
404 files changed
+13602
-7705
No files matched your search
@@ -14,18 +14,18 @@ if (!$credits_enabled) {
|
||||
}
|
||||
|
||||
$card_pass_credits = ['enabled' => false, 'desc' => '', 'only_password' => true];
|
||||
if (class_exists('AKSRT_Charge_Card')) {
|
||||
$opts = AKSRT_Charge_Card::get_instance()->get_public_options();
|
||||
if (class_exists('\AKSRT\Payment\ChargeCard')) {
|
||||
$opts = \AKSRT\Payment\ChargeCard::get_instance()->get_public_options();
|
||||
$card_pass_credits = is_array($opts['credits'] ?? null) ? $opts['credits'] : $card_pass_credits;
|
||||
}
|
||||
$all_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_all() : [];
|
||||
$all_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
|
||||
$points_uid = (int) ($user_id ?? get_current_user_id());
|
||||
$points_transfer_on = !empty($all_settings['points_transfer_s']);
|
||||
if ($points_transfer_on && class_exists('AKSRT_Settings_Capabilities') && !AKSRT_Settings_Capabilities::user_can('points_transfer', $points_uid)) {
|
||||
if ($points_transfer_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('points_transfer', $points_uid)) {
|
||||
$points_transfer_on = false;
|
||||
}
|
||||
$points_buy_on = class_exists('AKSRT_Balance_Service') && AKSRT_Balance_Service::get_instance()->points_buy_enabled();
|
||||
$points_buy_view = $points_buy_on ? AKSRT_Balance_Service::get_instance()->get_points_buy_view((int) ($user_id ?? 0)) : [];
|
||||
$points_buy_on = class_exists('\AKSRT\Credits\BalanceService') && \AKSRT\Credits\BalanceService::get_instance()->points_buy_enabled();
|
||||
$points_buy_view = $points_buy_on ? \AKSRT\Credits\BalanceService::get_instance()->get_points_buy_view((int) ($user_id ?? 0)) : [];
|
||||
$currency = (string) ($currency_name ?? __('积分', 'aksrt'));
|
||||
?>
|
||||
<div class="uc-asset-card uc-asset-card--points zib-widget">
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!class_exists('AKSRT_User_Level')) {
|
||||
if (!class_exists('\AKSRT\User\Level')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$cfg = AKSRT_User_Level::settings();
|
||||
$cfg = \AKSRT\User\Level::settings();
|
||||
if (empty($cfg['enabled'])) {
|
||||
return;
|
||||
}
|
||||
@@ -23,8 +23,8 @@ if ($user_id <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$level = AKSRT_User_Level::get_level($user_id);
|
||||
$integral = AKSRT_User_Level::get_integral($user_id);
|
||||
$level = \AKSRT\User\Level::get_level($user_id);
|
||||
$integral = \AKSRT\User\Level::get_integral($user_id);
|
||||
$max = max(1, (int) ($cfg['max'] ?? 10));
|
||||
$prefix = (string) ($cfg['prefix'] ?? 'Lv.');
|
||||
$opt = is_array($cfg['level_opt'] ?? null) ? $cfg['level_opt'] : [];
|
||||
@@ -36,7 +36,7 @@ if (!$is_max) {
|
||||
$next_need = (int) ($opt['upgrade_integral_' . ($level + 1)] ?? 0);
|
||||
if ($next_need <= $integral) {
|
||||
// Resolve again in case meta lag.
|
||||
$level = AKSRT_User_Level::resolve_level($integral, $cfg);
|
||||
$level = \AKSRT\User\Level::resolve_level($integral, $cfg);
|
||||
$is_max = $level >= $max;
|
||||
$next_need = $is_max ? $integral : (int) ($opt['upgrade_integral_' . ($level + 1)] ?? $integral);
|
||||
$name = (string) ($opt['name_' . $level] ?? ($prefix . $level));
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!class_exists('AKSRT_Points_Free') || !AKSRT_Points_Free::enabled()) {
|
||||
if (!class_exists('\AKSRT\Credits\PointsFree') || !\AKSRT\Credits\PointsFree::enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ $aksrt_points_task_action = static function (string $key): array {
|
||||
$forum_on = false;
|
||||
$forum_home = '';
|
||||
$forum_compose = '';
|
||||
if (class_exists('AKSRT_Settings') && method_exists('AKSRT_Settings', 'get_forum_settings')) {
|
||||
$f = AKSRT_Settings::get_forum_settings();
|
||||
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_forum_settings')) {
|
||||
$f = \AKSRT\Settings\Settings::get_forum_settings();
|
||||
$forum_on = !empty($f['enabled']);
|
||||
}
|
||||
if ($forum_on) {
|
||||
@@ -126,10 +126,10 @@ $aksrt_points_task_action = static function (string $key): array {
|
||||
};
|
||||
|
||||
$user_id = (int) ($user_id ?? get_current_user_id());
|
||||
$today = AKSRT_Points_Free::today_total($user_id);
|
||||
$day_max = (int) AKSRT_Points_Free::settings()['day_max'];
|
||||
$tasks = AKSRT_Points_Free::task_list_for_user($user_id);
|
||||
$detail = AKSRT_Points_Free::date_detail($user_id);
|
||||
$today = \AKSRT\Credits\PointsFree::today_total($user_id);
|
||||
$day_max = (int) \AKSRT\Credits\PointsFree::settings()['day_max'];
|
||||
$tasks = \AKSRT\Credits\PointsFree::task_list_for_user($user_id);
|
||||
$detail = \AKSRT\Credits\PointsFree::date_detail($user_id);
|
||||
$pane = isset($points_tasks_pane) ? sanitize_key((string) $points_tasks_pane) : 'tasks';
|
||||
?>
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ if (function_exists('aksrt_is_captcha_enabled_for') && aksrt_is_captcha_enabled_
|
||||
endif;
|
||||
|
||||
$signin_dates = [];
|
||||
if (class_exists('AKSRT_Signin')) {
|
||||
$signin_log = AKSRT_Signin::get_instance()->get_recent_signins($user_id, 30);
|
||||
if (class_exists('\AKSRT\Credits\Signin')) {
|
||||
$signin_log = \AKSRT\Credits\Signin::get_instance()->get_recent_signins($user_id, 30);
|
||||
$signin_dates = array_filter(array_map(static function ($entry) {
|
||||
return $entry['signin_date'] ?? '';
|
||||
}, $signin_log));
|
||||
|
||||
@@ -18,8 +18,8 @@ defined('ABSPATH') || exit;
|
||||
</div>
|
||||
<?php
|
||||
$credits_page = max(1, isset($_GET['credits_page']) ? (int) $_GET['credits_page'] : 1);
|
||||
if (class_exists('AKSRT_Credits')) {
|
||||
$log = AKSRT_Credits::get_log(['user_id' => $user_id, 'page' => $credits_page, 'per_page' => 10]);
|
||||
if (class_exists('\AKSRT\Credits\Credits')) {
|
||||
$log = \AKSRT\Credits\Credits::get_log(['user_id' => $user_id, 'page' => $credits_page, 'per_page' => 10]);
|
||||
} else {
|
||||
$log = ['items' => [], 'total' => 0];
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ $renew_desc = '';
|
||||
$upgrade_desc = '';
|
||||
$points_exchange = ['enabled' => false, 'packages' => [], 'desc' => ''];
|
||||
$user_points = 0;
|
||||
$currency_name = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_currency_name() : __('积分', 'aksrt');
|
||||
if (class_exists('AKSRT_Vip_Service')) {
|
||||
$catalog = AKSRT_Vip_Service::get_instance()->get_catalog($user_id);
|
||||
$currency_name = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_currency_name() : __('积分', 'aksrt');
|
||||
if (class_exists('\AKSRT\Content\VipService')) {
|
||||
$catalog = \AKSRT\Content\VipService::get_instance()->get_catalog($user_id);
|
||||
$packages = is_array($catalog['level_packages'] ?? null) ? $catalog['level_packages'] : [];
|
||||
$methods = is_array($catalog['payment_methods'] ?? null) ? $catalog['payment_methods'] : [];
|
||||
$renew_desc = (string) ($catalog['renew_desc'] ?? '');
|
||||
@@ -60,8 +60,8 @@ if (class_exists('AKSRT_Vip_Service')) {
|
||||
}
|
||||
|
||||
$cash_symbol = '¥';
|
||||
if (class_exists('AKSRT_Settings')) {
|
||||
$paid_display = AKSRT_Settings::get_paid_content_settings();
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$paid_display = \AKSRT\Settings\Settings::get_paid_content_settings();
|
||||
$cash_symbol = (string) ($paid_display['display']['currency_symbol'] ?? '¥');
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ if ($vip_level > 0) {
|
||||
$points_pkgs = is_array($points_exchange['packages'] ?? null) ? $points_exchange['packages'] : [];
|
||||
|
||||
$card_pass_vip = ['enabled' => false, 'desc' => '', 'only_password' => true];
|
||||
if (class_exists('AKSRT_Charge_Card')) {
|
||||
$card_opts = AKSRT_Charge_Card::get_instance()->get_public_options();
|
||||
if (class_exists('\AKSRT\Payment\ChargeCard')) {
|
||||
$card_opts = \AKSRT\Payment\ChargeCard::get_instance()->get_public_options();
|
||||
$card_pass_vip = is_array($card_opts['vip'] ?? null) ? $card_opts['vip'] : $card_pass_vip;
|
||||
} elseif (!empty($vip_settings['benefit']['pass_charge'])) {
|
||||
$card_pass_vip = [
|
||||
|
||||
@@ -14,44 +14,44 @@ if (empty($balance_enabled)) {
|
||||
}
|
||||
|
||||
$wallet = (float) ($wallet_balance ?? 0.0);
|
||||
$wallet_fmt = class_exists('AKSRT_Balance')
|
||||
? AKSRT_Balance::format($wallet)
|
||||
$wallet_fmt = class_exists('\AKSRT\Credits\Balance')
|
||||
? \AKSRT\Credits\Balance::format($wallet)
|
||||
: number_format_i18n($wallet, 2);
|
||||
|
||||
$recharge = class_exists('AKSRT_Settings') && method_exists('AKSRT_Settings', 'get_payment_recharge_settings')
|
||||
? AKSRT_Settings::get_payment_recharge_settings()
|
||||
$recharge = class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_payment_recharge_settings')
|
||||
? \AKSRT\Settings\Settings::get_payment_recharge_settings()
|
||||
: [];
|
||||
$uid = (int) ($user_id ?? get_current_user_id());
|
||||
$transfer_on = !empty($recharge['transfer']['enabled']);
|
||||
if ($transfer_on && class_exists('AKSRT_Settings_Capabilities') && !AKSRT_Settings_Capabilities::user_can('balance_transfer', $uid)) {
|
||||
if ($transfer_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_transfer', $uid)) {
|
||||
$transfer_on = false;
|
||||
}
|
||||
$exchange_on = !empty($recharge['exchange']['enabled']);
|
||||
$all_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_all() : [];
|
||||
$all_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
|
||||
$withdraw_on = !empty($all_settings['pay_balance_withdraw_s']);
|
||||
if ($withdraw_on && class_exists('AKSRT_Settings_Capabilities') && !AKSRT_Settings_Capabilities::user_can('balance_withdraw', $uid)) {
|
||||
if ($withdraw_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_withdraw', $uid)) {
|
||||
$withdraw_on = false;
|
||||
}
|
||||
$withdraw_min = max(1, (float) ($all_settings['pay_balance_withdraw_lowest_money'] ?? $all_settings['pay_rebate_withdraw_lowest_money'] ?? 50));
|
||||
$withdraw_pending_hold = 0.0;
|
||||
$withdraw_history = [];
|
||||
if ($withdraw_on && class_exists('AKSRT_Withdrawal')) {
|
||||
$wd_svc = AKSRT_Withdrawal::get_instance();
|
||||
if ($withdraw_on && class_exists('\AKSRT\Payment\Withdrawal')) {
|
||||
$wd_svc = \AKSRT\Payment\Withdrawal::get_instance();
|
||||
$withdraw_pending_hold = $wd_svc->sum_pending_hold((int) ($user_id ?? 0));
|
||||
$withdraw_history = $wd_svc->get_user_withdrawals((int) ($user_id ?? 0), ['limit' => 30]);
|
||||
}
|
||||
$withdraw_processing = $withdraw_pending_hold > 0;
|
||||
$card_pass_balance = ['enabled' => false, 'desc' => '', 'only_password' => true];
|
||||
if (class_exists('AKSRT_Charge_Card')) {
|
||||
$opts = AKSRT_Charge_Card::get_instance()->get_public_options();
|
||||
if (class_exists('\AKSRT\Payment\ChargeCard')) {
|
||||
$opts = \AKSRT\Payment\ChargeCard::get_instance()->get_public_options();
|
||||
$card_pass_balance = is_array($opts['balance'] ?? null) ? $opts['balance'] : $card_pass_balance;
|
||||
} elseif (!empty($recharge['pass_charge'])) {
|
||||
$card_pass_balance = is_array($recharge['pass_charge']) ? $recharge['pass_charge'] : $card_pass_balance;
|
||||
}
|
||||
|
||||
$charge_view = [];
|
||||
if (class_exists('AKSRT_Balance_Service')) {
|
||||
$charge_view = AKSRT_Balance_Service::get_instance()->get_charge_view((int) $user_id);
|
||||
if (class_exists('\AKSRT\Credits\BalanceService')) {
|
||||
$charge_view = \AKSRT\Credits\BalanceService::get_instance()->get_charge_view((int) $user_id);
|
||||
}
|
||||
$packages = is_array($charge_view['packages'] ?? null) ? $charge_view['packages'] : [];
|
||||
$methods = is_array($charge_view['payment_methods'] ?? null) ? $charge_view['payment_methods'] : [];
|
||||
@@ -101,7 +101,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<?php endif; ?>
|
||||
<?php if ($withdraw_on) : ?>
|
||||
<div class="uc-asset-card__foot muted-2-color em09 flex jsb ac mt6">
|
||||
<span><?php printf(esc_html__('处理中冻结 %s', 'aksrt'), esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format((float) $withdraw_pending_hold) : number_format_i18n((float) $withdraw_pending_hold, 2))); ?></span>
|
||||
<span><?php printf(esc_html__('处理中冻结 %s', 'aksrt'), esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format((float) $withdraw_pending_hold) : number_format_i18n((float) $withdraw_pending_hold, 2))); ?></span>
|
||||
<button type="button" class="muted-color" data-aksrt-withdraw-history-open><?php esc_html_e('提现记录', 'aksrt'); ?></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -288,12 +288,12 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<div class="uc-withdraw-history__item border-bottom padding-h10">
|
||||
<div class="flex jsb ac">
|
||||
<span class="badg badg-sm <?php echo esc_attr($st_class); ?>"><?php echo esc_html($status_labels[$st] ?? $st); ?></span>
|
||||
<b class="em12"><?php echo esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format($gross) : number_format_i18n($gross, 2)); ?></b>
|
||||
<b class="em12"><?php echo esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($gross) : number_format_i18n($gross, 2)); ?></b>
|
||||
</div>
|
||||
<div class="muted-2-color em09 mt6">
|
||||
<?php echo esc_html((string) ($wd['created_at'] ?? '')); ?>
|
||||
<?php if (abs($gross - $net) > 0.001) : ?>
|
||||
· <?php printf(esc_html__('到账 %s', 'aksrt'), esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format($net) : number_format_i18n($net, 2))); ?>
|
||||
· <?php printf(esc_html__('到账 %s', 'aksrt'), esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($net) : number_format_i18n($net, 2))); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (!empty($wd['note'])) : ?>
|
||||
@@ -319,8 +319,8 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
</div>
|
||||
<?php
|
||||
$wallet_page = max(1, isset($_GET['wallet_page']) ? (int) $_GET['wallet_page'] : 1);
|
||||
$wlog = class_exists('AKSRT_Balance')
|
||||
? AKSRT_Balance::get_log(['user_id' => (int) $user_id, 'page' => $wallet_page, 'per_page' => 10])
|
||||
$wlog = class_exists('\AKSRT\Credits\Balance')
|
||||
? \AKSRT\Credits\Balance::get_log(['user_id' => (int) $user_id, 'page' => $wallet_page, 'per_page' => 10])
|
||||
: ['items' => [], 'total' => 0];
|
||||
if (!empty($wlog['items'])) :
|
||||
?>
|
||||
@@ -328,7 +328,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<?php foreach ($wlog['items'] as $row) :
|
||||
$delta = (float) $row['delta'];
|
||||
$delta_class = $delta >= 0 ? 'is-positive' : 'is-negative';
|
||||
$delta_txt = ($delta > 0 ? '+' : '') . (class_exists('AKSRT_Balance') ? AKSRT_Balance::format($delta) : number_format_i18n($delta, 2));
|
||||
$delta_txt = ($delta > 0 ? '+' : '') . (class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($delta) : number_format_i18n($delta, 2));
|
||||
?>
|
||||
<div class="uc-transactions__item">
|
||||
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
|
||||
@@ -336,7 +336,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
</div>
|
||||
<div class="uc-transactions__info">
|
||||
<div class="uc-transactions__reason">
|
||||
<?php echo esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::reason_label((string) $row['reason']) : (string) $row['reason']); ?>
|
||||
<?php echo esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::reason_label((string) $row['reason']) : (string) $row['reason']); ?>
|
||||
<?php if (!empty($row['remark'])) : ?>
|
||||
<span class="uc-transactions__remark">(<?php echo esc_html((string) $row['remark']); ?>)</span>
|
||||
<?php endif; ?>
|
||||
@@ -349,7 +349,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<?php
|
||||
printf(
|
||||
esc_html__('余额 %s', 'aksrt'),
|
||||
esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format((float) $row['balance_after']) : number_format_i18n((float) $row['balance_after'], 2))
|
||||
esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format((float) $row['balance_after']) : number_format_i18n((float) $row['balance_after'], 2))
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
|
||||
@@ -44,7 +44,7 @@ if (!empty($show_vip)) {
|
||||
if ($show_credits) {
|
||||
require $dir . '/credits-signin.php';
|
||||
}
|
||||
if (class_exists('AKSRT_User_Level')) {
|
||||
if (class_exists('\AKSRT\User\Level')) {
|
||||
require $dir . '/credits-level.php';
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ if ($show_wallet || $show_credits) :
|
||||
if ($active_record === '' || !in_array($active_record, ['balance', 'points', 'points_free', 'points_date'], true)) {
|
||||
$active_record = $show_wallet ? 'balance' : 'points';
|
||||
}
|
||||
$show_tasks = $show_credits && class_exists('AKSRT_Points_Free') && AKSRT_Points_Free::enabled();
|
||||
$show_tasks = $show_credits && class_exists('\AKSRT\Credits\PointsFree') && \AKSRT\Credits\PointsFree::enabled();
|
||||
?>
|
||||
<div class="uc-asset-tabs zib-widget">
|
||||
<ul class="uc-asset-tabs__nav list-inline tab-nav-theme font-bold">
|
||||
@@ -82,8 +82,8 @@ if ($show_wallet || $show_credits) :
|
||||
// Render only the ledger portion by reusing balance log markup.
|
||||
$user_id = (int) ($user_id ?? 0);
|
||||
$wallet_page = max(1, isset($_GET['wallet_page']) ? (int) $_GET['wallet_page'] : 1);
|
||||
$wlog = class_exists('AKSRT_Balance')
|
||||
? AKSRT_Balance::get_log(['user_id' => $user_id, 'page' => $wallet_page, 'per_page' => 10])
|
||||
$wlog = class_exists('\AKSRT\Credits\Balance')
|
||||
? \AKSRT\Credits\Balance::get_log(['user_id' => $user_id, 'page' => $wallet_page, 'per_page' => 10])
|
||||
: ['items' => [], 'total' => 0];
|
||||
?>
|
||||
<div class="uc-transactions uc-transactions--wallet">
|
||||
@@ -92,7 +92,7 @@ if ($show_wallet || $show_credits) :
|
||||
<?php foreach ($wlog['items'] as $row) :
|
||||
$delta = (float) $row['delta'];
|
||||
$delta_class = $delta >= 0 ? 'is-positive' : 'is-negative';
|
||||
$delta_txt = ($delta > 0 ? '+' : '') . (class_exists('AKSRT_Balance') ? AKSRT_Balance::format($delta) : number_format_i18n($delta, 2));
|
||||
$delta_txt = ($delta > 0 ? '+' : '') . (class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($delta) : number_format_i18n($delta, 2));
|
||||
?>
|
||||
<div class="uc-transactions__item">
|
||||
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
|
||||
@@ -100,7 +100,7 @@ if ($show_wallet || $show_credits) :
|
||||
</div>
|
||||
<div class="uc-transactions__info">
|
||||
<div class="uc-transactions__reason">
|
||||
<?php echo esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::reason_label((string) $row['reason']) : (string) $row['reason']); ?>
|
||||
<?php echo esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::reason_label((string) $row['reason']) : (string) $row['reason']); ?>
|
||||
<?php if (!empty($row['remark'])) : ?>
|
||||
<span class="uc-transactions__remark">(<?php echo esc_html((string) $row['remark']); ?>)</span>
|
||||
<?php endif; ?>
|
||||
@@ -109,7 +109,7 @@ if ($show_wallet || $show_credits) :
|
||||
</div>
|
||||
<div class="uc-transactions__amount">
|
||||
<span class="uc-transactions__delta <?php echo esc_attr($delta_class); ?>"><?php echo esc_html($delta_txt); ?></span>
|
||||
<span class="uc-transactions__balance"><?php printf(esc_html__('余额 %s', 'aksrt'), esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format((float) ($row['balance_after'] ?? 0)) : number_format_i18n((float) ($row['balance_after'] ?? 0), 2))); ?></span>
|
||||
<span class="uc-transactions__balance"><?php printf(esc_html__('余额 %s', 'aksrt'), esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format((float) ($row['balance_after'] ?? 0)) : number_format_i18n((float) ($row['balance_after'] ?? 0), 2))); ?></span>
|
||||
<?php if (!empty($row['ref_id'])) : ?>
|
||||
<span class="uc-transactions__ref muted-2-color em09"><?php printf(esc_html__('单号 %s', 'aksrt'), esc_html((string) $row['ref_id'])); ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -61,7 +61,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
</div>
|
||||
</div>
|
||||
<div class="uc-header__actions">
|
||||
<?php if (class_exists('AKSRT_User_Badges') && AKSRT_User_Badges::enabled()) : ?>
|
||||
<?php if (class_exists('\AKSRT\User\Badges') && \AKSRT\User\Badges::enabled()) : ?>
|
||||
<button type="button" class="btn-ghost btn-sm" data-aksrt-badges-open>
|
||||
<i class="fas fa-award" aria-hidden="true"></i> <?php esc_html_e('我的徽章', 'aksrt'); ?>
|
||||
</button>
|
||||
@@ -85,7 +85,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (class_exists('AKSRT_User_Badges') && AKSRT_User_Badges::enabled()) : ?>
|
||||
<?php if (class_exists('\AKSRT\User\Badges') && \AKSRT\User\Badges::enabled()) : ?>
|
||||
<div class="uc-modal" id="aksrt-badges-modal" hidden data-aksrt-badges-modal data-user-id="<?php echo (int) $user_id; ?>" data-can-wear="1">
|
||||
<div class="uc-modal__overlay" data-aksrt-badges-close></div>
|
||||
<div class="uc-modal__dialog" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e('我的徽章', 'aksrt'); ?>">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$oauth = class_exists('AKSRT_OAuth') ? AKSRT_OAuth::get_instance() : null;
|
||||
$oauth = class_exists('\AKSRT\Auth\OAuth') ? \AKSRT\Auth\OAuth::get_instance() : null;
|
||||
$oauth_data = $oauth ? $oauth->get_frontend_bindings_data($user_id) : ['bindings' => [], 'available' => []];
|
||||
$binding_name_map = [
|
||||
'github' => 'GitHub',
|
||||
|
||||
@@ -25,7 +25,7 @@ if ($show_wallet || $show_credits) :
|
||||
<a class="uc-asset-mini__card flex1" href="<?php echo esc_url($assets_url); ?>">
|
||||
<div class="uc-asset-mini__label muted-2-color em09"><?php esc_html_e('余额', 'aksrt'); ?><i class="ml6 fa fa-angle-right em12" aria-hidden="true"></i></div>
|
||||
<div class="flex jsb ac">
|
||||
<span class="font-bold c-blue-2"><?php echo esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format($wallet) : number_format_i18n($wallet, 2)); ?></span>
|
||||
<span class="font-bold c-blue-2"><?php echo esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($wallet) : number_format_i18n($wallet, 2)); ?></span>
|
||||
<i class="fas fa-wallet em14 c-blue-2" aria-hidden="true"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
Reference in new issue
Block a user