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>
This commit is contained in:
1 parent
42cc64106d
commit
427968a721
188 files changed
+915
-967
No files matched your search
@@ -112,7 +112,7 @@ final class FieldSchema {
|
||||
/**
|
||||
* Inline rich-HTML sanitizer for admin-authored card title/desc fields.
|
||||
* `badge` and friends are not in WP's $allowedposttags, so wp_kses_post()
|
||||
* would strip the exact markup legacy/Zibll renders verbatim.
|
||||
* would strip the exact markup these fields render verbatim.
|
||||
*/
|
||||
private static function rich_inline_html(string $value): string {
|
||||
return function_exists('jio_icon_card_kses')
|
||||
|
||||
@@ -91,7 +91,7 @@ final class FrontendRenderer {
|
||||
}
|
||||
|
||||
private static function render_reference_widget(WidgetDefinition $definition, array $instance, SchemaWidget $widget, string $content): void {
|
||||
$classes = ['zib-widget-wrap', 'jio-' . str_replace('_', '-', $definition->slug()) . '-wrap'];
|
||||
$classes = ['jio-widget-box-wrap', 'jio-' . str_replace('_', '-', $definition->slug()) . '-wrap'];
|
||||
if (in_array($definition->slug(), ['user_card', 'author_card'], true)) {
|
||||
$classes[] = 'jio-user-widget-wrap';
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ final class PostQuery {
|
||||
$args['paged'] = 1;
|
||||
}
|
||||
|
||||
// The modern post widgets use Zibll's signed `cat` syntax. Legacy
|
||||
// The modern post widgets use the signed `cat` syntax. Legacy
|
||||
// category_ids remains available only to the unrelated generic posts
|
||||
// widgets; a tab segment must never fall back to it.
|
||||
$is_reference_segment = array_key_exists('cat', $segment);
|
||||
if (array_key_exists('cat', $config)) {
|
||||
// WP_Query's `cat` expands included parents to descendants and
|
||||
// applies negative IDs with the same reference-theme semantics.
|
||||
// applies negative IDs as exclusions.
|
||||
$categories = self::signed_ids((string) $config['cat']);
|
||||
if ($categories) {
|
||||
$args['cat'] = implode(',', $categories);
|
||||
@@ -64,8 +64,7 @@ final class PostQuery {
|
||||
]];
|
||||
}
|
||||
self::apply_order($args, (string) ($config['orderby'] ?? 'date'), (string) ($config['order'] ?? 'DESC'));
|
||||
$pay = array_key_exists('zibpay_type', $config) ? $config['zibpay_type'] : ($config['pay_type'] ?? '');
|
||||
self::apply_pay_type($args, $pay);
|
||||
self::apply_pay_type($args, $config['pay_type'] ?? '');
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ final class PostRenderer {
|
||||
return jio_render_mini_list($query, array_merge($config, ['class' => 'ajax-item']), false);
|
||||
}
|
||||
if ($mode === 'list') {
|
||||
// Zibll suppresses archive-only thumb variants in widget list mode.
|
||||
// Widget list mode suppresses archive-only thumb variants.
|
||||
$config['is_mult_thumb'] = 'disable';
|
||||
$config['is_no_thumb'] = 'disable';
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ final class ContentRenderer {
|
||||
}
|
||||
$inner = self::ajaxpager($instance, $slug, $widget_id, 1, '');
|
||||
$html = '<div class="widget-main-post mb20 style-' . esc_attr($style) . '">';
|
||||
$html .= $style === 'mini' ? '<div class="zib-widget posts-mini-lists">' : '';
|
||||
$html .= $style === 'mini' ? '<div class="jio-widget-box posts-mini-lists">' : '';
|
||||
$html .= $inner;
|
||||
$html .= $style === 'mini' ? '</div>' : '';
|
||||
return $html . '</div>';
|
||||
@@ -102,7 +102,7 @@ final class ContentRenderer {
|
||||
$visible_index++;
|
||||
}
|
||||
if ($buttons === '') return '';
|
||||
return '<div class="widget-tab-post style-' . esc_attr($style) . ($style === 'mini' ? ' posts-mini-lists zib-widget' : ' index-tab relative-h') . '" data-widget="tab_posts" data-instance="' . esc_attr($widget_id) . '"><div class="relative' . ($style === 'card' ? ' mb20' : '') . '"><ul class="list-inline scroll-x no-scrollbar' . ($style === 'mini' ? ' tab-nav-theme' : '') . '" role="tablist">' . $buttons . '</ul></div><div class="tab-content">' . $panels . '</div></div>';
|
||||
return '<div class="widget-tab-post style-' . esc_attr($style) . ($style === 'mini' ? ' posts-mini-lists jio-widget-box' : ' index-tab relative-h') . '" data-widget="tab_posts" data-instance="' . esc_attr($widget_id) . '"><div class="relative' . ($style === 'card' ? ' mb20' : '') . '"><ul class="list-inline scroll-x no-scrollbar' . ($style === 'mini' ? ' tab-nav-theme' : '') . '" role="tablist">' . $buttons . '</ul></div><div class="tab-content">' . $panels . '</div></div>';
|
||||
}
|
||||
|
||||
private static function term_cards(array $instance): string {
|
||||
|
||||
@@ -60,7 +60,7 @@ final class GeneralRenderer {
|
||||
continue;
|
||||
}
|
||||
$icon_size = !$cover && !empty($instance['size']) ? 16 + (int) $instance['size'] : ($cover ? 25 : 0);
|
||||
$class = $cover ? (!empty($instance['show_widget_bg']) ? 'padding-10' : 'zib-widget mb10') : (!empty($instance['show_widget_bg']) ? 'box-body nopw-sm' : 'mb20');
|
||||
$class = $cover ? (!empty($instance['show_widget_bg']) ? 'padding-10' : 'jio-widget-box mb10') : (!empty($instance['show_widget_bg']) ? 'box-body nopw-sm' : 'mb20');
|
||||
$args = [
|
||||
'icon' => $card['icon'] ?? '',
|
||||
'customize_icon' => $card['customize_icon'] ?? '',
|
||||
@@ -86,8 +86,8 @@ final class GeneralRenderer {
|
||||
}
|
||||
if ($items === '') return '';
|
||||
$inner = $is_row ? '<div class="row gutters-5">' . $items . '</div>' : $items;
|
||||
if ($cover) return '<div class="' . ($instance['show_widget_bg'] ?? false ? 'zib-widget padding-10' : 'mb10') . '">' . $inner . '</div>';
|
||||
return '<div class="clearfix">' . (!empty($instance['show_widget_bg']) ? '<div class="zib-widget nobottom notop">' : '') . $inner . (!empty($instance['show_widget_bg']) ? '</div>' : '') . '</div>';
|
||||
if ($cover) return '<div class="' . ($instance['show_widget_bg'] ?? false ? 'jio-widget-box padding-10' : 'mb10') . '">' . $inner . '</div>';
|
||||
return '<div class="clearfix">' . (!empty($instance['show_widget_bg']) ? '<div class="jio-widget-box nobottom notop">' : '') . $inner . (!empty($instance['show_widget_bg']) ? '</div>' : '') . '</div>';
|
||||
}
|
||||
|
||||
private static function render_video(array $i): string {
|
||||
@@ -225,18 +225,18 @@ final class GeneralRenderer {
|
||||
$rows_data = array_values(array_filter($rows_data, static fn(array $row): bool => $row !== []));
|
||||
|
||||
$style_vars = [
|
||||
'--zps-card-w:' . (int) $i['card_width'] . 'px',
|
||||
'--zps-card-h:' . (int) $i['card_height'] . 'px',
|
||||
'--zps-card-radius:' . (int) $i['card_radius'] . 'px',
|
||||
'--zps-speed:' . max(0.1, (float) $i['speed']),
|
||||
'--jps-card-w:' . (int) $i['card_width'] . 'px',
|
||||
'--jps-card-h:' . (int) $i['card_height'] . 'px',
|
||||
'--jps-card-radius:' . (int) $i['card_radius'] . 'px',
|
||||
'--jps-speed:' . max(0.1, (float) $i['speed']),
|
||||
];
|
||||
$style_attr = ' style="' . esc_attr(implode(';', $style_vars)) . '"';
|
||||
|
||||
$wrap_class = 'zib-partners-scroll';
|
||||
$wrap_class .= ' zps-style-' . sanitize_html_class((string) $i['style_type']);
|
||||
$wrap_class .= !empty($i['pause_hover']) ? ' zps-pause-hover' : '';
|
||||
$wrap_class .= !empty($i['card_bg']) ? ' zps-card-bg' : '';
|
||||
$wrap_class .= !empty($i['end_fade']) ? ' zps-end-fade' : '';
|
||||
$wrap_class = 'jio-partners-scroll';
|
||||
$wrap_class .= ' jps-style-' . sanitize_html_class((string) $i['style_type']);
|
||||
$wrap_class .= !empty($i['pause_hover']) ? ' jps-pause-hover' : '';
|
||||
$wrap_class .= !empty($i['card_bg']) ? ' jps-card-bg' : '';
|
||||
$wrap_class .= !empty($i['end_fade']) ? ' jps-end-fade' : '';
|
||||
|
||||
$html = '';
|
||||
foreach ($rows_data as $row_index => $row_partners) {
|
||||
@@ -246,7 +246,7 @@ final class GeneralRenderer {
|
||||
} else {
|
||||
$dir = $row_index % 2 === 0 ? 'left' : 'right';
|
||||
}
|
||||
$html .= '<div class="zps-row zps-dir-' . $dir . '" data-zps-row><div class="zps-track" data-zps-track><div class="zps-group flex shrink0">';
|
||||
$html .= '<div class="jps-row jps-dir-' . $dir . '" data-jps-row><div class="jps-track" data-jps-track><div class="jps-group flex shrink0">';
|
||||
foreach ($row_partners as $partner) {
|
||||
$html .= self::partners_card($partner, (string) $i['style_type'], !empty($i['go_link']));
|
||||
}
|
||||
@@ -255,7 +255,7 @@ final class GeneralRenderer {
|
||||
if (trim($html) === '') {
|
||||
return '';
|
||||
}
|
||||
return '<div class="' . (!empty($i['show_widget_bg']) ? 'zib-widget' : 'mb20') . '"><div class="' . esc_attr($wrap_class) . '"' . $style_attr . '>' . $html . '</div></div>';
|
||||
return '<div class="' . (!empty($i['show_widget_bg']) ? 'jio-widget-box' : 'mb20') . '"><div class="' . esc_attr($wrap_class) . '"' . $style_attr . '>' . $html . '</div></div>';
|
||||
}
|
||||
|
||||
private static function partners_card(array $partner, string $style_type, bool $go_link): string {
|
||||
@@ -266,7 +266,7 @@ final class GeneralRenderer {
|
||||
if ($image === '' && $title === '') {
|
||||
return '';
|
||||
}
|
||||
$img_tag = $image !== '' ? '<img class="zps-img" src="' . $image . '" alt="' . esc_attr($title !== '' ? $title : __('合作伙伴', 'jio')) . '">' : '';
|
||||
$img_tag = $image !== '' ? '<img class="jps-img" src="' . $image . '" alt="' . esc_attr($title !== '' ? $title : __('合作伙伴', 'jio')) . '">' : '';
|
||||
|
||||
$inner = '';
|
||||
if ($style_type === 'logo') {
|
||||
@@ -276,19 +276,19 @@ final class GeneralRenderer {
|
||||
$inner .= $img_tag;
|
||||
} elseif ($style_type === 'chip') {
|
||||
if ($img_tag !== '') {
|
||||
$inner .= '<span class="zps-chip-icon flex jc shrink0 mr6">' . $img_tag . '</span>';
|
||||
$inner .= '<span class="jps-chip-icon flex jc shrink0 mr6">' . $img_tag . '</span>';
|
||||
}
|
||||
$inner .= '<span class="zps-chip-title text-ellipsis">' . esc_html($title) . '</span>';
|
||||
$inner .= '<span class="jps-chip-title text-ellipsis">' . esc_html($title) . '</span>';
|
||||
} else {
|
||||
if ($img_tag !== '') {
|
||||
$inner .= '<div class="zps-card-icon flex jc shrink0 mr10">' . $img_tag . '</div>';
|
||||
$inner .= '<div class="jps-card-icon flex jc shrink0 mr10">' . $img_tag . '</div>';
|
||||
}
|
||||
$inner .= '<div class="zps-card-text flex xx flex1">';
|
||||
$inner .= '<div class="jps-card-text flex xx flex1">';
|
||||
if ($title !== '') {
|
||||
$inner .= '<div class="zps-card-title text-ellipsis font-bold">' . esc_html($title) . '</div>';
|
||||
$inner .= '<div class="jps-card-title text-ellipsis font-bold">' . esc_html($title) . '</div>';
|
||||
}
|
||||
if ($desc !== '') {
|
||||
$inner .= '<div class="zps-card-desc text-ellipsis muted-color em09 mt3">' . esc_html($desc) . '</div>';
|
||||
$inner .= '<div class="jps-card-desc text-ellipsis muted-color em09 mt3">' . esc_html($desc) . '</div>';
|
||||
}
|
||||
$inner .= '</div>';
|
||||
}
|
||||
@@ -299,7 +299,7 @@ final class GeneralRenderer {
|
||||
$url = esc_url(jio_go_link($link['url'], true));
|
||||
}
|
||||
$target = $link['target'] === '_blank' ? ' target="_blank" rel="noopener noreferrer"' : '';
|
||||
$base_class = 'zps-item flex ac shrink0';
|
||||
$base_class = 'jps-item flex ac shrink0';
|
||||
if ($url !== 'javascript:void(0)') {
|
||||
return '<a class="' . $base_class . '" href="' . $url . '"' . $target . '>' . $inner . '</a>';
|
||||
}
|
||||
@@ -317,9 +317,9 @@ final class GeneralRenderer {
|
||||
$m_row = max(1, (int) $i['m_row']);
|
||||
$col_class = 'col-sm-' . max(1, (int) (12 / $pc_row)) . ' col-xs-' . max(1, (int) (12 / $m_row));
|
||||
|
||||
$style_vars = '--zci-radius:' . (int) $i['card_radius'] . 'px;--zci-band-h:' . (int) $i['top_band_height'] . 'px;';
|
||||
$wrap_class = 'zib-combo-info-card row gutters-' . (int) ($is_mobile ? $i['m_gap'] : $i['pc_gap']);
|
||||
$wrap_class .= !empty($i['top_band']) ? ' zci-has-band' : '';
|
||||
$style_vars = '--jci-radius:' . (int) $i['card_radius'] . 'px;--jci-band-h:' . (int) $i['top_band_height'] . 'px;';
|
||||
$wrap_class = 'jio-combo-info-card row gutters-' . (int) ($is_mobile ? $i['m_gap'] : $i['pc_gap']);
|
||||
$wrap_class .= !empty($i['top_band']) ? ' jci-has-band' : '';
|
||||
|
||||
$default_cta = (string) ($i['cta_text'] !== '' ? $i['cta_text'] : __('立即体验', 'jio'));
|
||||
$default_cta_color = (string) ($i['cta_color'] ?? '');
|
||||
@@ -374,15 +374,15 @@ final class GeneralRenderer {
|
||||
$icon_html = '';
|
||||
$icon_image = esc_url((string) $card['icon_image']);
|
||||
if ($icon_image !== '') {
|
||||
$icon_html = '<div class="zci-icon flex jc shrink0 mb20"><img src="' . $icon_image . '" alt="' . esc_attr($title !== '' ? $title : __('图标', 'jio')) . '"></div>';
|
||||
$icon_html = '<div class="jci-icon flex jc shrink0 mb20"><img src="' . $icon_image . '" alt="' . esc_attr($title !== '' ? $title : __('图标', 'jio')) . '"></div>';
|
||||
} elseif (!empty($card['icon'])) {
|
||||
$icon_html = '<div class="zci-icon flex jc shrink0 mb20">' . self::icon_markup((string) $card['icon']) . '</div>';
|
||||
$icon_html = '<div class="jci-icon flex jc shrink0 mb20">' . self::icon_markup((string) $card['icon']) . '</div>';
|
||||
}
|
||||
|
||||
$tags_html = '';
|
||||
$tags = (array) ($card['tags'] ?? []);
|
||||
if ($tags) {
|
||||
$tags_html .= '<div class="zci-tags mb10 text-ellipsis">';
|
||||
$tags_html .= '<div class="jci-tags mb10 text-ellipsis">';
|
||||
foreach ($tags as $tag) {
|
||||
if (!is_array($tag)) {
|
||||
continue;
|
||||
@@ -396,7 +396,7 @@ final class GeneralRenderer {
|
||||
$tags_html .= '</div>';
|
||||
}
|
||||
|
||||
$desc_html = $desc !== '' ? '<div class="zci-desc text-ellipsis-3 muted-color">' . wp_kses_post($desc) . '</div>' : '';
|
||||
$desc_html = $desc !== '' ? '<div class="jci-desc text-ellipsis-3 muted-color">' . wp_kses_post($desc) . '</div>' : '';
|
||||
|
||||
$cta_text = trim((string) ($card['cta_text'] ?? '')) !== '' ? trim((string) $card['cta_text']) : $default_cta;
|
||||
$cta_color = trim((string) ($card['cta_color'] ?? '')) !== '' ? trim((string) $card['cta_color']) : $default_cta_color;
|
||||
@@ -407,15 +407,15 @@ final class GeneralRenderer {
|
||||
}
|
||||
$target = $link['target'] === '_blank' ? ' target="_blank" rel="noopener noreferrer"' : '';
|
||||
$cta_html = $cta_text !== '' && $url !== ''
|
||||
? '<a class="zci-cta inflex ac gap6 ' . esc_attr(sanitize_html_class($cta_color)) . '" href="' . $url . '"' . $target . '><span>' . esc_html($cta_text) . '</span><i class="fa fas fa-arrow-right zci-arrow" aria-hidden="true"></i></a>'
|
||||
? '<a class="jci-cta inflex ac gap6 ' . esc_attr(sanitize_html_class($cta_color)) . '" href="' . $url . '"' . $target . '><span>' . esc_html($cta_text) . '</span><i class="fa fas fa-arrow-right jci-arrow" aria-hidden="true"></i></a>'
|
||||
: '';
|
||||
|
||||
$inner = '<div class="zci-body flex xx flex1">' . $icon_html;
|
||||
$inner = '<div class="jci-body flex xx flex1">' . $icon_html;
|
||||
if ($title !== '') {
|
||||
$inner .= '<div class="zci-title font-bold text-ellipsis mb10">' . esc_html($title) . '</div>';
|
||||
$inner .= '<div class="jci-title font-bold text-ellipsis mb10">' . esc_html($title) . '</div>';
|
||||
}
|
||||
$inner .= $tags_html . $desc_html . $cta_html . '</div>';
|
||||
return '<div class="zci-card flex xx zci-band-' . esc_attr(sanitize_html_class($band)) . '">' . $inner . '</div>';
|
||||
return '<div class="jci-card flex xx jci-band-' . esc_attr(sanitize_html_class($band)) . '">' . $inner . '</div>';
|
||||
}
|
||||
|
||||
private static function render_text_title(array $i): string {
|
||||
@@ -486,7 +486,7 @@ final class GeneralRenderer {
|
||||
if ($list === '') {
|
||||
return RendererHelpers::empty_state(__('暂无评论', 'jio'));
|
||||
}
|
||||
return '<div class="box-body comment-mini-lists zib-widget">' . $list . '</div>';
|
||||
return '<div class="box-body comment-mini-lists jio-widget-box">' . $list . '</div>';
|
||||
}
|
||||
|
||||
private static function render_links(array $i): string {
|
||||
|
||||
@@ -6,7 +6,7 @@ use Jio\WidgetSystem\RendererHelpers;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
/** Reference-compatible renderer for the modern Zibll slider widgets. */
|
||||
/** Renderer for the slider widgets. */
|
||||
final class SliderRenderer {
|
||||
public static function render(string $slug, array $instance, array $context = []): string {
|
||||
unset($context);
|
||||
@@ -88,9 +88,9 @@ final class SliderRenderer {
|
||||
$html = '<div class="' . esc_attr($class) . '"' . $attrs . '><div class="swiper-wrapper">' . $items . '</div>';
|
||||
if (!empty($option['button']) && $count > 1) $html .= '<div class="swiper-button-prev"></div><div class="swiper-button-next"></div>';
|
||||
if (!empty($option['pagination']) && $count > 1) $html .= '<div class="swiper-pagination kaoyou"></div>';
|
||||
// 参考 zib_new_slider:先闭合 .new-swiper,再由外层闭合 .zib-slider。
|
||||
// 先闭合 .new-swiper,再由外层闭合 .jio-slider-box。
|
||||
$html .= '</div>';
|
||||
return '<div class="relative zib-slider">' . $html . '</div>';
|
||||
return '<div class="relative jio-slider-box">' . $html . '</div>';
|
||||
}
|
||||
|
||||
private static function combo(array $instance): string {
|
||||
|
||||
@@ -74,7 +74,7 @@ final class UserRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 未登录卡片(legacy zib_get_user_singin_page_box parity)。
|
||||
* 未登录卡片。
|
||||
*/
|
||||
private static function guest_card(array $i): string {
|
||||
$title = trim((string) ($i['loged_title'] ?? ''));
|
||||
@@ -95,7 +95,7 @@ final class UserRenderer {
|
||||
$buttons .= '<a href="javascript:;" class="signup-loader ml10 but jb-yellow padding-lg">' . jio_renderer_svg_icon('signup') . esc_html__('注册', 'jio') . '</a>';
|
||||
}
|
||||
|
||||
return '<div class="mb20"><div class="user-card zib-widget widget">' . $cover
|
||||
return '<div class="mb20"><div class="user-card jio-widget-box widget">' . $cover
|
||||
. '<div class="card-content mt10">'
|
||||
. '<div class="user-content">'
|
||||
. '<div class="user-avatar">' . $avatar . '</div>'
|
||||
@@ -139,7 +139,7 @@ final class UserRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录卡片(legacy zib_get_user_card_box parity)。
|
||||
* 登录卡片。
|
||||
*
|
||||
* @param int $user_id 卡片用户。
|
||||
* @param array $args show_posts/show_checkin/show_img_bg/show_button/button_1,2 与文章模块参数。
|
||||
@@ -208,7 +208,7 @@ final class UserRenderer {
|
||||
|
||||
$cover = !empty($args['show_img_bg']) ? self::cover($user_id, 'lazy_cover') : '';
|
||||
|
||||
return '<div class="user-card zib-widget widget">' . $cover
|
||||
return '<div class="user-card jio-widget-box widget">' . $cover
|
||||
. '<div class="card-content mt10 relative">'
|
||||
. '<div class="user-content">' . $checkin
|
||||
. '<div class="user-avatar">' . $avatar . '</div>'
|
||||
@@ -223,7 +223,7 @@ final class UserRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡片按钮1(legacy zib_get_new_add_btns 的单按钮 parity:正则剥掉 icon/text,输出纯文字药丸)。
|
||||
* 卡片按钮1(单按钮:正则剥掉 icon/text,输出纯文字药丸)。
|
||||
*/
|
||||
private static function new_add_btn(string $type, string $class, string $text): string {
|
||||
if ($type !== 'post') {
|
||||
|
||||
@@ -89,19 +89,16 @@ final class WidgetSchemas {
|
||||
['id' => 'blank', 'type' => 'switcher', 'label' => '链接新窗口打开', 'default' => false],
|
||||
['id' => 'radius', 'type' => 'switcher', 'label' => '两边显示为圆形', 'default' => false],
|
||||
['id' => 'interval', 'type' => 'spinner', 'label' => '滚动间隔', 'default' => 3, 'min' => 1, 'max' => 10, 'step' => 1, 'unit' => '秒'],
|
||||
['id' => 'color', 'type' => 'palette', 'label' => '颜色', 'default' => 'c-blue', 'options' => self::zib_palette()],
|
||||
['id' => 'color', 'type' => 'palette', 'label' => '颜色', 'default' => 'c-blue', 'options' => self::palette()],
|
||||
['id' => 'source', 'type' => 'radio', 'label' => '内容来源', 'default' => '', 'options' => ['' => '自定义', 'posts' => '文章']],
|
||||
['id' => 'msg_icon', 'type' => 'icon', 'label' => '消息图标', 'default' => 'zibsvg-hot', 'dependency' => ['source', '!=', '']],
|
||||
['id' => 'msg_icon', 'type' => 'icon', 'label' => '消息图标', 'default' => 'jiosvg-hot', 'dependency' => ['source', '!=', '']],
|
||||
['id' => 'count', 'type' => 'spinner', 'label' => '获取文章数量', 'default' => 8, 'min' => 1, 'max' => 50, 'dependency' => ['source', '!=', '']],
|
||||
['id' => 'desc_s', 'type' => 'switcher', 'label' => '显示简介(关闭则只显示标题)', 'default' => false],
|
||||
['id' => 'posts_opts', 'type' => 'fieldset', 'label' => '文章筛选', 'default' => [], 'dependency' => ['source', '==', 'posts'], 'fields' => self::notice_post_fields()],
|
||||
[
|
||||
'id' => 'img_ids', 'type' => 'group', 'label' => '消息列表', 'max_items' => 50,
|
||||
'dependency' => ['source', '==', ''],
|
||||
'default' => [
|
||||
['title' => '子比主题,更优雅的Wordpress主题', 'icon' => 'zibsvg-hot', 'href' => 'https://zibll.com'],
|
||||
['title' => '更优雅的WordPress网站主题:子比主题!全面开启', 'icon' => 'zibsvg-hot', 'href' => 'https://zibll.com'],
|
||||
],
|
||||
'default' => [],
|
||||
'fields' => [
|
||||
['id' => 'title', 'type' => 'text', 'label' => '消息内容', 'default' => '', 'allow_html' => true],
|
||||
['id' => 'icon', 'type' => 'icon', 'label' => '图标', 'default' => 'fa-home'],
|
||||
@@ -241,7 +238,7 @@ final class WidgetSchemas {
|
||||
return [
|
||||
['id' => 'load_mode', 'type' => 'radio', 'label' => '模块加载方式', 'default' => 'ajax', 'options' => ['detail' => '直接加载', 'ajax' => 'ajax懒加载'], 'description' => 'ajax懒加载:当页面加载完后,根据用户需要在加载当前模块内容,可提高页面渲染效率'],
|
||||
['id' => 'cat', 'type' => 'text', 'label' => '分类限制', 'default' => '', 'sanitize' => 'reference_ids', 'description' => '限制请填写对应的ID,多个ID请用英文逗号隔开。如:1,2,3。支持负数进行排除,例如:-1,-2,-3。'],
|
||||
['id' => 'zibpay_type', 'type' => 'checkbox', 'label' => '商品类型筛选', 'default' => [], 'options' => self::pay_types(), 'description' => '不做其它筛选'],
|
||||
['id' => 'pay_type', 'type' => 'checkbox', 'label' => '商品类型筛选', 'default' => [], 'options' => self::pay_types(), 'description' => '不做其它筛选'],
|
||||
['id' => 'limit_day', 'type' => 'spinner', 'label' => '发布时间限制', 'default' => 0, 'min' => 0, 'step' => 5, 'unit' => '天', 'description' => '仅显示最近多少天发布的文章,为0则不限制'],
|
||||
['id' => 'orderby', 'type' => 'select', 'label' => '排序方式', 'default' => '', 'options' => self::posts_orderby()],
|
||||
['id' => 'order', 'type' => 'radio', 'label' => '顺序', 'default' => 'desc', 'options' => ['desc' => '降序', 'asc' => '升序']],
|
||||
@@ -268,7 +265,7 @@ final class WidgetSchemas {
|
||||
'fields' => [
|
||||
['id' => 'title', 'type' => 'textarea', 'label' => '标题(必填)', 'default' => '', 'allow_html' => true, 'attributes' => ['rows' => 1], 'description' => '栏目显示的标题,支持HTML代码,注意代码规范'],
|
||||
['id' => 'cat', 'type' => 'text', 'label' => '分类限制', 'default' => '', 'sanitize' => 'reference_ids'],
|
||||
['id' => 'zibpay_type', 'type' => 'checkbox', 'label' => '商品类型筛选', 'default' => [], 'options' => self::pay_types(), 'description' => '不做其它筛选'],
|
||||
['id' => 'pay_type', 'type' => 'checkbox', 'label' => '商品类型筛选', 'default' => [], 'options' => self::pay_types(), 'description' => '不做其它筛选'],
|
||||
['id' => 'limit_day', 'type' => 'spinner', 'label' => '发布时间限制', 'default' => 0, 'min' => 0, 'step' => 5, 'unit' => '天', 'description' => '仅显示最近多少天发布的文章,为0则不限制'],
|
||||
['id' => 'orderby', 'type' => 'select', 'label' => '排序方式', 'default' => '', 'options' => self::posts_orderby()],
|
||||
['id' => 'order', 'type' => 'radio', 'label' => '顺序', 'default' => 'desc', 'options' => ['desc' => '降序', 'asc' => '升序']],
|
||||
@@ -280,7 +277,7 @@ final class WidgetSchemas {
|
||||
private static function oneline_posts_fields(): array {
|
||||
return [
|
||||
['id' => 'cat', 'type' => 'text', 'label' => '分类限制', 'default' => '', 'sanitize' => 'reference_ids', 'description' => '限制请填写对应的ID,多个ID请用英文逗号隔开。如:1,2,3。支持负数进行排除,例如:-1,-2,-3。'],
|
||||
['id' => 'zibpay_type', 'type' => 'checkbox', 'label' => '商品类型筛选', 'default' => [], 'options' => self::pay_types(), 'description' => '不做其它筛选'],
|
||||
['id' => 'pay_type', 'type' => 'checkbox', 'label' => '商品类型筛选', 'default' => [], 'options' => self::pay_types(), 'description' => '不做其它筛选'],
|
||||
['id' => 'orderby', 'type' => 'select', 'label' => '排序方式', 'default' => '', 'options' => self::posts_orderby()],
|
||||
['id' => 'order', 'type' => 'radio', 'label' => '顺序', 'default' => 'desc', 'options' => ['desc' => '降序', 'asc' => '升序']],
|
||||
['id' => 'style', 'type' => 'radio', 'label' => '列表样式', 'default' => 'card', 'options' => ['list' => '列表样式', 'card' => '卡片样式', 'mini' => 'mini列表'], 'description' => '<div class="c-yellow">注意:不同样式尺寸不同,请根据放置的位置合理选择。例如:放在宽度较小的侧边栏,则需选择mini样式,否则显示效果不佳</div>'],
|
||||
@@ -496,10 +493,10 @@ final class WidgetSchemas {
|
||||
$button_fields = [
|
||||
['id' => 'show_button', 'type' => 'switcher', 'label' => '显示按钮', 'description' => $slug === 'user_card' ? '登录后才会显示' : '当登录用户就是文章作者的时候才会显示', 'default' => true],
|
||||
['id' => 'button_1', 'type' => 'radio', 'label' => '按钮1类型', 'default' => 'post', 'options' => ['post' => '文章投稿'], 'dependency' => ['show_button', '!=', '']],
|
||||
['id' => 'button_1_class', 'type' => 'palette', 'label' => '按钮1颜色', 'default' => 'jb-pink', 'options' => self::zib_palette(), 'dependency' => ['show_button', '!=', '']],
|
||||
['id' => 'button_1_class', 'type' => 'palette', 'label' => '按钮1颜色', 'default' => 'jb-pink', 'options' => self::palette(), 'dependency' => ['show_button', '!=', '']],
|
||||
['id' => 'button_1_text', 'type' => 'text', 'label' => '按钮1文字', 'default' => '发布文章', 'dependency' => ['show_button', '!=', '']],
|
||||
['id' => 'button_2', 'type' => 'radio', 'label' => '按钮2类型', 'default' => 'center', 'options' => ['home' => '个人主页', 'center' => '用户中心'], 'dependency' => ['show_button', '!=', '']],
|
||||
['id' => 'button_2_class', 'type' => 'palette', 'label' => '按钮2颜色', 'default' => 'jb-blue', 'options' => self::zib_palette(), 'dependency' => ['show_button', '!=', '']],
|
||||
['id' => 'button_2_class', 'type' => 'palette', 'label' => '按钮2颜色', 'default' => 'jb-blue', 'options' => self::palette(), 'dependency' => ['show_button', '!=', '']],
|
||||
['id' => 'button_2_text', 'type' => 'text', 'label' => '按钮2文字', 'default' => '用户中心', 'dependency' => ['show_button', '!=', '']],
|
||||
];
|
||||
if ($slug === 'user_card') {
|
||||
@@ -597,7 +594,7 @@ final class WidgetSchemas {
|
||||
}
|
||||
|
||||
private static function tag_palette(): array {
|
||||
return ['' => '默认'] + self::zib_palette();
|
||||
return ['' => '默认'] + self::palette();
|
||||
}
|
||||
|
||||
private static function text_palette(): array {
|
||||
@@ -620,10 +617,10 @@ final class WidgetSchemas {
|
||||
}
|
||||
|
||||
private static function button_palette(): array {
|
||||
return ['' => '默认'] + self::zib_palette();
|
||||
return ['' => '默认'] + self::palette();
|
||||
}
|
||||
|
||||
private static function zib_palette(): array {
|
||||
private static function palette(): array {
|
||||
return [
|
||||
'c-red' => '红色', 'c-red-2' => '深红', 'c-yellow' => '黄色', 'c-yellow-2' => '深黄',
|
||||
'c-cyan' => '青色', 'c-blue' => '蓝色', 'c-blue-2' => '深蓝', 'c-green' => '绿色',
|
||||
|
||||
Reference in new issue
Block a user