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

  1. <?php 
  2.  
  3. /** 
  4. * New/Edit Forum 
  5. * 
  6. * @package bbPress 
  7. * @subpackage Theme 
  8. */ 
  9.  
  10. ?> 
  11.  
  12. <?php if ( bbp_is_forum_edit() ) : ?> 
  13.  
  14. <div id="bbpress-forums"> 
  15.  
  16. <?php bbp_breadcrumb(); ?> 
  17.  
  18. <?php bbp_single_forum_description( array( 'forum_id' => bbp_get_forum_id() ) ); ?> 
  19.  
  20. <?php endif; ?> 
  21.  
  22. <?php if ( bbp_current_user_can_access_create_forum_form() ) : ?> 
  23.  
  24. <div id="new-forum-<?php bbp_forum_id(); ?>" class="bbp-forum-form"> 
  25.  
  26. <form id="new-post" name="new-post" method="post" action="<?php the_permalink(); ?>"> 
  27.  
  28. <?php do_action( 'bbp_theme_before_forum_form' ); ?> 
  29.  
  30. <fieldset class="bbp-form"> 
  31. <legend> 
  32.  
  33. <?php 
  34. if ( bbp_is_forum_edit() ) 
  35. printf( __( 'Now Editing “%s”', 'bbpress' ), bbp_get_forum_title() ); 
  36. else 
  37. bbp_is_single_forum() ? printf( __( 'Create New Forum in “%s”', 'bbpress' ), bbp_get_forum_title() ) : _e( 'Create New Forum', 'bbpress' ); 
  38. ?> 
  39.  
  40. </legend> 
  41.  
  42. <?php do_action( 'bbp_theme_before_forum_form_notices' ); ?> 
  43.  
  44. <?php if ( !bbp_is_forum_edit() && bbp_is_forum_closed() ) : ?> 
  45.  
  46. <div class="bbp-template-notice"> 
  47. <p><?php _e( 'This forum is closed to new content, however your account still allows you to do so.', 'bbpress' ); ?></p> 
  48. </div> 
  49.  
  50. <?php endif; ?> 
  51.  
  52. <?php if ( current_user_can( 'unfiltered_html' ) ) : ?> 
  53.  
  54. <div class="bbp-template-notice"> 
  55. <p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p> 
  56. </div> 
  57.  
  58. <?php endif; ?> 
  59.  
  60. <?php do_action( 'bbp_template_notices' ); ?> 
  61.  
  62. <div> 
  63.  
  64. <?php do_action( 'bbp_theme_before_forum_form_title' ); ?> 
  65.  
  66. <p> 
  67. <label for="bbp_forum_title"><?php printf( __( 'Forum Name (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br /> 
  68. <input type="text" id="bbp_forum_title" value="<?php bbp_form_forum_title(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_forum_title" maxlength="<?php bbp_title_max_length(); ?>" /> 
  69. </p> 
  70.  
  71. <?php do_action( 'bbp_theme_after_forum_form_title' ); ?> 
  72.  
  73. <?php do_action( 'bbp_theme_before_forum_form_content' ); ?> 
  74.  
  75. <?php bbp_the_content( array( 'context' => 'forum' ) ); ?> 
  76.  
  77. <?php do_action( 'bbp_theme_after_forum_form_content' ); ?> 
  78.  
  79. <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?> 
  80.  
  81. <p class="form-allowed-tags"> 
  82. <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br /> 
  83. <code><?php bbp_allowed_tags(); ?></code> 
  84. </p> 
  85.  
  86. <?php endif; ?> 
  87.  
  88. <?php do_action( 'bbp_theme_before_forum_form_type' ); ?> 
  89.  
  90. <p> 
  91. <label for="bbp_forum_type"><?php _e( 'Forum Type:', 'bbpress' ); ?></label><br /> 
  92. <?php bbp_form_forum_type_dropdown(); ?> 
  93. </p> 
  94.  
  95. <?php do_action( 'bbp_theme_after_forum_form_type' ); ?> 
  96.  
  97. <?php do_action( 'bbp_theme_before_forum_form_status' ); ?> 
  98.  
  99. <p> 
  100. <label for="bbp_forum_status"><?php _e( 'Status:', 'bbpress' ); ?></label><br /> 
  101. <?php bbp_form_forum_status_dropdown(); ?> 
  102. </p> 
  103.  
  104. <?php do_action( 'bbp_theme_after_forum_form_status' ); ?> 
  105.  
  106. <?php do_action( 'bbp_theme_before_forum_form_status' ); ?> 
  107.  
  108. <p> 
  109. <label for="bbp_forum_visibility"><?php _e( 'Visibility:', 'bbpress' ); ?></label><br /> 
  110. <?php bbp_form_forum_visibility_dropdown(); ?> 
  111. </p> 
  112.  
  113. <?php do_action( 'bbp_theme_after_forum_visibility_status' ); ?> 
  114.  
  115. <?php do_action( 'bbp_theme_before_forum_form_parent' ); ?> 
  116.  
  117. <p> 
  118. <label for="bbp_forum_parent_id"><?php _e( 'Parent Forum:', 'bbpress' ); ?></label><br /> 
  119.  
  120. <?php 
  121. bbp_dropdown( array( 
  122. 'select_id' => 'bbp_forum_parent_id',  
  123. 'show_none' => __( '(No Parent)', 'bbpress' ),  
  124. 'selected' => bbp_get_form_forum_parent(),  
  125. 'exclude' => bbp_get_forum_id() 
  126. ) ); 
  127. ?> 
  128. </p> 
  129.  
  130. <?php do_action( 'bbp_theme_after_forum_form_parent' ); ?> 
  131.  
  132. <?php do_action( 'bbp_theme_before_forum_form_submit_wrapper' ); ?> 
  133.  
  134. <div class="bbp-submit-wrapper"> 
  135.  
  136. <?php do_action( 'bbp_theme_before_forum_form_submit_button' ); ?> 
  137.  
  138. <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_forum_submit" name="bbp_forum_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button> 
  139.  
  140. <?php do_action( 'bbp_theme_after_forum_form_submit_button' ); ?> 
  141.  
  142. </div> 
  143.  
  144. <?php do_action( 'bbp_theme_after_forum_form_submit_wrapper' ); ?> 
  145.  
  146. </div> 
  147.  
  148. <?php bbp_forum_form_fields(); ?> 
  149.  
  150. </fieldset> 
  151.  
  152. <?php do_action( 'bbp_theme_after_forum_form' ); ?> 
  153.  
  154. </form> 
  155. </div> 
  156.  
  157. <?php elseif ( bbp_is_forum_closed() ) : ?> 
  158.  
  159. <div id="no-forum-<?php bbp_forum_id(); ?>" class="bbp-no-forum"> 
  160. <div class="bbp-template-notice"> 
  161. <p><?php printf( __( 'The forum ‘%s’ is closed to new content.', 'bbpress' ), bbp_get_forum_title() ); ?></p> 
  162. </div> 
  163. </div> 
  164.  
  165. <?php else : ?> 
  166.  
  167. <div id="no-forum-<?php bbp_forum_id(); ?>" class="bbp-no-forum"> 
  168. <div class="bbp-template-notice"> 
  169. <p><?php is_user_logged_in() ? _e( 'You cannot create new forums.', 'bbpress' ) : _e( 'You must be logged in to create new forums.', 'bbpress' ); ?></p> 
  170. </div> 
  171. </div> 
  172.  
  173. <?php endif; ?> 
  174.  
  175. <?php if ( bbp_is_forum_edit() ) : ?> 
  176.  
  177. </div> 
  178.  
  179. <?php endif; ?> 
.