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.
58 lines
1.9 KiB
PHP
58 lines
1.9 KiB
PHP
<?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>
|