Files
kate522andClaude Opus 5 427968a721 chore(branding): remove leftover upstream theme identifiers
The theme was renamed Zibll/子比 → AKSRT → Jio, but upstream branding
survived the sweeps in CSS classes, the SVG sprite prefix, a persisted
widget field ID, JS events, admin Vue class names, test infrastructure
and docblocks.

Renames:
- zib-widget / zib-widget-wrap / zib-slider → jio-widget-box /
  jio-widget-box-wrap / jio-slider-box (jio-widget is taken by the modern
  widget shell, jio-box-* by the card primitives)
- zib-partners-scroll + zps-* → jio-partners-scroll + jps-*
- zib-combo-info-card + zci-* → jio-combo-info-card + jci-*
- zibsvg- → jiosvg-, including the exported picker helpers and the
  fa-zibsvg- family-prefix guard
- zibpay_type → pay_type; the dual-read fallback in PostQuery collapses
  to a single key
- [zibajax="submit"] dropped (no PHP emitter); zib_ajax.success →
  jio_ajax.success
- aks-* admin Vue classes → jio-*
- zib_palette() → palette()

User-facing vendor traces are gone: the floating "more" button default no
longer ships a zibll.com link or 子比主题 marketing copy, the notice
widget ships no preset promo entries, and the four 官网教程 links are
removed from the post-list admin schema.

Test infrastructure renamed to neutral names (docker-compose.reference.yml,
Caddyfile, article-baseline.json, modern-widgets-contract.test.cjs) with
their DB/volume/env/slug identifiers following.

Kept intentionally, documented in tests/fixtures/README.md: the golden
fixture reference fingerprint (a SHA-256 record of an external directory,
read by validate-widget-golden / generate-widget-golden-fixture /
audit-widget-system), the doesNotMatch guards that prove the old tokens are
gone, and the reference theme's own meta key in the visual fixtures.

No backward-compat or data migration: saved widget configs holding old
icon keys or the old field ID silently lose them, per the project's
rewrite-over-compatibility rule.

Verified: 132/132 node contract tests, php tests/widget-system/run.php
(146 assertions), audit-admin-contracts, audit-psr4-paths and
validate-widget-golden all green; tracked bundles regenerated and in sync.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-02 00:06:54 +08:00

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="jio-widget-box 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>