fix(admin): replicate reference post-feature settings page 1:1

- Rewrite post_list/feature schema (PHP + JS) with the reference theme's
  field set, order, defaults and dependencies; print/PDF toggles dropped
- Move the migrated reference fields off the post-page schema (lightbox
  six switches, post like, default view/like ranges) to kill the dual path
- Map PostDisplay::get_post_page_settings() to the new keys without legacy
  fallback: imagelightbox* (pc_s/m_s checkboxes merged), post_like_s,
  post_default_mate ranges, article_nav + article_nav_mobile_nav_s
- Wire article_nav runtime: content data-nav/no-nav gate with per-post
  override, mobile drawer TOC box, imgbox_type config
- Seed random views/likes on new posts from post_default_mate ranges
- Keep the print stylesheet enqueued unconditionally (no switch); drop the
  dead print/PDF settings and needs_print requirement
- Add post-feature settings reference contract test
This commit is contained in:
kate522 committed 2026-09-24 14:29:04 +08:00
1 parent c331b2aeef
commit 4d6b2c6045
12 files changed
+469 -85

No files matched your search

+10 -1
View File
@@ -602,11 +602,19 @@ if (!function_exists('aksrt_single_render_article')) :
function aksrt_single_render_article(array $ctx): void {
$settings = is_array($ctx['settings'] ?? null) ? $ctx['settings'] : [];
$maxheight = (int) $ctx['content_maxheight'];
// 文章目录树(参考主题 article_nav):全局开关 + 每篇文章「不显示目录树」覆盖。
$article_nav_on = !isset($settings['article_nav']) || !empty($settings['article_nav']);
if ($article_nav_on) {
$extension_meta = get_post_meta(get_the_ID(), \AKSRT\Core\DomainModel::POST_META_KEY, true);
if (is_array($extension_meta) && !empty($extension_meta['no_article-navs'])) {
$article_nav_on = false;
}
}
?>
<article <?php post_class('article main-bg theme-box box-body radius8 main-shadow'); ?>>
<?php aksrt_single_render_box_header($ctx); ?>
<div class="article-content">
<div class="article-content<?php echo $article_nav_on ? '' : ' no-nav'; ?>">
<?php if (!empty($settings['yiyan_header'])) : ?>
<?php
aksrt_render_yiyan_block([
@@ -626,6 +634,7 @@ if (!function_exists('aksrt_single_render_article')) :
<?php endif; ?>
<div class="theme-box wp-posts-content<?php echo $maxheight > 0 ? ' limit-height' : ''; ?>"
<?php echo $article_nav_on ? 'data-nav="posts"' : ''; ?>
<?php echo $maxheight > 0 ? ' style="max-height:' . esc_attr((string) $maxheight) . 'px;"' : ''; ?>
data-maxheight="<?php echo esc_attr((string) ($maxheight > 0 ? max(0, $maxheight - 80) : 0)); ?>">
<?php the_content(); ?>