/templates/default/bbpress/form-reply.php

  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="<?php the_permalink(); ?>"> 
  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 bbp_the_content( array( 'context' => 'reply' ) ); ?> 
  58.  
  59. <?php do_action( 'bbp_theme_after_reply_form_content' ); ?> 
  60.  
  61. <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?> 
  62.  
  63. <p class="form-allowed-tags"> 
  64. <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br /> 
  65. <code><?php bbp_allowed_tags(); ?></code> 
  66. </p> 
  67.  
  68. <?php endif; ?> 
  69.  
  70. <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags' ) ) : ?> 
  71.  
  72. <?php do_action( 'bbp_theme_before_reply_form_tags' ); ?> 
  73.  
  74. <p> 
  75. <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br /> 
  76. <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() ); ?> /> 
  77. </p> 
  78.  
  79. <?php do_action( 'bbp_theme_after_reply_form_tags' ); ?> 
  80.  
  81. <?php endif; ?> 
  82.  
  83. <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?> 
  84.  
  85. <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?> 
  86.  
  87. <p> 
  88.  
  89. <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" /> 
  90.  
  91. <?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?> 
  92.  
  93. <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label> 
  94.  
  95. <?php else : ?> 
  96.  
  97. <label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label> 
  98.  
  99. <?php endif; ?> 
  100.  
  101. </p> 
  102.  
  103. <?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?> 
  104.  
  105. <?php endif; ?> 
  106.  
  107. <?php if ( bbp_allow_revisions() && bbp_is_reply_edit() ) : ?> 
  108.  
  109. <?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?> 
  110.  
  111. <fieldset class="bbp-form"> 
  112. <legend> 
  113. <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(); ?>" /> 
  114. <label for="bbp_log_reply_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br /> 
  115. </legend> 
  116.  
  117. <div> 
  118. <label for="bbp_reply_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br /> 
  119. <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" /> 
  120. </div> 
  121. </fieldset> 
  122.  
  123. <?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?> 
  124.  
  125. <?php endif; ?> 
  126.  
  127. <?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?> 
  128.  
  129. <div class="bbp-submit-wrapper"> 
  130.  
  131. <?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?> 
  132.  
  133. <?php bbp_cancel_reply_to_link(); ?> 
  134.  
  135. <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button> 
  136.  
  137. <?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?> 
  138.  
  139. </div> 
  140.  
  141. <?php do_action( 'bbp_theme_after_reply_form_submit_wrapper' ); ?> 
  142.  
  143. </div> 
  144.  
  145. <?php bbp_reply_form_fields(); ?> 
  146.  
  147. </fieldset> 
  148.  
  149. <?php do_action( 'bbp_theme_after_reply_form' ); ?> 
  150.  
  151. </form> 
  152. </div> 
  153.  
  154. <?php elseif ( bbp_is_topic_closed() ) : ?> 
  155.  
  156. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> 
  157. <div class="bbp-template-notice"> 
  158. <p><?php printf( __( 'The topic ‘%s’ is closed to new replies.', 'bbpress' ), bbp_get_topic_title() ); ?></p> 
  159. </div> 
  160. </div> 
  161.  
  162. <?php elseif ( bbp_is_forum_closed( bbp_get_topic_forum_id() ) ) : ?> 
  163.  
  164. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> 
  165. <div class="bbp-template-notice"> 
  166. <p><?php printf( __( 'The forum ‘%s’ is closed to new topics and replies.', 'bbpress' ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></p> 
  167. </div> 
  168. </div> 
  169.  
  170. <?php else : ?> 
  171.  
  172. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> 
  173. <div class="bbp-template-notice"> 
  174. <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> 
  175. </div> 
  176. </div> 
  177.  
  178. <?php endif; ?> 
  179.  
  180. <?php if ( bbp_is_reply_edit() ) : ?> 
  181.  
  182. </div> 
  183.  
  184. <?php endif; ?> 
.