/wp-content/themes/Avada/bbpress/form-reply.php

https://gitlab.com/woxiprogrammers/infinia-wordpress · PHP · 170 lines · 95 code · 68 blank · 7 comment · 18 complexity · 05c97436079ddce6c4675cee401bdb0f MD5 · raw file

  1. <?php
  2. /**
  3. * New/Edit Reply
  4. *
  5. * @package bbPress
  6. * @subpackage Theme
  7. */
  8. ?>
  9. <?php if ( bbp_is_reply_edit() ) : ?>
  10. <div id="bbpress-forums">
  11. <?php endif; ?>
  12. <?php if ( bbp_current_user_can_access_create_reply_form() ) : ?>
  13. <div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form">
  14. <form id="new-post" name="new-post" method="post" action="<?php the_permalink(); ?>">
  15. <?php do_action( 'bbp_theme_before_reply_form' ); ?>
  16. <fieldset class="bbp-form">
  17. <legend><?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
  18. <?php do_action( 'bbp_theme_before_reply_form_notices' ); ?>
  19. <div>
  20. <?php bbp_get_template_part( 'form', 'anonymous' ); ?>
  21. <?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
  22. <?php bbp_the_content( array( 'context' => 'reply' ) ); ?>
  23. <?php do_action( 'bbp_theme_after_reply_form_content' ); ?>
  24. <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
  25. <p class="form-allowed-tags">
  26. <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
  27. <code><?php bbp_allowed_tags(); ?></code>
  28. </p>
  29. <?php endif; ?>
  30. <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags' ) ) : ?>
  31. <?php do_action( 'bbp_theme_before_reply_form_tags' ); ?>
  32. <p>
  33. <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br />
  34. <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() ); ?> />
  35. </p>
  36. <?php do_action( 'bbp_theme_after_reply_form_tags' ); ?>
  37. <?php endif; ?>
  38. <?php if ( bbp_allow_revisions() && bbp_is_reply_edit() ) : ?>
  39. <?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?>
  40. <fieldset class="bbp-form">
  41. <legend>
  42. <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(); ?>" />
  43. <label for="bbp_log_reply_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
  44. </legend>
  45. <div>
  46. <label for="bbp_reply_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
  47. <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" />
  48. </div>
  49. </fieldset>
  50. <?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?>
  51. <?php endif; ?>
  52. <?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?>
  53. <div class="bbp-submit-wrapper">
  54. <?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?>
  55. <?php bbp_cancel_reply_to_link(); ?>
  56. <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit" class="fusion-button button-default button-small submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
  57. <?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?>
  58. </div>
  59. <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?>
  60. <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?>
  61. <div class="notify">
  62. <p>
  63. <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
  64. <?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?>
  65. <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
  66. <?php else : ?>
  67. <label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
  68. <?php endif; ?>
  69. </p>
  70. </div>
  71. <?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?>
  72. <?php endif; ?>
  73. <?php do_action( 'bbp_theme_after_reply_form_submit_wrapper' ); ?>
  74. </div>
  75. <?php bbp_reply_form_fields(); ?>
  76. </fieldset>
  77. <?php do_action( 'bbp_theme_after_reply_form' ); ?>
  78. </form>
  79. </div>
  80. <?php elseif ( bbp_is_topic_closed() ) : ?>
  81. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
  82. <div class="bbp-template-notice">
  83. <p><?php printf( __( 'The topic &#8216;%s&#8217; is closed to new replies.', 'bbpress' ), bbp_get_topic_title() ); ?></p>
  84. </div>
  85. </div>
  86. <?php elseif ( bbp_is_forum_closed( bbp_get_topic_forum_id() ) ) : ?>
  87. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
  88. <div class="bbp-template-notice">
  89. <p><?php printf( __( 'The forum &#8216;%s&#8217; is closed to new topics and replies.', 'bbpress' ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></p>
  90. </div>
  91. </div>
  92. <?php else : ?>
  93. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
  94. <div class="bbp-template-notice">
  95. <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>
  96. </div>
  97. </div>
  98. <?php endif; ?>
  99. <?php if ( bbp_is_reply_edit() ) : ?>
  100. </div>
  101. <?php endif;
  102. // Omit closing PHP tag to avoid "Headers already sent" issues.