refactor: rename the theme brand and every identifier from AKSRT to Jio
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>
This commit is contained in:
1 parent
5b16bc6e15
commit
35bb96e82f
997 files changed
+28216
-28188
No files matched your search
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*
|
||||
* PayChargeCards 列表渲染(过滤 / 搜索 / 排序 / 批量删除 / 分页)与翻页参数拼装。
|
||||
* 作为 flat sibling trait 被 PayChargeCards 使用(PSR-4:trait 必须与宿主类同目录)。
|
||||
*/
|
||||
|
||||
namespace AKSRT\Admin\Native;
|
||||
namespace Jio\Admin\Native;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -16,7 +16,7 @@ trait PayChargeCardsList {
|
||||
* @param string $s 搜索词(由页面头部统一解析后传入,用于提示、过滤链接与查询)。
|
||||
*/
|
||||
private function render_list(string $s): void {
|
||||
$svc = \AKSRT\Payment\ChargeCard::get_instance();
|
||||
$svc = \Jio\Payment\ChargeCard::get_instance();
|
||||
|
||||
$status = isset($_GET['status']) ? sanitize_key((string) wp_unslash($_GET['status'])) : '';
|
||||
$type = isset($_GET['type']) ? sanitize_key((string) wp_unslash($_GET['type'])) : '';
|
||||
@@ -39,11 +39,11 @@ trait PayChargeCardsList {
|
||||
|
||||
// 过滤链接(标题右侧按钮与搜索提示由页面头部统一输出)。
|
||||
$sub_but = [
|
||||
['name' => __('全部', 'aksrt'), 'href' => $this->page_url],
|
||||
['name' => __('全部', 'jio'), 'href' => $this->page_url],
|
||||
];
|
||||
if ($s === '') {
|
||||
$sub_but[] = ['name' => __('未使用', 'aksrt'), 'href' => add_query_arg('status', '0', $this->page_url)];
|
||||
$sub_but[] = ['name' => __('已使用', 'aksrt'), 'href' => add_query_arg('status', 'used', $this->page_url)];
|
||||
$sub_but[] = ['name' => __('未使用', 'jio'), 'href' => add_query_arg('status', '0', $this->page_url)];
|
||||
$sub_but[] = ['name' => __('已使用', 'jio'), 'href' => add_query_arg('status', 'used', $this->page_url)];
|
||||
foreach ($this->type_labels() as $_k => $_v) {
|
||||
$sub_but[] = ['name' => $_v, 'href' => add_query_arg('type', $_k, $this->page_url)];
|
||||
}
|
||||
@@ -56,8 +56,8 @@ trait PayChargeCardsList {
|
||||
|
||||
$search = '<form class="form-inline form-order" method="post">
|
||||
<div class="form-group" style="float: right;">
|
||||
<input type="text" class="form-control" name="s" placeholder="' . esc_attr__('搜索卡密', 'aksrt') . '">
|
||||
<button type="submit" class="button">' . esc_html__('提交', 'aksrt') . '</button>
|
||||
<input type="text" class="form-control" name="s" placeholder="' . esc_attr__('搜索卡密', 'jio') . '">
|
||||
<button type="submit" class="button">' . esc_html__('提交', 'jio') . '</button>
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
@@ -93,8 +93,8 @@ trait PayChargeCardsList {
|
||||
|
||||
if (!$items) {
|
||||
NativeUi::table_card_open();
|
||||
echo '<table class="widefat fixed striped posts table table-bordered aksrt-cardpass-table">';
|
||||
echo '<tbody>' . NativeUi::empty_row(1, esc_html__('未找到对应内容,或暂无内容', 'aksrt')) . '</tbody>';
|
||||
echo '<table class="widefat fixed striped posts table table-bordered jio-cardpass-table">';
|
||||
echo '<tbody>' . NativeUi::empty_row(1, esc_html__('未找到对应内容,或暂无内容', 'jio')) . '</tbody>';
|
||||
echo '</table>';
|
||||
NativeUi::table_wrap_close();
|
||||
NativeUi::card_close();
|
||||
@@ -103,22 +103,22 @@ trait PayChargeCardsList {
|
||||
|
||||
// 表头(与参考主题同列、同排序链接)。
|
||||
$theads = [
|
||||
['width' => '6%', 'orderby' => 'card', 'name' => __('卡号', 'aksrt')],
|
||||
['width' => '10%', 'orderby' => 'password', 'name' => __('密码', 'aksrt')],
|
||||
['width' => '5%', 'orderby' => 'type', 'name' => __('类型', 'aksrt')],
|
||||
['width' => '5%', 'orderby' => 'create_time', 'name' => __('创建时间', 'aksrt')],
|
||||
['width' => '5%', 'orderby' => 'modified_time', 'name' => __('更新时间', 'aksrt')],
|
||||
['width' => '5%', 'orderby' => 'status', 'name' => __('状态', 'aksrt')],
|
||||
['width' => '8%', 'orderby' => 'other', 'name' => __('标识', 'aksrt')],
|
||||
['width' => '6%', 'orderby' => 'card', 'name' => __('卡号', 'jio')],
|
||||
['width' => '10%', 'orderby' => 'password', 'name' => __('密码', 'jio')],
|
||||
['width' => '5%', 'orderby' => 'type', 'name' => __('类型', 'jio')],
|
||||
['width' => '5%', 'orderby' => 'create_time', 'name' => __('创建时间', 'jio')],
|
||||
['width' => '5%', 'orderby' => 'modified_time', 'name' => __('更新时间', 'jio')],
|
||||
['width' => '5%', 'orderby' => 'status', 'name' => __('状态', 'jio')],
|
||||
['width' => '8%', 'orderby' => 'other', 'name' => __('标识', 'jio')],
|
||||
];
|
||||
|
||||
$thead_th = '<td id="cb" class="manage-column column-cb check-column" style="width: 2%;"><label class="screen-reader-text" for="cb-select-all-1">' . esc_html__('全选', 'aksrt') . '</label><input id="cb-select-all-1" type="checkbox"></td>';
|
||||
$thead_th = '<td id="cb" class="manage-column column-cb check-column" style="width: 2%;"><label class="screen-reader-text" for="cb-select-all-1">' . esc_html__('全选', 'jio') . '</label><input id="cb-select-all-1" type="checkbox"></td>';
|
||||
foreach ($theads as $thead) {
|
||||
$orderby_links = '';
|
||||
if ($thead['orderby']) {
|
||||
$orderby_url = add_query_arg('orderby', $thead['orderby']);
|
||||
$orderby_links .= '<a title="' . esc_attr__('降序', 'aksrt') . '" href="' . esc_url(add_query_arg('desc', 'ASC', $orderby_url)) . '"><span class="dashicons dashicons-arrow-up"></span></a>';
|
||||
$orderby_links .= '<a title="' . esc_attr__('升序', 'aksrt') . '" href="' . esc_url(add_query_arg('desc', 'DESC', $orderby_url)) . '"><span class="dashicons dashicons-arrow-down"></span></a>';
|
||||
$orderby_links .= '<a title="' . esc_attr__('降序', 'jio') . '" href="' . esc_url(add_query_arg('desc', 'ASC', $orderby_url)) . '"><span class="dashicons dashicons-arrow-up"></span></a>';
|
||||
$orderby_links .= '<a title="' . esc_attr__('升序', 'jio') . '" href="' . esc_url(add_query_arg('desc', 'DESC', $orderby_url)) . '"><span class="dashicons dashicons-arrow-down"></span></a>';
|
||||
$orderby_links = '<span class="orderby-but">' . $orderby_links . '</span>';
|
||||
}
|
||||
$thead_th .= '<th class="" width="' . esc_attr($thead['width']) . '">' . esc_html($thead['name']) . $orderby_links . '</th>';
|
||||
@@ -135,17 +135,17 @@ trait PayChargeCardsList {
|
||||
// 自定义卡密不展示状态;其余类型按状态着色(类型链接统一在下方链表中生成)。
|
||||
$status_html = '';
|
||||
if ($msg['type'] !== 'custom') {
|
||||
$status_html = '<span style="color: #3d7ffd;">' . esc_html__('未使用', 'aksrt') . '</span>';
|
||||
$status_html = '<span style="color: #3d7ffd;">' . esc_html__('未使用', 'jio') . '</span>';
|
||||
if ($msg['status'] === 'used') {
|
||||
$status_html = '<span style="color: #f93b3b;">' . esc_html__('已使用', 'aksrt') . '</span>';
|
||||
$status_html = '<span style="color: #f93b3b;">' . esc_html__('已使用', 'jio') . '</span>';
|
||||
if (!empty($msg['order_number'])) {
|
||||
$order_link_url = admin_url('admin.php?page=aksrt_orders&s=' . urlencode((string) $msg['order_number']));
|
||||
$status_html .= '<a style="color: #ff6215;" target="_blank" href="' . esc_url($order_link_url) . '"> [' . esc_html__('查看', 'aksrt') . ']</a>';
|
||||
$order_link_url = admin_url('admin.php?page=jio_orders&s=' . urlencode((string) $msg['order_number']));
|
||||
$status_html .= '<a style="color: #ff6215;" target="_blank" href="' . esc_url($order_link_url) . '"> [' . esc_html__('查看', 'jio') . ']</a>';
|
||||
}
|
||||
} elseif ($msg['status'] === 'expired') {
|
||||
$status_html = '<span style="color: #8c8f94;">' . esc_html__('已过期', 'aksrt') . '</span>';
|
||||
$status_html = '<span style="color: #8c8f94;">' . esc_html__('已过期', 'jio') . '</span>';
|
||||
} elseif ($msg['status'] === 'disabled') {
|
||||
$status_html = '<span style="color: #8c8f94;">' . esc_html__('已禁用', 'aksrt') . '</span>';
|
||||
$status_html = '<span style="color: #8c8f94;">' . esc_html__('已禁用', 'jio') . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,28 +155,28 @@ trait PayChargeCardsList {
|
||||
}
|
||||
|
||||
if ($msg['type'] === 'vip') {
|
||||
$type_html = '<a style="color:#975106" href="' . esc_url(add_query_arg('type', 'vip', $this->page_url)) . '">' . esc_html__('会员兑换', 'aksrt') . '</a>';
|
||||
$type_html = '<a style="color:#975106" href="' . esc_url(add_query_arg('type', 'vip', $this->page_url)) . '">' . esc_html__('会员兑换', 'jio') . '</a>';
|
||||
$level = (int) ($meta['level'] ?? 1);
|
||||
$type_html .= '<br>' . esc_html($this->vip_level_name($level)) . ':' . esc_html($this->vip_time_text($meta));
|
||||
} elseif ($msg['type'] === 'credits') {
|
||||
$type_html = '<a style="color:#289d0f" href="' . esc_url(add_query_arg('type', 'credits', $this->page_url)) . '">' . esc_html__('积分兑换', 'aksrt') . '</a>';
|
||||
$type_html .= '<br>' . esc_html__('积分:', 'aksrt') . esc_html((string) (int) ($meta['points'] ?? 0));
|
||||
$type_html = '<a style="color:#289d0f" href="' . esc_url(add_query_arg('type', 'credits', $this->page_url)) . '">' . esc_html__('积分兑换', 'jio') . '</a>';
|
||||
$type_html .= '<br>' . esc_html__('积分:', 'jio') . esc_html((string) (int) ($meta['points'] ?? 0));
|
||||
} elseif ($msg['type'] === 'balance') {
|
||||
$type_html = '<a style="color:#0c76e6" href="' . esc_url(add_query_arg('type', 'balance', $this->page_url)) . '">' . esc_html__('余额充值', 'aksrt') . '</a>';
|
||||
$type_html .= '<br>' . esc_html__('金额:', 'aksrt') . esc_html($this->balance_amount_text($meta));
|
||||
$type_html = '<a style="color:#0c76e6" href="' . esc_url(add_query_arg('type', 'balance', $this->page_url)) . '">' . esc_html__('余额充值', 'jio') . '</a>';
|
||||
$type_html .= '<br>' . esc_html__('金额:', 'jio') . esc_html($this->balance_amount_text($meta));
|
||||
} else {
|
||||
$type_html = '<a style="color:#a42ade" href="' . esc_url(add_query_arg('type', 'custom', $this->page_url)) . '">' . esc_html__('自定义卡密', 'aksrt') . '</a>';
|
||||
$type_html = '<a style="color:#a42ade" href="' . esc_url(add_query_arg('type', 'custom', $this->page_url)) . '">' . esc_html__('自定义卡密', 'jio') . '</a>';
|
||||
}
|
||||
|
||||
$card_name = (string) ($meta['custom_name']['card_name'] ?? '');
|
||||
$password_name = (string) ($meta['custom_name']['password_name'] ?? '');
|
||||
|
||||
$tbody .= '<tr>';
|
||||
$tbody .= '<th scope="row" class="check-column"><label class="screen-reader-text" for="cb-select-' . (int) $msg['id'] . '">' . esc_html__('选择', 'aksrt') . '</label>
|
||||
$tbody .= '<th scope="row" class="check-column"><label class="screen-reader-text" for="cb-select-' . (int) $msg['id'] . '">' . esc_html__('选择', 'jio') . '</label>
|
||||
<input id="cb-select-' . (int) $msg['id'] . '" type="checkbox" name="action_id[]" value="' . (int) $msg['id'] . '">
|
||||
</th>';
|
||||
$tbody .= "<td><span data-clipboard-text='" . esc_attr((string) $msg['card']) . "' data-clipboard-tag=\"" . esc_attr($card_name !== '' ? $card_name : __('卡号', 'aksrt')) . "\">" . esc_html($card_name) . ' ' . esc_html((string) $msg['card']) . '</span></td>';
|
||||
$tbody .= "<td><span data-clipboard-text='" . esc_attr((string) $msg['password']) . "' data-clipboard-tag=\"" . esc_attr($password_name !== '' ? $password_name : __('密码', 'aksrt')) . "\">" . esc_html($password_name) . ' ' . esc_html((string) $msg['password']) . '</span></td>';
|
||||
$tbody .= "<td><span data-clipboard-text='" . esc_attr((string) $msg['card']) . "' data-clipboard-tag=\"" . esc_attr($card_name !== '' ? $card_name : __('卡号', 'jio')) . "\">" . esc_html($card_name) . ' ' . esc_html((string) $msg['card']) . '</span></td>';
|
||||
$tbody .= "<td><span data-clipboard-text='" . esc_attr((string) $msg['password']) . "' data-clipboard-tag=\"" . esc_attr($password_name !== '' ? $password_name : __('密码', 'jio')) . "\">" . esc_html($password_name) . ' ' . esc_html((string) $msg['password']) . '</span></td>';
|
||||
$tbody .= "<td>$type_html</td>";
|
||||
$tbody .= '<td>' . esc_html((string) $msg['created_at']) . '</td>';
|
||||
$tbody .= '<td>' . esc_html((string) ($msg['used_at'] ?: $msg['created_at'])) . '</td>';
|
||||
@@ -185,18 +185,18 @@ trait PayChargeCardsList {
|
||||
$tbody .= '</tr>';
|
||||
}
|
||||
|
||||
echo '<form class="aksrt-cardpass-list-form" method="post">';
|
||||
echo '<form class="jio-cardpass-list-form" method="post">';
|
||||
wp_nonce_field(self::NONCE);
|
||||
echo '<div class="bulkactions aksrt-native-bulk aksrt-cardpass-bulk">
|
||||
<label for="bulk-action-selector-top" class="screen-reader-text">' . esc_html__('选择批量操作', 'aksrt') . '</label><select name="action" id="bulk-action-selector-top">
|
||||
<option value="-1">' . esc_html__('批量操作', 'aksrt') . '</option>
|
||||
<option value="delete">' . esc_html__('删除', 'aksrt') . '</option>
|
||||
echo '<div class="bulkactions jio-native-bulk jio-cardpass-bulk">
|
||||
<label for="bulk-action-selector-top" class="screen-reader-text">' . esc_html__('选择批量操作', 'jio') . '</label><select name="action" id="bulk-action-selector-top">
|
||||
<option value="-1">' . esc_html__('批量操作', 'jio') . '</option>
|
||||
<option value="delete">' . esc_html__('删除', 'jio') . '</option>
|
||||
</select>
|
||||
<input type="submit" class="button action" value="' . esc_attr__('应用', 'aksrt') . '">
|
||||
<input type="submit" class="button action" value="' . esc_attr__('应用', 'jio') . '">
|
||||
</div>';
|
||||
|
||||
NativeUi::table_card_open();
|
||||
echo '<table class="widefat fixed striped posts table table-bordered aksrt-cardpass-table">';
|
||||
echo '<table class="widefat fixed striped posts table table-bordered jio-cardpass-table">';
|
||||
echo '<thead><tr>' . $thead_th . '</tr></thead>'; // phpcs:ignore WordPress.Security.EscapeOutput -- 已转义。
|
||||
echo '<tbody>' . $tbody . '</tbody>'; // phpcs:ignore WordPress.Security.EscapeOutput -- 已转义。
|
||||
echo '</table>';
|
||||
|
||||
Reference in new issue
Block a user