/skeleton/bbpress/form-reply.php

https://github.com/billortell/skeleton_wp · PHP · 147 lines · 92 code · 49 blank · 6 comment · 18 complexity · a2b726c23fdf651481d4508b9df2a6be 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. <?php bbp_breadcrumb(); ?>
  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="">
  15. <fieldset class="bbp-form">
  16. <legend><?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
  17. <?php if ( !bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?>
  18. <div class="bbp-template-notice">
  19. <p><?php _e( 'This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.', 'bbpress' ); ?></p>
  20. </div>
  21. <?php endif; ?>
  22. <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
  23. <div class="bbp-template-notice">
  24. <p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
  25. </div>
  26. <?php endif; ?>
  27. <?php do_action( 'bbp_template_notices' ); ?>
  28. <div>
  29. <div class="author-avatar">
  30. <?php bbp_is_reply_edit() ? bbp_reply_author_avatar( bbp_get_reply_id(), 64 ) : bbp_current_user_avatar( 64 ); ?>
  31. </div>
  32. <?php bbp_get_template_part( 'bbpress/form', 'anonymous' ); ?>
  33. <p>
  34. <label for="bbp_reply_content"><?php _e( 'Reply:', 'bbpress' ); ?></label><br />
  35. <textarea id="bbp_reply_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_reply_content" cols="51" rows="6"><?php bbp_form_reply_content(); ?></textarea>
  36. </p>
  37. <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
  38. <p class="form-allowed-tags">
  39. <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
  40. <code><?php bbp_allowed_tags(); ?></code>
  41. </p>
  42. <?php endif; ?>
  43. <p>
  44. <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br />
  45. <input id="bbp_topic_tags" type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" />
  46. </p>
  47. <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?>
  48. <p>
  49. <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
  50. <?php if ( bbp_is_reply_edit() && $post->post_author != bbp_get_current_user_id() ) : ?>
  51. <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
  52. <?php else : ?>
  53. <label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
  54. <?php endif; ?>
  55. </p>
  56. <?php endif; ?>
  57. <?php if ( bbp_is_reply_edit() ) : ?>
  58. <fieldset class="bbp-form">
  59. <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
  60. <div>
  61. <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(); ?>" />
  62. <label for="bbp_log_reply_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
  63. </div>
  64. <div>
  65. <label for="bbp_reply_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
  66. <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" />
  67. </div>
  68. </fieldset>
  69. <?php else : ?>
  70. <?php bbp_topic_admin_links(); ?>
  71. <?php endif; ?>
  72. <div class="bbp-submit-wrapper">
  73. <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
  74. </div>
  75. </div>
  76. <?php bbp_reply_form_fields(); ?>
  77. </fieldset>
  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; ?>