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
@@ -26,11 +26,11 @@ $tab = sanitize_key((string) ($_GET['tab'] ?? ''));
|
||||
$status = sanitize_key((string) ($_GET['order_status'] ?? ''));
|
||||
|
||||
$tab_status_map = [
|
||||
'pending' => AKSRT_Order::STATUS_PENDING,
|
||||
'shipped' => AKSRT_Order::STATUS_DELIVERED,
|
||||
'received' => AKSRT_Order::STATUS_COMPLETED,
|
||||
'review' => AKSRT_Order::STATUS_PENDING_REVIEW,
|
||||
'after' => AKSRT_Order::STATUS_REFUNDING,
|
||||
'pending' => \AKSRT\Payment\Order::STATUS_PENDING,
|
||||
'shipped' => \AKSRT\Payment\Order::STATUS_DELIVERED,
|
||||
'received' => \AKSRT\Payment\Order::STATUS_COMPLETED,
|
||||
'review' => \AKSRT\Payment\Order::STATUS_PENDING_REVIEW,
|
||||
'after' => \AKSRT\Payment\Order::STATUS_REFUNDING,
|
||||
];
|
||||
if ($tab !== '' && isset($tab_status_map[$tab])) {
|
||||
$status = $tab_status_map[$tab];
|
||||
@@ -43,8 +43,8 @@ $orders_view = function_exists('aksrt_get_orders_page_view')
|
||||
$orders = (array) ($orders_view['items'] ?? []);
|
||||
$total_pages = max(1, (int) ($orders_view['total_pages'] ?? 1));
|
||||
|
||||
$shop = class_exists('AKSRT_Shop') ? AKSRT_Shop::get_instance() : null;
|
||||
$shipping = class_exists('AKSRT_Shipping') ? AKSRT_Shipping::get_instance() : null;
|
||||
$shop = class_exists('\AKSRT\Shop\Shop') ? \AKSRT\Shop\Shop::get_instance() : null;
|
||||
$shipping = class_exists('\AKSRT\Payment\Shipping') ? \AKSRT\Payment\Shipping::get_instance() : null;
|
||||
|
||||
$tabs = [
|
||||
'' => __('全部', 'aksrt'),
|
||||
@@ -159,13 +159,13 @@ $tabs = [
|
||||
<?php if (!empty($order['actions']['can_receipt'])) : ?>
|
||||
<button type="button" class="btn-primary btn-sm" data-aksrt-order-receipt="<?php echo esc_attr($on); ?>"><?php esc_html_e('确认收货', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php if ($os === AKSRT_Order::STATUS_PENDING_REVIEW) : ?>
|
||||
<?php if ($os === \AKSRT\Payment\Order::STATUS_PENDING_REVIEW) : ?>
|
||||
<button type="button" class="btn-primary btn-sm" data-aksrt-order-review="<?php echo esc_attr($on); ?>"><?php esc_html_e('去评价', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($order['actions']['can_cancel'])) : ?>
|
||||
<button type="button" class="btn-ghost btn-sm" data-aksrt-order-cancel="<?php echo esc_attr($on); ?>"><?php esc_html_e('取消', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php if (in_array($os, [AKSRT_Order::STATUS_COMPLETED, AKSRT_Order::STATUS_PENDING_REVIEW], true)) : ?>
|
||||
<?php if (in_array($os, [\AKSRT\Payment\Order::STATUS_COMPLETED, \AKSRT\Payment\Order::STATUS_PENDING_REVIEW], true)) : ?>
|
||||
<button type="button" class="btn-outline btn-sm" data-aksrt-order-rebuy="<?php echo esc_attr($on); ?>"><?php esc_html_e('再次购买', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($order['actions']['can_after_sale'])) : ?>
|
||||
@@ -214,7 +214,7 @@ $tabs = [
|
||||
<div class="aksrt-orders-page__field">
|
||||
<label><?php esc_html_e('售后类型', 'aksrt'); ?></label>
|
||||
<select name="type" class="aksrt-orders-page__select">
|
||||
<?php foreach (AKSRT_After_Sale::get_valid_types() as $type_key => $type_label) : ?>
|
||||
<?php foreach (\AKSRT\Payment\AfterSale::get_valid_types() as $type_key => $type_label) : ?>
|
||||
<option value="<?php echo esc_attr($type_key); ?>"><?php echo esc_html($type_label); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
Reference in new issue
Block a user