进行了一些小修复
This commit is contained in:
1 parent
992af2119d
commit
2cb78edabb
26 files changed
+2091
-2383
No files matched your search
@@ -1,114 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* Sidebar: guest + terms + tags.
|
||||
* Reference-theme article parameters sidebar.
|
||||
*
|
||||
* @var array $ctx
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$settings = $ctx['settings'];
|
||||
$term_helper = get_template_directory() . '/templates/parts/submit/term-checks.php';
|
||||
if (file_exists($term_helper)) {
|
||||
require_once $term_helper;
|
||||
}
|
||||
require_once get_template_directory() . '/templates/parts/submit/term-checks.php';
|
||||
?>
|
||||
|
||||
<?php if (!empty($ctx['is_guest'])) : ?>
|
||||
<div class="aksrt-submit-panel">
|
||||
<div class="aksrt-submit-panel__title"><?php esc_html_e('用户信息', 'aksrt'); ?></div>
|
||||
<div class="aksrt-submit-panel__body">
|
||||
<p class="aksrt-submit-hint"><?php esc_html_e('请输入昵称', 'aksrt'); ?></p>
|
||||
<input class="aksrt-form-input" type="text" name="user_name" placeholder="<?php esc_attr_e('请输入昵称', 'aksrt'); ?>" required>
|
||||
<p class="aksrt-submit-hint"><?php esc_html_e('请输入您的联系方式', 'aksrt'); ?></p>
|
||||
<input class="aksrt-form-input" type="text" name="contact_details" placeholder="<?php esc_attr_e('输入联系方式', 'aksrt'); ?>">
|
||||
</div>
|
||||
<div class="zib-widget mb10-sm newpost-user-inputs">
|
||||
<div class="title-theme mb10"><?php esc_html_e('用户信息', 'aksrt'); ?></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('请输入昵称', 'aksrt'); ?></p>
|
||||
<div class="mb20"><input class="form-control" type="text" name="user_name" placeholder="<?php esc_attr_e('请输入昵称', 'aksrt'); ?>" required></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('请输入您的联系方式', 'aksrt'); ?></p>
|
||||
<input class="form-control" type="text" name="contact_details" placeholder="<?php esc_attr_e('输入联系方式', 'aksrt'); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="aksrt-submit-panel">
|
||||
<div class="aksrt-submit-panel__title"><?php esc_html_e('文章参数', 'aksrt'); ?></div>
|
||||
<div class="aksrt-submit-panel__body term-select-box">
|
||||
|
||||
<div class="zib-widget mb10-sm">
|
||||
<div class="title-theme mb10"><?php esc_html_e('文章参数', 'aksrt'); ?></div>
|
||||
<div class="term-select-box">
|
||||
<?php if (!empty($settings['allow_category'])) : ?>
|
||||
<details class="aksrt-submit-drop" open>
|
||||
<summary>
|
||||
<span><i class="fa fas fa-folder-open"></i> <?php esc_html_e('分类', 'aksrt'); ?></span>
|
||||
<i class="fa fas fa-angle-right"></i>
|
||||
</summary>
|
||||
<div class="aksrt-submit-drop__body">
|
||||
<?php
|
||||
if (!empty($ctx['categories'])) {
|
||||
aksrt_submit_render_term_checks($ctx['categories'], array_map('intval', $ctx['current_cats']), 'category');
|
||||
} else {
|
||||
echo '<p class="aksrt-submit-hint">' . esc_html__('暂无可选择的分类', 'aksrt') . '</p>';
|
||||
}
|
||||
?>
|
||||
<div class="newpost-cat-drop drop-select dropdown dependency-box">
|
||||
<button type="button" data-toggle-class="open" data-target=".newpost-cat-drop" class="flex ac jsb drop-btn form-control mb6" aria-expanded="false">
|
||||
<span class="title-theme222"><i class="fa fas fa-folder-open mr6" aria-hidden="true"></i><?php esc_html_e('分类', 'aksrt'); ?></span><i class="ml6 fa fas fa-angle-right em12"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu fluid">
|
||||
<div class="mini-scrollbar padding-w10 select-drop-box">
|
||||
<?php
|
||||
if (!empty($ctx['categories'])) {
|
||||
aksrt_submit_render_term_checks($ctx['categories'], array_map('intval', $ctx['current_cats']), 'category');
|
||||
} else {
|
||||
echo esc_html__('暂无可选择的分类', 'aksrt');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($settings['custom_filter_s']) && !empty($ctx['custom_dimensions'])) : ?>
|
||||
<?php foreach ($ctx['custom_dimensions'] as $dim) :
|
||||
$key = sanitize_key((string) ($dim['key'] ?? ''));
|
||||
if ($key === '') {
|
||||
continue;
|
||||
}
|
||||
$name = (string) ($dim['name'] ?? $key);
|
||||
$vals = is_array($dim['vals'] ?? null) ? $dim['vals'] : [];
|
||||
$cur = $ctx['current_cf'][$key] ?? [];
|
||||
if (!is_array($cur)) {
|
||||
$cur = $cur === '' || $cur === null ? [] : [$cur];
|
||||
}
|
||||
$cur = array_map('strval', $cur);
|
||||
<?php foreach ($ctx['custom_dimensions'] as $dimension) :
|
||||
$key = sanitize_key((string) ($dimension['key'] ?? ''));
|
||||
if ($key === '') continue;
|
||||
$name = (string) ($dimension['name'] ?? $key);
|
||||
$vals = is_array($dimension['vals'] ?? null) ? $dimension['vals'] : [];
|
||||
$current = (array) ($ctx['current_cf'][$key] ?? []);
|
||||
?>
|
||||
<details class="aksrt-submit-drop">
|
||||
<summary>
|
||||
<span><i class="fa fas fa-filter"></i> <?php echo esc_html($name); ?></span>
|
||||
<i class="fa fas fa-angle-right"></i>
|
||||
</summary>
|
||||
<div class="aksrt-submit-drop__body aksrt-submit-tags">
|
||||
<?php foreach ($vals as $val) :
|
||||
$vk = is_array($val) ? (string) ($val['key'] ?? '') : (string) $val;
|
||||
$vn = is_array($val) ? (string) ($val['name'] ?? $vk) : (string) $val;
|
||||
if ($vk === '') {
|
||||
continue;
|
||||
}
|
||||
$active = in_array($vk, $cur, true);
|
||||
<div class="newpost-custom-filter-<?php echo esc_attr($key); ?> drop-select dropdown dependency-box">
|
||||
<button type="button" data-toggle-class="open" data-target=".newpost-custom-filter-<?php echo esc_attr($key); ?>" class="flex ac jsb drop-btn form-control mb6" aria-expanded="false">
|
||||
<span class="title-theme222"><i class="fa fas fa-filter mr6" aria-hidden="true"></i><?php echo esc_html($name); ?></span><i class="ml6 fa fas fa-angle-right em12"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu fluid"><div class="padding-10 select-drop-box newpost-filter-tags">
|
||||
<?php foreach ($vals as $value) :
|
||||
$value_key = (string) ($value['key'] ?? '');
|
||||
$value_name = (string) ($value['name'] ?? $value_key);
|
||||
if ($value_key === '') continue;
|
||||
$active = in_array($value_key, array_map('strval', $current), true);
|
||||
?>
|
||||
<label class="aksrt-submit-tag <?php echo $active ? 'is-active' : ''; ?>">
|
||||
<input type="checkbox" name="cf_<?php echo esc_attr($key); ?>[]" value="<?php echo esc_attr($vk); ?>" <?php checked($active); ?>>
|
||||
<span><?php echo esc_html($vn); ?></span>
|
||||
</label>
|
||||
<label class="tag-list pointer<?php echo $active ? ' active' : ''; ?>"><input type="checkbox" name="cf_<?php echo esc_attr($key); ?>[]" value="<?php echo esc_attr($value_key); ?>" <?php checked($active); ?>><span class="badg mm3"><?php echo esc_html($value_name); ?></span></label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</details>
|
||||
</div></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($settings['allow_tags'])) : ?>
|
||||
<div class="aksrt-submit-field">
|
||||
<div class="aksrt-submit-field__label">
|
||||
<?php esc_html_e('标签', 'aksrt'); ?>
|
||||
<?php if (!empty($ctx['ai_available'])) : ?>
|
||||
<button type="button" class="aksrt-ai-assist-btn" data-ai-action="tags" hidden><?php esc_html_e('AI 建议标签', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<p class="aksrt-submit-hint"><?php esc_html_e('填写文章的标签,每个标签用逗号隔开', 'aksrt'); ?></p>
|
||||
<textarea class="aksrt-form-input" rows="3" name="tags" placeholder="<?php esc_attr_e('输入文章标签', 'aksrt'); ?>"><?php echo esc_textarea((string) $ctx['current_tags']); ?></textarea>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($settings['allow_excerpt'])) : ?>
|
||||
<div class="aksrt-submit-field">
|
||||
<div class="aksrt-submit-field__label">
|
||||
<?php esc_html_e('摘要', 'aksrt'); ?>
|
||||
<?php if (!empty($ctx['ai_available'])) : ?>
|
||||
<button type="button" class="aksrt-ai-assist-btn" data-ai-action="summary" hidden><?php esc_html_e('AI 生成摘要', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<textarea class="aksrt-form-input" rows="3" name="excerpt" maxlength="300" placeholder="<?php esc_attr_e('可选:文章摘要', 'aksrt'); ?>"><?php echo esc_textarea((string) $ctx['current_excerpt']); ?></textarea>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($settings['allow_tags'])) : ?>
|
||||
<div class="title-theme mb10 mt20"><?php esc_html_e('标签', 'aksrt'); ?></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('填写文章的标签,每个标签用逗号隔开', 'aksrt'); ?></p>
|
||||
<textarea class="form-control" rows="3" name="tags" placeholder="<?php esc_attr_e('输入文章标签', 'aksrt'); ?>" tabindex="6"><?php echo esc_textarea((string) $ctx['current_tags']); ?></textarea>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
Reference in new issue
Block a user