feat(users): govern profiles and access
Normalize fixed profile fields, profile actions, and the five-column capability matrix for comments, uploads, and downloads.
This commit is contained in:
1 parent
0b06b2c7df
commit
8241570ca2
67 files changed
+780
-1127
No files matched your search
@@ -213,9 +213,9 @@ return [
|
||||
'can_cover_image' => $cap('new_post_image_cover'),
|
||||
'can_cover_slide' => $cap('new_post_slide_cover'),
|
||||
'can_cover_video' => $cap('new_post_video_cover'),
|
||||
'can_upload_img' => $cap('new_post_upload_img'),
|
||||
'can_upload_img' => $cap('upload_submit_image'),
|
||||
'can_upload_video' => $cap('new_post_upload_video'),
|
||||
'can_upload_file' => $cap('new_post_upload_file'),
|
||||
'can_upload_file' => $cap('upload_resource_attachment'),
|
||||
'can_hide' => $cap('new_post_hide'),
|
||||
'can_iframe' => $cap('new_post_iframe_video'),
|
||||
];
|
||||
@@ -44,14 +44,11 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
<?php
|
||||
$toolbar1 = 'formatselect,bold,italic,bullist,numlist,alignleft,aligncenter,alignright,link,blockquote,code,fullscreen';
|
||||
$plugins = 'paste,link,lists,fullscreen,wordpress,wplink,charmap';
|
||||
if (!empty($ctx['can_upload_img']) || !empty($ctx['can_upload_video']) || !empty($ctx['can_upload_file'])) {
|
||||
// media_buttons handle uploads; keep toolbar clean.
|
||||
}
|
||||
$editor_settings = [
|
||||
'textarea_name' => 'post_content',
|
||||
'textarea_rows' => 20,
|
||||
'editor_height' => wp_is_mobile() ? 460 : 470,
|
||||
'media_buttons' => !empty($ctx['can_upload_img']) || !empty($ctx['can_upload_video']) || !empty($ctx['can_upload_file']),
|
||||
'media_buttons' => false,
|
||||
'default_editor' => 'tinymce',
|
||||
'quicktags' => false,
|
||||
'teeny' => false,
|
||||
@@ -66,8 +63,13 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($ctx['can_hide']) || !empty($ctx['can_pay'])) : ?>
|
||||
<?php if (!empty($ctx['can_hide']) || !empty($ctx['can_pay']) || !empty($ctx['can_upload_img'])) : ?>
|
||||
<div class="aksrt-submit-shortcode-tools">
|
||||
<?php if (!empty($ctx['can_upload_img'])) : ?>
|
||||
<button type="button" class="but" data-insert-upload-image>
|
||||
<i class="fas fa-image"></i> <?php esc_html_e('上传图片', 'aksrt'); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($ctx['can_hide'])) : ?>
|
||||
<button type="button" class="but" data-insert-shortcode="hide" title="<?php esc_attr_e('插入登录后可见', 'aksrt'); ?>">
|
||||
<i class="fas fa-eye-slash"></i> <?php esc_html_e('登录可见', 'aksrt'); ?>
|
||||
|
||||
@@ -117,9 +117,16 @@ $downloads = is_array($pay['downloads'] ?? null) ? $pay['downloads'] : [];
|
||||
<div class="aksrt-submit-pay-downloads" data-pay-downloads>
|
||||
<div class="aksrt-submit-pay__row">
|
||||
<strong><?php esc_html_e('付费下载', 'aksrt'); ?></strong>
|
||||
<button type="button" class="but hollow c-blue" data-pay-download-add>
|
||||
<i class="fas fa-plus"></i> <?php esc_html_e('添加资源', 'aksrt'); ?>
|
||||
</button>
|
||||
<span>
|
||||
<button type="button" class="but hollow c-blue" data-pay-download-add>
|
||||
<i class="fas fa-plus"></i> <?php esc_html_e('添加资源', 'aksrt'); ?>
|
||||
</button>
|
||||
<?php if (!empty($ctx['can_upload_file'])) : ?>
|
||||
<button type="button" class="but hollow" data-pay-download-upload>
|
||||
<i class="fas fa-upload"></i> <?php esc_html_e('上传附件', 'aksrt'); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="aksrt-submit-pay-downloads__list" data-pay-download-list>
|
||||
<?php foreach ($downloads as $i => $row) :
|
||||
@@ -128,8 +135,8 @@ $downloads = is_array($pay['downloads'] ?? null) ? $pay['downloads'] : [];
|
||||
$code = (string) ($row['extract_code'] ?? '');
|
||||
?>
|
||||
<div class="aksrt-submit-pay-downloads__item" data-pay-download-item>
|
||||
<input type="url" class="aksrt-form-input" name="aksrt_pay[downloads][<?php echo (int) $i; ?>][url]" value="<?php echo esc_attr($url); ?>" placeholder="<?php esc_attr_e('资源链接', 'aksrt'); ?>">
|
||||
<input type="text" class="aksrt-form-input" name="aksrt_pay[downloads][<?php echo (int) $i; ?>][label]" value="<?php echo esc_attr($label); ?>" placeholder="<?php esc_attr_e('名称', 'aksrt'); ?>">
|
||||
<input type="url" class="aksrt-form-input" data-pay-download-url name="aksrt_pay[downloads][<?php echo (int) $i; ?>][url]" value="<?php echo esc_attr($url); ?>" placeholder="<?php esc_attr_e('资源链接', 'aksrt'); ?>">
|
||||
<input type="text" class="aksrt-form-input" data-pay-download-label name="aksrt_pay[downloads][<?php echo (int) $i; ?>][label]" value="<?php echo esc_attr($label); ?>" placeholder="<?php esc_attr_e('名称', 'aksrt'); ?>">
|
||||
<input type="text" class="aksrt-form-input" name="aksrt_pay[downloads][<?php echo (int) $i; ?>][extract_code]" value="<?php echo esc_attr($code); ?>" placeholder="<?php esc_attr_e('提取码/备注', 'aksrt'); ?>">
|
||||
<button type="button" class="but c-red cir" data-pay-download-remove title="<?php esc_attr_e('删除', 'aksrt'); ?>"><i class="fas fa-trash"></i></button>
|
||||
</div>
|
||||
@@ -137,8 +144,8 @@ $downloads = is_array($pay['downloads'] ?? null) ? $pay['downloads'] : [];
|
||||
</div>
|
||||
<template data-pay-download-tpl>
|
||||
<div class="aksrt-submit-pay-downloads__item" data-pay-download-item>
|
||||
<input type="url" class="aksrt-form-input" data-name="url" placeholder="<?php esc_attr_e('资源链接', 'aksrt'); ?>">
|
||||
<input type="text" class="aksrt-form-input" data-name="label" placeholder="<?php esc_attr_e('名称', 'aksrt'); ?>">
|
||||
<input type="url" class="aksrt-form-input" data-name="url" data-pay-download-url placeholder="<?php esc_attr_e('资源链接', 'aksrt'); ?>">
|
||||
<input type="text" class="aksrt-form-input" data-name="label" data-pay-download-label placeholder="<?php esc_attr_e('名称', 'aksrt'); ?>">
|
||||
<input type="text" class="aksrt-form-input" data-name="extract_code" placeholder="<?php esc_attr_e('提取码/备注', 'aksrt'); ?>">
|
||||
<button type="button" class="but c-red cir" data-pay-download-remove title="<?php esc_attr_e('删除', 'aksrt'); ?>"><i class="fas fa-trash"></i></button>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user