Files
kate522andClaude Opus 5 35bb96e82f refactor: rename the theme brand and every identifier from AKSRT to Jio
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>
2026-11-01 20:05:04 +08:00

79 lines
2.8 KiB
PHP

<?php
/**
* Docs Mode: Sidebar Navigation
*
* 文档模式侧边栏:显示文档目录树,当前章节高亮。
* Uses \Jio\Core\DocsPresenter for tree construction.
*
* @package Jio
*/
defined('ABSPATH') || exit;
$current_id = get_the_ID();
$parent_id = wp_get_post_parent_id($current_id);
$root_id = $parent_id ?: $current_id;
$presenter = class_exists('\Jio\Core\DocsPresenter') ? \Jio\Core\DocsPresenter::get_instance() : null;
if ($presenter) {
$doc_pages = $presenter->get_flat_tree($root_id, 3);
} else {
$doc_pages = get_pages([
'child_of' => $root_id,
'sort_column' => 'menu_order, post_title',
'sort_order' => 'ASC',
'parent' => $root_id,
]);
}
$root_page = get_post($root_id);
?>
<aside class="jio-doc-sidebar" role="navigation" aria-label="<?php esc_attr_e('文档导航', 'jio'); ?>">
<div class="jio-doc-sidebar__header">
<a href="<?php echo esc_url(get_permalink($root_id)); ?>" class="jio-doc-sidebar__root">
<i class="fa fas fa-book jio-doc-sidebar__root-icon"></i>
<span><?php echo esc_html($root_page->post_title ?? __('文档', 'jio')); ?></span>
</a>
</div>
<div class="jio-doc-sidebar__search">
<input type="text" class="jio-doc-sidebar__search-input" placeholder="<?php esc_attr_e('搜索文档...', 'jio'); ?>" aria-label="<?php esc_attr_e('搜索文档', 'jio'); ?>">
<i class="fa fas fa-search jio-doc-sidebar__search-icon"></i>
</div>
<?php if (!empty($doc_pages)) : ?>
<ul class="jio-doc-sidebar__nav">
<?php foreach ($doc_pages as $dp) :
$depth = isset($dp->_depth) ? (int) $dp->_depth : 0;
$is_current = ((int) $dp->ID === $current_id);
$is_ancestor = ((int) $dp->ID === $parent_id);
$li_class = 'jio-doc-sidebar__item';
if ($is_current) $li_class .= ' is-current';
if ($is_ancestor) $li_class .= ' is-ancestor';
if ($depth > 0) $li_class .= ' jio-doc-sidebar__item--depth-' . $depth;
$has_children = false;
if ($presenter) {
$sub = get_pages(['parent' => $dp->ID, 'post_status' => 'publish', 'fields' => 'ids']);
$has_children = !empty($sub);
} else {
$sub_pages = get_pages(['child_of' => $dp->ID, 'sort_column' => 'menu_order', 'sort_order' => 'ASC', 'parent' => $dp->ID]);
$has_children = !empty($sub_pages);
}
$is_open = $is_current || $is_ancestor;
?>
<li class="<?php echo esc_attr($li_class); ?>" style="<?php echo $depth > 0 ? 'padding-left:' . ($depth * 16) . 'px;' : ''; ?>">
<a href="<?php echo esc_url(get_permalink($dp->ID)); ?>" class="jio-doc-sidebar__link<?php echo $is_current ? ' is-active' : ''; ?>">
<?php if ($has_children) : ?>
<i class="fa fas fa-chevron-<?php echo $is_open ? 'down' : 'right'; ?> jio-doc-sidebar__toggle" aria-hidden="true"></i>
<?php endif; ?>
<span><?php echo esc_html($dp->post_title); ?></span>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</aside>