feat(nav): deep 1:1 zibll search-box + navbar-search + newposts unify
Port aksrt_get_search_box/posts for menu_search and layout 1/3 slide; unify publish switch; expand user-box admin row; CSS/JS remote-box parity.
This commit is contained in:
1 parent
70f7ef71e1
commit
1d1fef50af
19 files changed
+980
-267
No files matched your search
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Layout 1/3 top search slide layer (zibll .navbar-search + search-box).
|
||||
*
|
||||
* Footer tabbar keeps templates/parts/search-panel.php (#tabbar-search-overlay).
|
||||
* Top-nav icons use data-toggle-class="show" data-target=".navbar-search".
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$header_nav = \AKSRT\Settings\Settings::get_header_nav_settings();
|
||||
if (empty($header_nav['search_enabled'])) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_search_box')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$show_keywords = true;
|
||||
$show_history = true;
|
||||
$show_posts = true;
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$show_keywords = method_exists('\AKSRT\Settings\Settings', 'hot_search_enabled')
|
||||
? (bool) \AKSRT\Settings\Settings::hot_search_enabled()
|
||||
: true;
|
||||
$show_history = method_exists('\AKSRT\Settings\Settings', 'search_history_enabled')
|
||||
? (bool) \AKSRT\Settings\Settings::search_history_enabled()
|
||||
: true;
|
||||
$show_posts = method_exists('\AKSRT\Settings\Settings', 'search_posts_enabled')
|
||||
? (bool) \AKSRT\Settings\Settings::search_posts_enabled()
|
||||
: !empty(\AKSRT\Settings\Settings::get_value('search_posts', true));
|
||||
}
|
||||
?>
|
||||
<div class="navbar-search main-search" data-aksrt-shell="navbar-search" aria-hidden="true">
|
||||
<div class="container">
|
||||
<button type="button" class="close navbar-search-close" data-toggle-class="show" data-target=".navbar-search" aria-label="<?php esc_attr_e('关闭搜索', 'aksrt'); ?>">
|
||||
<i class="fas fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php
|
||||
// Full form + keywords + history + hot posts (zibll show_form=true path).
|
||||
echo aksrt_get_search_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
'show_form' => true,
|
||||
'show_keywords' => $show_keywords,
|
||||
'show_history' => $show_history,
|
||||
'show_posts' => $show_posts,
|
||||
'show_type' => true,
|
||||
'show_input_cat'=> true,
|
||||
's' => is_search() ? get_search_query() : '',
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Global search panel (desktop + mobile).
|
||||
* Footer tabbar / shell search overlay (NOT the top-nav zibll slide).
|
||||
*
|
||||
* Top navigation uses templates/parts/navbar-search.php (.navbar-search) for
|
||||
* layouts 1/3 and remote menu_search for layout 2.
|
||||
*
|
||||
* DOM contracts for assets/js/core/search.js and footer-tabbar search tab:
|
||||
* - #tabbar-search-overlay (also #nav-search-panel for shell config)
|
||||
|
||||
Reference in new issue
Block a user