| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* New/Edit Reply |
| 5 |
* |
| 6 |
* @package bbPress |
| 7 |
* @subpackage Theme |
| 8 |
*/ |
| 9 |
|
| 10 |
// Exit if accessed directly |
| 11 |
defined( 'ABSPATH' ) || exit; |
| 12 |
|
| 13 |
if ( bbp_is_reply_edit() ) : ?> |
| 14 |
|
| 15 |
<div id="bbpress-forums" class="bbpress-wrapper"> |
| 16 |
|
| 17 |
<?php endif; ?> |
| 18 |
|
| 19 |
<?php if ( bbp_current_user_can_access_create_reply_form() ) : ?> |
| 20 |
|
| 21 |
<div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form"> |
| 22 |
|
| 23 |
<form id="new-post" name="new-post" method="post"> |
| 24 |
|
| 25 |
<?php do_action( 'bbp_theme_before_reply_form' ); ?> |
| 26 |
|
| 27 |
<fieldset class="bbp-form"> |
| 28 |
<legend><?php printf( esc_html__( 'Reply To: %s', 'forumax' ), ( bbp_get_form_reply_to() ) ? sprintf( esc_html__( 'Reply #%1$s in %2$s', 'forumax' ), bbp_get_form_reply_to(), bbp_get_topic_title() ) : bbp_get_topic_title() ); ?></legend> |
| 29 |
|
| 30 |
<?php do_action( 'bbp_theme_before_reply_form_notices' ); ?> |
| 31 |
|
| 32 |
<?php if ( ! bbp_is_topic_open() && ! bbp_is_reply_edit() ) : ?> |
| 33 |
|
| 34 |
<div class="bbp-template-notice"> |
| 35 |
<ul> |
| 36 |
<li><?php esc_html_e( 'This topic is marked as closed to new replies, however your posting capabilities still allow you to reply.', 'forumax' ); ?></li> |
| 37 |
</ul> |
| 38 |
</div> |
| 39 |
|
| 40 |
<?php endif; ?> |
| 41 |
|
| 42 |
<?php if ( ! bbp_is_reply_edit() && bbp_is_forum_closed() ) : ?> |
| 43 |
|
| 44 |
<div class="bbp-template-notice"> |
| 45 |
<ul> |
| 46 |
<li><?php esc_html_e( 'This forum is closed to new content, however your posting capabilities still allow you to post.', 'forumax' ); ?></li> |
| 47 |
</ul> |
| 48 |
</div> |
| 49 |
|
| 50 |
<?php endif; ?> |
| 51 |
|
| 52 |
<?php if ( current_user_can( 'unfiltered_html' ) ) : ?> |
| 53 |
|
| 54 |
<div class="bbp-template-notice"> |
| 55 |
<ul> |
| 56 |
<li><?php esc_html_e( 'Your account has the ability to post unrestricted HTML content.', 'forumax' ); ?></li> |
| 57 |
</ul> |
| 58 |
</div> |
| 59 |
|
| 60 |
<?php endif; ?> |
| 61 |
|
| 62 |
<?php do_action( 'bbp_template_notices' ); ?> |
| 63 |
|
| 64 |
<div> |
| 65 |
|
| 66 |
<?php bbp_get_template_part( 'form', 'anonymous' ); ?> |
| 67 |
|
| 68 |
<?php do_action( 'bbp_theme_before_reply_form_content' ); ?> |
| 69 |
|
| 70 |
<?php bbp_the_content( array( 'context' => 'reply' ) ); ?> |
| 71 |
|
| 72 |
<?php do_action( 'bbp_theme_after_reply_form_content' ); ?> |
| 73 |
|
| 74 |
<?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?> |
| 75 |
|
| 76 |
<p class="form-allowed-tags"> |
| 77 |
<label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','forumax' ); ?></label><br /> |
| 78 |
<code><?php bbp_allowed_tags(); ?></code> |
| 79 |
</p> |
| 80 |
|
| 81 |
<?php endif; ?> |
| 82 |
|
| 83 |
<?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) ) : ?> |
| 84 |
|
| 85 |
<?php do_action( 'bbp_theme_before_reply_form_tags' ); ?> |
| 86 |
|
| 87 |
<p> |
| 88 |
<label for="bbp_topic_tags"><?php esc_html_e( 'Tags:', 'forumax' ); ?></label><br /> |
| 89 |
<input type="text" value="<?php bbp_form_topic_tags(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> /> |
| 90 |
</p> |
| 91 |
|
| 92 |
<?php do_action( 'bbp_theme_after_reply_form_tags' ); ?> |
| 93 |
|
| 94 |
<?php endif; ?> |
| 95 |
|
| 96 |
<?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( ! bbp_is_reply_edit() || ( bbp_is_reply_edit() && ! bbp_is_reply_anonymous() ) ) ) : ?> |
| 97 |
|
| 98 |
<?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?> |
| 99 |
|
| 100 |
<p> |
| 101 |
|
| 102 |
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> /> |
| 103 |
|
| 104 |
<?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?> |
| 105 |
|
| 106 |
<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email', 'forumax' ); ?></label> |
| 107 |
|
| 108 |
<?php else : ?> |
| 109 |
|
| 110 |
<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'forumax' ); ?></label> |
| 111 |
|
| 112 |
<?php endif; ?> |
| 113 |
|
| 114 |
</p> |
| 115 |
|
| 116 |
<?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?> |
| 117 |
|
| 118 |
<?php endif; ?> |
| 119 |
|
| 120 |
<?php if ( bbp_is_reply_edit() ) : ?> |
| 121 |
|
| 122 |
<?php if ( current_user_can( 'moderate', bbp_get_reply_id() ) ) : ?> |
| 123 |
|
| 124 |
<?php do_action( 'bbp_theme_before_reply_form_reply_to' ); ?> |
| 125 |
|
| 126 |
<p class="form-reply-to"> |
| 127 |
<label for="bbp_reply_to"><?php esc_html_e( 'Reply To:', 'forumax' ); ?></label><br /> |
| 128 |
<?php bbp_reply_to_dropdown(); ?> |
| 129 |
</p> |
| 130 |
|
| 131 |
<?php do_action( 'bbp_theme_after_reply_form_reply_to' ); ?> |
| 132 |
|
| 133 |
<?php do_action( 'bbp_theme_before_reply_form_status' ); ?> |
| 134 |
|
| 135 |
<p> |
| 136 |
<label for="bbp_reply_status"><?php esc_html_e( 'Reply Status:', 'forumax' ); ?></label><br /> |
| 137 |
<?php bbp_form_reply_status_dropdown(); ?> |
| 138 |
</p> |
| 139 |
|
| 140 |
<?php do_action( 'bbp_theme_after_reply_form_status' ); ?> |
| 141 |
|
| 142 |
<?php endif; ?> |
| 143 |
|
| 144 |
<?php if ( bbp_allow_revisions() ) : ?> |
| 145 |
|
| 146 |
<?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?> |
| 147 |
|
| 148 |
<fieldset class="bbp-form"> |
| 149 |
<legend> |
| 150 |
<input name="bbp_log_reply_edit" id="bbp_log_reply_edit" type="checkbox" value="1" <?php bbp_form_reply_log_edit(); ?> /> |
| 151 |
<label for="bbp_log_reply_edit"><?php esc_html_e( 'Keep a log of this edit:', 'forumax' ); ?></label><br /> |
| 152 |
</legend> |
| 153 |
|
| 154 |
<div> |
| 155 |
<label for="bbp_reply_edit_reason"><?php printf( esc_html__( 'Optional reason for editing:', 'forumax' ), bbp_get_current_user_name() ); ?></label><br /> |
| 156 |
<input type="text" value="<?php bbp_form_reply_edit_reason(); ?>" size="40" name="bbp_reply_edit_reason" id="bbp_reply_edit_reason" /> |
| 157 |
</div> |
| 158 |
</fieldset> |
| 159 |
|
| 160 |
<?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?> |
| 161 |
|
| 162 |
<?php endif; ?> |
| 163 |
|
| 164 |
<?php endif; ?> |
| 165 |
|
| 166 |
<?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?> |
| 167 |
|
| 168 |
<div class="bbp-submit-wrapper"> |
| 169 |
|
| 170 |
<?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?> |
| 171 |
|
| 172 |
<?php bbp_cancel_reply_to_link(); ?> |
| 173 |
|
| 174 |
<button type="submit" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit fill-brand"><?php esc_html_e( 'Submit', 'forumax' ); ?></button> |
| 175 |
|
| 176 |
<?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?> |
| 177 |
|
| 178 |
</div> |
| 179 |
|
| 180 |
<?php do_action( 'bbp_theme_after_reply_form_submit_wrapper' ); ?> |
| 181 |
|
| 182 |
</div> |
| 183 |
|
| 184 |
<?php bbp_reply_form_fields(); ?> |
| 185 |
|
| 186 |
</fieldset> |
| 187 |
|
| 188 |
<?php do_action( 'bbp_theme_after_reply_form' ); ?> |
| 189 |
|
| 190 |
</form> |
| 191 |
</div> |
| 192 |
|
| 193 |
<?php elseif ( bbp_is_topic_closed() ) : ?> |
| 194 |
|
| 195 |
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> |
| 196 |
<div class="bbp-template-notice"> |
| 197 |
<ul> |
| 198 |
<li><?php printf( esc_html__( 'The topic ‘%s’ is closed to new replies.', 'forumax' ), bbp_get_topic_title() ); ?></li> |
| 199 |
</ul> |
| 200 |
</div> |
| 201 |
</div> |
| 202 |
|
| 203 |
<?php elseif ( bbp_is_forum_closed( bbp_get_topic_forum_id() ) ) : ?> |
| 204 |
|
| 205 |
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> |
| 206 |
<div class="bbp-template-notice"> |
| 207 |
<ul> |
| 208 |
<li><?php printf( esc_html__( 'The forum ‘%s’ is closed to new topics and replies.', 'forumax' ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></li> |
| 209 |
</ul> |
| 210 |
</div> |
| 211 |
</div> |
| 212 |
|
| 213 |
<?php else : ?> |
| 214 |
|
| 215 |
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> |
| 216 |
<div class="bbp-template-notice"> |
| 217 |
<ul> |
| 218 |
<li><?php is_user_logged_in() |
| 219 |
? esc_html_e( 'You cannot reply to this topic.', 'forumax' ) |
| 220 |
: esc_html_e( 'You must be logged in to reply to this topic.', 'forumax' ); |
| 221 |
?></li> |
| 222 |
</ul> |
| 223 |
</div> |
| 224 |
|
| 225 |
<?php if ( ! is_user_logged_in() ) : ?> |
| 226 |
|
| 227 |
<?php |
| 228 |
if ( forumax_get_opt('topic_login_shortcode') ) { |
| 229 |
echo do_shortcode(forumax_get_opt('topic_login_shortcode')); |
| 230 |
} else { |
| 231 |
bbp_get_template_part('form', 'user-login'); |
| 232 |
} |
| 233 |
?> |
| 234 |
|
| 235 |
<?php endif; ?> |
| 236 |
|
| 237 |
</div> |
| 238 |
|
| 239 |
<?php endif; ?> |
| 240 |
|
| 241 |
<?php if ( bbp_is_reply_edit() ) : ?> |
| 242 |
|
| 243 |
</div> |
| 244 |
|
| 245 |
<?php endif; |
| 246 |
|