[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/templates/default/bbpress/ -> form-forum.php (source)

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


Generated: Tue Jan 28 01:01:30 2020 Cross-referenced by PHPXref 0.7.1