PageRenderTime 53ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/skeleton/bbpress/form-reply.php

https://github.com/gellybeans/skeleton_wp
PHP | 178 lines | 104 code | 68 blank | 6 comment | 19 complexity | edf0b0cab4ebc185d084495c80012a82 MD5 | raw file
Possible License(s): AGPL-1.0
  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. <?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. <?php if ( !bbp_is_topic_open() && !bbp_is_reply_edit() ) : ?>
  20. <div class="bbp-template-notice">
  21. <p><?php _e( 'This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.', 'bbpress' ); ?></p>
  22. </div>
  23. <?php endif; ?>
  24. <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
  25. <div class="bbp-template-notice">
  26. <p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
  27. </div>
  28. <?php endif; ?>
  29. <?php do_action( 'bbp_template_notices' ); ?>
  30. <div>
  31. <?php bbp_get_template_part( 'bbpress/form', 'anonymous' ); ?>
  32. <?php do_action( 'bbp_theme_before_reply_form_content' ); ?>
  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" rows="6"><?php bbp_form_reply_content(); ?></textarea>
  36. </p>
  37. <?php do_action( 'bbp_theme_after_reply_form_content' ); ?>
  38. <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
  39. <p class="form-allowed-tags">
  40. <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
  41. <code><?php bbp_allowed_tags(); ?></code>
  42. </p>
  43. <?php endif; ?>
  44. <?php do_action( 'bbp_theme_before_reply_form_tags' ); ?>
  45. <p>
  46. <label for="bbp_topic_tags"><?php _e( 'Tags:', 'bbpress' ); ?></label><br />
  47. <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() ); ?> />
  48. </p>
  49. <?php do_action( 'bbp_theme_after_reply_form_tags' ); ?>
  50. <?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_reply_edit() || ( bbp_is_reply_edit() && !bbp_is_reply_anonymous() ) ) ) : ?>
  51. <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?>
  52. <p>
  53. <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
  54. <?php if ( bbp_is_reply_edit() && $post->post_author != bbp_get_current_user_id() ) : ?>
  55. <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
  56. <?php else : ?>
  57. <label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
  58. <?php endif; ?>
  59. </p>
  60. <?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?>
  61. <?php endif; ?>
  62. <?php if ( bbp_allow_revisions() && bbp_is_reply_edit() ) : ?>
  63. <?php do_action( 'bbp_theme_before_reply_form_revisions' ); ?>
  64. <fieldset class="bbp-form">
  65. <legend><?php _e( 'Revision', 'bbpress' ); ?></legend>
  66. <div>
  67. <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(); ?>" />
  68. <label for="bbp_log_reply_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
  69. </div>
  70. <div>
  71. <label for="bbp_reply_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
  72. <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" />
  73. </div>
  74. </fieldset>
  75. <?php do_action( 'bbp_theme_after_reply_form_revisions' ); ?>
  76. <?php else : ?>
  77. <?php bbp_topic_admin_links(); ?>
  78. <?php endif; ?>
  79. <?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?>
  80. <div class="bbp-submit-wrapper">
  81. <?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?>
  82. <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
  83. <?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?>
  84. </div>
  85. <?php do_action( 'bbp_theme_after_reply_form_submit_wrapper' ); ?>
  86. </div>
  87. <?php bbp_reply_form_fields(); ?>
  88. </fieldset>
  89. <?php do_action( 'bbp_theme_after_reply_form' ); ?>
  90. </form>
  91. </div>
  92. <?php elseif ( bbp_is_topic_closed() ) : ?>
  93. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
  94. <div class="bbp-template-notice">
  95. <p><?php printf( __( 'The topic &#8216;%s&#8217; is closed to new replies.', 'bbpress' ), bbp_get_topic_title() ); ?></p>
  96. </div>
  97. </div>
  98. <?php elseif ( bbp_is_forum_closed( bbp_get_topic_forum_id() ) ) : ?>
  99. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
  100. <div class="bbp-template-notice">
  101. <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>
  102. </div>
  103. </div>
  104. <?php else : ?>
  105. <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
  106. <div class="bbp-template-notice">
  107. <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>
  108. </div>
  109. </div>
  110. <?php endif; ?>