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>
92 lines
8.0 KiB
PHP
92 lines
8.0 KiB
PHP
<?php
|
|
/** User center identity certification panel. @package Jio */
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
use Jio\User\AuthApply;
|
|
use Jio\Identity\EvidenceService;
|
|
|
|
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
|
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
|
|
$snapshot = AuthApply::snapshot($user_id);
|
|
$settings = AuthApply::settings();
|
|
$info = is_array($snapshot['info'] ?? null) ? $snapshot['info'] : [];
|
|
$application = is_array($snapshot['application'] ?? null) ? $snapshot['application'] : [];
|
|
$status = (string) ($snapshot['status'] ?? '');
|
|
$can_apply = !empty($snapshot['can_apply']);
|
|
$auth_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-user-auth') : '<i class="fa fas fa-id-badge" aria-hidden="true"></i>';
|
|
$close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('jiosvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
|
|
$config = [
|
|
'restBase' => untrailingslashit(rest_url('jio/v1/identity/applications')),
|
|
'nonce' => wp_create_nonce('wp_rest'),
|
|
];
|
|
?>
|
|
<div class="colorful-bg c-blue flex jc jio-widget-box" style="padding: 40px 20px;" data-identity-root data-identity-config="<?php echo esc_attr(wp_json_encode($config)); ?>">
|
|
<div class="colorful-make"></div>
|
|
<div class="text-center">
|
|
<div class="em4x"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
|
<div class="mt10 em14 padding-w10 font-bold mb40"><?php echo esc_html(!empty($snapshot['verified']) ? __('我的认证信息', 'jio') : __('申请身份认证', 'jio')); ?></div>
|
|
<div class="text-left" data-auth-summary>
|
|
<?php if (!empty($snapshot['verified'])) : ?>
|
|
<div class="em12"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml6"><?php echo esc_html((string) ($info['name'] ?? __('官方认证', 'jio'))); ?></b></div>
|
|
<?php if (!empty($info['desc'])) : ?><div class="muted-2-color mt10"><?php echo esc_html((string) $info['desc']); ?></div><?php endif; ?>
|
|
<?php if (!empty($info['time'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('认证时间:%s', 'jio'), esc_html((string) $info['time'])); ?></div><?php endif; ?>
|
|
<?php elseif ($status === 'pending') : ?>
|
|
<div class="c-red mb10"><?php esc_html_e('您的申请正在审核中,请耐心等待', 'jio'); ?></div>
|
|
<div><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml3"><?php echo esc_html((string) ($application['public_name'] ?? '')); ?></b></div>
|
|
<?php if (!empty($application['description'])) : ?><div class="muted-2-color mt10"><?php echo esc_html((string) $application['description']); ?></div><?php endif; ?>
|
|
<?php if (!empty($application['manual_reason'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('申请说明:%s', 'jio'), esc_html((string) $application['manual_reason'])); ?></div><?php endif; ?>
|
|
<?php if (!empty($application['created_at'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('申请时间:%s', 'jio'), esc_html((string) $application['created_at'])); ?></div><?php endif; ?>
|
|
<?php $evidence_items = (new EvidenceService())->items($application); ?>
|
|
<?php if ($evidence_items) : ?><div class="mt20 flex" style="gap:8px;flex-wrap:wrap;"><?php foreach ($evidence_items as $item) : ?><a href="<?php echo esc_url($item['url']); ?>" target="_blank" rel="noopener noreferrer"><img src="<?php echo esc_url($item['thumbnail_url']); ?>" alt="<?php esc_attr_e('身份认证证明材料', 'jio'); ?>" style="width:64px;height:64px;object-fit:cover;border-radius:4px;"></a><?php endforeach; ?></div><?php endif; ?>
|
|
<?php else : ?>
|
|
<div class="em12 mb10"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml6"><?php esc_html_e('申请认证', 'jio'); ?></b></div>
|
|
<?php if ($can_apply && !empty($settings['desc'])) : ?><div class="muted-color mb20 uc-auth-intro"><?php echo wp_kses_post((string) $settings['desc']); ?></div><?php endif; ?>
|
|
<?php if ($can_apply) : ?>
|
|
<button type="button" class="but jb-blue padding-lg btn-block mt20" data-auth-modal-open><?php esc_html_e('申请认证', 'jio'); ?></button>
|
|
<?php else : ?>
|
|
<div class="c-red"><i class="fa mr6 fa-info-circle" aria-hidden="true"></i><?php esc_html_e('抱歉!暂时不能申请身份认证', 'jio'); ?></div>
|
|
<?php if (empty($settings['allow_apply']) && !empty($settings['disable_desc'])) : ?><div class="muted-color mt20"><?php echo nl2br(esc_html((string) $settings['disable_desc'])); ?></div><?php elseif (empty($snapshot['level_ok']) && !empty($snapshot['minimum_level'])) : ?><div class="muted-color mt20"><?php printf(esc_html__('由于您的等级较低,暂时无法申请身份认证,请升级到 %s 之后再来申请。', 'jio'), esc_html(\Jio\User\Level::get_level_name((int) $snapshot['minimum_level']))); ?></div><?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ($can_apply) : ?>
|
|
<template data-auth-modal-template>
|
|
<div class="uc-auth-modal">
|
|
<div class="modal-colorful-header colorful-bg c-blue uc-auth-modal__header">
|
|
<button type="button" class="close uc-auth-modal__close" data-jio-modal-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><?php echo $close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button>
|
|
<div class="colorful-make"></div>
|
|
<div class="text-center">
|
|
<div class="em2x"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
|
<div class="mt10 em12 padding-w10" id="uc-auth-modal-title"><?php esc_html_e('申请身份认证', 'jio'); ?></div>
|
|
</div>
|
|
</div>
|
|
<div class="uc-auth-modal__body">
|
|
<form class="auth-apply-from form-upload uc-auth-form" data-auth-create enctype="multipart/form-data" novalidate>
|
|
<div class="uc-auth-form__scroll mini-scrollbar scroll-y max-vh5" style="padding: 0 3px;">
|
|
<?php if (!empty($settings['desc'])) : ?><div class="muted-color mb20 uc-auth-intro"><?php echo wp_kses_post((string) $settings['desc']); ?></div><?php endif; ?>
|
|
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('认证身份', 'jio'); ?></span><input class="form-control" name="name" minlength="4" maxlength="16" required placeholder="<?php esc_attr_e('请输入身份名称', 'jio'); ?>"></label>
|
|
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('身份简介', 'jio'); ?></span><textarea class="form-control" name="description" rows="2" placeholder="<?php esc_attr_e('请输入申请的身份简介', 'jio'); ?>"></textarea></label>
|
|
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('申请说明', 'jio'); ?></span><textarea class="form-control" name="message" rows="2" placeholder="<?php esc_attr_e('请输入申请缘由及说明', 'jio'); ?>"></textarea></label>
|
|
<div class="form-upload mb10 uc-auth-upload">
|
|
<div class="em09 muted-2-color mb6"><?php esc_html_e('证明材料', 'jio'); ?></div>
|
|
<div class="preview" data-auth-preview>
|
|
<button type="button" class="add" data-auth-file-picker aria-label="<?php esc_attr_e('选择证明材料图片', 'jio'); ?>"></button>
|
|
</div>
|
|
<input class="hide" type="file" data-auth-evidence accept="image/gif,image/jpeg,image/png,image/webp" multiple>
|
|
<div class="muted-2-color em09 mt6"><?php esc_html_e('最多上传 3 张图片,单张不超过 2MB。材料仅本人和认证审核管理员可查看。', 'jio'); ?></div>
|
|
</div>
|
|
</div>
|
|
<div class="but-average modal-buts uc-auth-modal__footer">
|
|
<button type="button" class="but" data-jio-modal-close><?php esc_html_e('取消', 'jio'); ?></button>
|
|
<button type="submit" class="but c-blue"><i class="fa fas fa-check mr6" aria-hidden="true"></i><?php esc_html_e('确认提交', 'jio'); ?></button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<?php endif; ?>
|
|
</div>
|