| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* New/Edit Reply |
| 5 |
* |
| 6 |
* @package bbPress |
| 7 |
* @subpackage Theme |
| 8 |
*/ |
| 9 |
|
| 10 |
?> |
| 11 |
|
| 12 |
<?php if ( bbp_is_reply_edit() ) : ?> |
| 13 |
|
| 14 |
<div id="bbpress-forums"> |
| 15 |
|
| 16 |
<?php bbp_breadcrumb(); ?> |
| 17 |
|
| 18 |
<?php endif; ?> |
| 19 |
|
| 20 |
<?php if ( bbp_current_user_can_access_create_reply_form() ) : ?> |
| 21 |
|
| 22 |
<div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form"> |
| 23 |
|
| 24 |
<form id="new-post" name="new-post" method="post" action=""> |
| 25 |
|
| 26 |
<?php do_action( 'bbp_theme_before_reply_form' ); ?> |
| 27 |
|
| 28 |
<fieldset class="bbp-form"> |
| 29 |
<legend><?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?></legend> |
| 30 |
|
| 31 |
<?php do_action( 'bbp_theme_before_reply_form_notices' ); ?> |
| 32 |
|
| 33 |
<?php if ( !bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?> |
| 34 |
|
| 35 |
<div class="bbp-template-notice"> |
| 36 |
<p><?php _e( 'This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.', 'bbpress' ); ?></p> |
| 37 |
</div> |
| 38 |
|
| 39 |
<?php endif; ?> |
| 40 |
|
| 41 |
<?php if ( current_user_can( 'unfiltered_html' ) ) : ?> |
| 42 |
|
| 43 |
<div class="bbp-template-notice"> |
| 44 |
<p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p> |
| 45 |
</div> |
| 46 |
|
| 47 |
<?php endif; ?> |
| 48 |
|
| 49 |
<?php do_action( 'bbp_template_notices' ); ?> |
| 50 |
|
| 51 |
<div> |
| 52 |
|
| 53 |
<?php bbp_get_template_part( 'form', 'anonymous' ); ?> |
| 54 |
|
| 55 |
<?php do_action( 'bbp_theme_before_reply_form_content' ); ?> |
| 56 |
|
| 57 |
<?php if ( !function_exists( 'wp_editor' ) ) : ?> |
| 58 |
|
| 59 |
<p> |
| 60 |
<label for="bbp_reply_content"><?php _e( 'Reply:', 'bbpress' ); ?></label><br /> |
| 61 |
<textarea id="bbp_reply_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_reply_content" rows="6"><?php bbp_form_reply_content(); ?></textarea> |
| 62 |
</p> |
| 63 |
|
| 64 |
<?php else : ?> |
| 65 |
|
| 66 |
<?php bbp_the_content( array( 'context' => 'reply' ) ); ?> |
| 67 |
|
| 68 |
<?php endif; ?> |
| 69 |
|
| 70 |
<?php do_action( 'bbp_theme_after_reply_form_content' ); ?> |
| 71 |
|
| 72 |
<?php if ( !current_user_can( 'unfiltered_html' ) ) : ?> |
| 73 |
|
| 74 |
<p class="form-allowed-tags"> |
| 75 |
<label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br /> |
| 76 |
<code><?php bbp_allowed_tags(); ?></code> |
| 77 |
</p> |
| 78 |
|
| 79 |
<?php endif; ?> |
| 80 |
|
| 81 |
<?php do_action( 'bbp_theme_before_reply_form_tags' ); ?> |
| 82 |
|
| 83 |
<p> |
| 84 |
<label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br /> |
| 85 |
<input type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> /> |
| 86 |
</p> |
| 87 |
|
| 88 |
<?php do_action( 'bbp_theme_after_reply_form_tags' ); ?> |
| 89 |
|
| 90 |
<?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?> |
| 91 |
|
| 92 |
<?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?> |
| 93 |
|
| 94 |
<p> |
| 95 |
|
| 96 |
<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" /> |
| 97 |
|
| 98 |
<?php if ( bbp_is_reply_edit() && ( get_the_author_meta( 'ID' ) != bbp_get_current_user_id() ) ) : ?> |
| 99 |
|
| 100 |
<label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label> |
| 101 |
|
| 102 |
<?php else : ?> |
| 103 |
|
| 104 |
<label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label> |
| 105 |
|
| 106 |
<?php endif; ?> |
| 107 |
|
| 108 |
</p> |
| 109 |
|
| 110 |
<?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?> |
| 111 |
|
| 112 |
<?php endif; ?> |
| 113 |
|
| 114 |
<?php if ( bbp_allow_revisions() && bbp_is_reply_edit() ) : ?> |
| 115 |
|
| 116 |
<?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?> |
| 117 |
|
| 118 |
<fieldset class="bbp-form"> |
| 119 |
<legend><?php _e( 'Revision', 'bbpress' ); ?></legend> |
| 120 |
<div> |
| 121 |
<input name="bbp_log_reply_edit" id="bbp_log_reply_edit" type="checkbox" value="1" <?php bbp_form_reply_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" /> |
| 122 |
<label for="bbp_log_reply_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br /> |
| 123 |
</div> |
| 124 |
|
| 125 |
<div> |
| 126 |
<label for="bbp_reply_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br /> |
| 127 |
<input type="text" value="<?php bbp_form_reply_edit_reason(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_reply_edit_reason" id="bbp_reply_edit_reason" /> |
| 128 |
</div> |
| 129 |
</fieldset> |
| 130 |
|
| 131 |
<?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?> |
| 132 |
|
| 133 |
<?php else : ?> |
| 134 |
|
| 135 |
<?php bbp_topic_admin_links(); ?> |
| 136 |
|
| 137 |
<?php endif; ?> |
| 138 |
|
| 139 |
<?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?> |
| 140 |
|
| 141 |
<div class="bbp-submit-wrapper"> |
| 142 |
|
| 143 |
<?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?> |
| 144 |
|
| 145 |
<button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button> |
| 146 |
|
| 147 |
<?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?> |
| 148 |
|
| 149 |
</div> |
| 150 |
|
| 151 |
<?php do_action( 'bbp_theme_after_reply_form_submit_wrapper' ); ?> |
| 152 |
|
| 153 |
</div> |
| 154 |
|
| 155 |
<?php bbp_reply_form_fields(); ?> |
| 156 |
|
| 157 |
</fieldset> |
| 158 |
|
| 159 |
<?php do_action( 'bbp_theme_after_reply_form' ); ?> |
| 160 |
|
| 161 |
</form> |
| 162 |
</div> |
| 163 |
|
| 164 |
<?php elseif ( bbp_is_topic_closed() ) : ?> |
| 165 |
|
| 166 |
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> |
| 167 |
<div class="bbp-template-notice"> |
| 168 |
<p><?php printf( __( 'The topic ‘%s’ is closed to new replies.', 'bbpress' ), bbp_get_topic_title() ); ?></p> |
| 169 |
</div> |
| 170 |
</div> |
| 171 |
|
| 172 |
<?php elseif ( bbp_is_forum_closed( bbp_get_topic_forum_id() ) ) : ?> |
| 173 |
|
| 174 |
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> |
| 175 |
<div class="bbp-template-notice"> |
| 176 |
<p><?php printf( __( 'The forum ‘%s’ is closed to new topics and replies.', 'bbpress' ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></p> |
| 177 |
</div> |
| 178 |
</div> |
| 179 |
|
| 180 |
<?php else : ?> |
| 181 |
|
| 182 |
<div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> |
| 183 |
<div class="bbp-template-notice"> |
| 184 |
<p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p> |
| 185 |
</div> |
| 186 |
</div> |
| 187 |
|
| 188 |
<?php endif; ?> |
| 189 |
|
| 190 |
<?php if ( bbp_is_reply_edit() ) : ?> |
| 191 |
|
| 192 |
</div> |
| 193 |
|
| 194 |
<?php endif; ?> |
| 195 |
|