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>
88 lines
5.9 KiB
PHP
88 lines
5.9 KiB
PHP
<?php
|
|
/** @var array $ctx */
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (empty($ctx['can_pay'])) return;
|
|
|
|
$settings = $ctx['settings'];
|
|
$pay = is_array($ctx['pay_meta'] ?? null) ? $ctx['pay_meta'] : [];
|
|
$enabled = !empty($pay['pay_type']) && $pay['pay_type'] !== 'no';
|
|
$modo = ($pay['pay_modo'] ?? '0') === 'points' ? 'points' : '0';
|
|
$points_on = !empty($ctx['points_enabled']);
|
|
$manual = !empty($settings['pay_vip_price_s']);
|
|
$vip1_on = !empty($ctx['vip']['vip1_enabled']);
|
|
$vip2_on = !empty($ctx['vip']['vip2_enabled']);
|
|
$vip1_name = (string) ($ctx['vip']['vip1_name'] ?? 'VIP1');
|
|
$vip2_name = (string) ($ctx['vip']['vip2_name'] ?? 'VIP2');
|
|
$downloads = is_array($pay['downloads'] ?? null) ? $pay['downloads'] : [];
|
|
|
|
if (!function_exists('jio_submit_pay_line')) {
|
|
function jio_submit_pay_line(string $label, string $name, string $value, string $step): void {
|
|
?>
|
|
<div class="relative mt6"><div class="flex ab"><div class="muted-color mb6 flex0"><?php echo esc_html($label); ?></div><input type="number" min="0" step="<?php echo esc_attr($step); ?>" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($value); ?>" class="line-form-input em2x key-color text-right"><i class="line-form-line"></i></div></div>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
<div class="zib-widget dependency-box mb10-sm newpost-pay-box" data-pay-box>
|
|
<div class="title-theme mb10"><?php esc_html_e('付费内容', 'jio'); ?></div>
|
|
<div class="flex ac jsb padding-h10 border-bottom">
|
|
<div class="flex ac"><?php esc_html_e('内容付费', 'jio'); ?></div>
|
|
<label class="form-switch-label"><input class="hide" type="checkbox" name="pay_enabled" value="1" <?php checked($enabled); ?> data-pay-toggle><div class="form-switch flex0"></div></label>
|
|
</div>
|
|
|
|
<div data-pay-fields <?php echo $enabled ? '' : 'hidden'; ?>>
|
|
<?php if ($points_on) : ?>
|
|
<div class="flex ac jsb padding-h10">
|
|
<div class="flex ac"><?php esc_html_e('支付类型', 'jio'); ?></div>
|
|
<div class="but-average radius em09">
|
|
<button type="button" class="but p2-10 pointer<?php echo $modo !== 'points' ? ' active' : ''; ?>" data-pay-modo="0"><?php esc_html_e('现金支付', 'jio'); ?></button>
|
|
<button type="button" class="but p2-10 pointer<?php echo $modo === 'points' ? ' active' : ''; ?>" data-pay-modo="points"><?php esc_html_e('积分支付', 'jio'); ?></button>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
<input type="hidden" name="jio_pay[pay_modo]" value="<?php echo esc_attr($modo); ?>" data-pay-modo-input>
|
|
<input type="hidden" name="jio_pay[pay_type]" value="<?php echo esc_attr((string) ($pay['pay_type'] ?? 'reading')); ?>" data-pay-type-input>
|
|
|
|
<div class="mt10 newpost-pay-price" data-pay-cash <?php echo $modo === 'points' ? 'hidden' : ''; ?>>
|
|
<?php jio_submit_pay_line(__('设置价格', 'jio'), 'jio_pay[price]', (string) ($pay['price'] ?? ''), '0.01'); ?>
|
|
<?php if ($manual && $vip1_on) jio_submit_pay_line(sprintf(__('%s价格', 'jio'), $vip1_name), 'jio_pay[vip1_price]', (string) ($pay['vip1_price'] ?? ''), '0.01'); ?>
|
|
<?php if ($manual && $vip2_on) jio_submit_pay_line(sprintf(__('%s价格', 'jio'), $vip2_name), 'jio_pay[vip2_price]', (string) ($pay['vip2_price'] ?? ''), '0.01'); ?>
|
|
<?php if ($manual && ($vip1_on || $vip2_on)) : ?><div class="px12 mt6 muted-color"><?php esc_html_e('会员价不能高于普通价,为0则为会员免费', 'jio'); ?></div><?php endif; ?>
|
|
</div>
|
|
|
|
<div class="mt10 newpost-pay-price" data-pay-points <?php echo $modo !== 'points' ? 'hidden' : ''; ?>>
|
|
<?php jio_submit_pay_line(__('设置积分', 'jio'), 'jio_pay[points_price]', (string) ($pay['points_price'] ?? ''), '1'); ?>
|
|
<?php if ($manual && $vip1_on) jio_submit_pay_line(sprintf(__('%s积分', 'jio'), $vip1_name), 'jio_pay[vip1_points]', (string) ($pay['vip1_points'] ?? ''), '1'); ?>
|
|
<?php if ($manual && $vip2_on) jio_submit_pay_line(sprintf(__('%s积分', 'jio'), $vip2_name), 'jio_pay[vip2_points]', (string) ($pay['vip2_points'] ?? ''), '1'); ?>
|
|
<?php if ($manual && ($vip1_on || $vip2_on)) : ?><div class="px12 mt6 muted-color"><?php esc_html_e('会员价不能高于普通价,为0则为会员免费', 'jio'); ?></div><?php endif; ?>
|
|
</div>
|
|
|
|
<?php if (!empty($ctx['can_pay_download'])) : ?>
|
|
<div class="mt10 pay-dawnload-edit" data-pay-downloads>
|
|
<div class="flex ac jsb padding-h10">
|
|
<b><?php esc_html_e('付费下载', 'jio'); ?></b>
|
|
<button type="button" class="pay-dawnload-add but hollow p2-10 px12 c-blue" data-pay-download-add><i class="fa fas fa-plus mr3"></i><?php esc_html_e('添加资源', 'jio'); ?></button>
|
|
</div>
|
|
<div class="mt10 px12 lists-box" data-pay-download-list>
|
|
<?php foreach ($downloads as $index => $row) : ?>
|
|
<div class="flex ac jsb lists-item" data-pay-download-item>
|
|
<button type="button" class="flex1 name-link pay-dawnload-add-edit" data-pay-download-edit><?php echo esc_html((string) ($row['url'] ?? '')); ?></button>
|
|
<button type="button" class="pay-dawnload-add-delete em12 ml10 hollow but cir c-red" data-pay-download-remove aria-label="<?php esc_attr_e('删除资源', 'jio'); ?>"><i class="fa far fa-trash-alt" aria-hidden="true"></i></button>
|
|
<div class="hidden-input">
|
|
<?php foreach (['url', 'attachment_id', 'extract_code', 'copy_key', 'copy_val', 'label', 'class'] as $field) : ?>
|
|
|
|
<input type="hidden" name="jio_pay[downloads][<?php echo (int) $index; ?>][<?php echo esc_attr($field); ?>]" data-pay-download-field="<?php echo esc_attr($field); ?>" value="<?php echo esc_attr((string) ($row[$field] ?? '')); ?>">
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="em09 mt10 muted-2-color"><?php esc_html_e('请确保已经在文中添加了付费可见的隐藏内容或已添加付费下载内容', 'jio'); ?></div>
|
|
</div>
|
|
<div class="em09 mt10 muted-2-color" data-pay-off-hint <?php echo $enabled ? 'hidden' : ''; ?>><?php esc_html_e('如果您在文章中添加了付费可见的隐藏内容或需要设置付费下载资源,请在此设置付费功能', 'jio'); ?></div>
|
|
</div>
|