- Rewrite post_list/submit schema (PHP + JS) with the reference theme's field set, order, defaults and dependencies; topics fields excluded - Map PostDisplay::get_submit_settings() and the FrontSubmit runtime to the new keys without legacy fallback - Guest submission follows the capability matrix; category required on submit; pay limits read from the cash/points fieldset - Drop dead front_submit_* settings, template branches and JS config - Add submit settings reference contract test
78 lines
3.9 KiB
PHP
78 lines
3.9 KiB
PHP
<?php
|
|
/**
|
|
* Reference-theme article parameters sidebar.
|
|
*
|
|
* @var array $ctx
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$settings = $ctx['settings'];
|
|
require_once get_template_directory() . '/templates/parts/submit/term-checks.php';
|
|
?>
|
|
|
|
<?php if (!empty($ctx['is_guest'])) : ?>
|
|
<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="zib-widget mb10-sm">
|
|
<div class="title-theme mb10"><?php esc_html_e('文章参数', 'aksrt'); ?></div>
|
|
<div class="term-select-box">
|
|
<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">
|
|
<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>
|
|
</div>
|
|
|
|
<?php if (!empty($settings['custom_filter_s']) && !empty($ctx['custom_dimensions'])) : ?>
|
|
<?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] ?? []);
|
|
?>
|
|
<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">
|
|
<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="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></div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?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>
|