Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/28/2011 07:37:22 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Audit the bbp-twentyten theme's actions, HTML, and CSS. See #1702.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/form-forum.php

    r3586 r3651  
    1010?>
    1111
    12     <?php if ( bbp_is_forum_edit() ) : ?>
     12<?php if ( bbp_is_forum_edit() ) : ?>
    1313
    14         <?php bbp_breadcrumb(); ?>
     14<div id="bbpress-forums">
    1515
    16         <?php bbp_single_forum_description( array( 'forum_id' => bbp_get_forum_id() ) ); ?>
     16    <?php bbp_breadcrumb(); ?>
    1717
    18     <?php endif; ?>
     18    <?php bbp_single_forum_description( array( 'forum_id' => bbp_get_forum_id() ) ); ?>
    1919
    20     <?php if ( bbp_current_user_can_access_create_forum_form() ) : ?>
     20<?php endif; ?>
    2121
    22         <div id="new-forum-<?php bbp_forum_id(); ?>" class="bbp-forum-form">
     22<?php if ( bbp_current_user_can_access_create_forum_form() ) : ?>
    2323
    24             <form id="new-post" name="new-post" method="post" action="">
     24    <div id="new-forum-<?php bbp_forum_id(); ?>" class="bbp-forum-form">
    2525
    26                 <?php do_action( 'bbp_theme_before_forum_form' ); ?>
     26        <form id="new-post" name="new-post" method="post" action="">
    2727
    28                 <fieldset class="bbp-form">
    29                     <legend>
     28            <?php do_action( 'bbp_theme_before_forum_form' ); ?>
    3029
    31                         <?php
    32                             if ( bbp_is_forum_edit() )
    33                                 printf( __( 'Now Editing &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_forum_title() );
    34                             else
    35                                 bbp_is_single_forum() ? printf( __( 'Create New Forum in &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_forum_title() ) : _e( 'Create New Forum', 'bbpress' );
    36                         ?>
     30            <fieldset class="bbp-form">
     31                <legend>
    3732
    38                     </legend>
     33                    <?php
     34                        if ( bbp_is_forum_edit() )
     35                            printf( __( 'Now Editing &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_forum_title() );
     36                        else
     37                            bbp_is_single_forum() ? printf( __( 'Create New Forum in &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_forum_title() ) : _e( 'Create New Forum', 'bbpress' );
     38                    ?>
    3939
    40                     <?php do_action( 'bbp_theme_before_forum_form_notices' ); ?>
     40                </legend>
    4141
    42                     <?php if ( !bbp_is_forum_edit() && bbp_is_forum_closed() ) : ?>
     42                <?php do_action( 'bbp_theme_before_forum_form_notices' ); ?>
    4343
    44                         <div class="bbp-template-notice">
    45                             <p><?php _e( 'This forum is closed to new content, however your account still allows you to do so.', 'bbpress' ); ?></p>
    46                         </div>
     44                <?php if ( !bbp_is_forum_edit() && bbp_is_forum_closed() ) : ?>
    4745
    48                     <?php endif; ?>
     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>
    4949
    50                     <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
     50                <?php endif; ?>
    5151
    52                         <div class="bbp-template-notice">
    53                             <p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
    54                         </div>
     52                <?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
    5553
    56                     <?php endif; ?>
     54                    <div class="bbp-template-notice">
     55                        <p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
     56                    </div>
    5757
    58                     <?php do_action( 'bbp_template_notices' ); ?>
     58                <?php endif; ?>
    5959
    60                     <div>
     60                <?php do_action( 'bbp_template_notices' ); ?>
    6161
    62                         <fieldset class="bbp-form bbp-forum-form-attributes">
    63                             <legend><?php _e( 'Forum Attributes', 'bbpress' ); ?></legend>
     62                <div>
    6463
    65                             <?php do_action( 'bbp_theme_before_forum_form_type' ); ?>
     64                    <fieldset class="bbp-form bbp-forum-form-attributes">
     65                        <legend><?php _e( 'Forum Attributes', 'bbpress' ); ?></legend>
     66
     67                        <?php do_action( 'bbp_theme_before_forum_form_type' ); ?>
     68
     69                        <p>
     70                            <label for="bbp_forum_id"><?php _e( 'Forum Type:', 'bbpress' ); ?></label><br />
     71                            <?php bbp_form_forum_type_dropdown(); ?>
     72                        </p>
     73
     74                        <?php do_action( 'bbp_theme_after_forum_form_type' ); ?>
     75
     76                        <?php do_action( 'bbp_theme_before_forum_form_status' ); ?>
     77
     78                        <p>
     79                            <label for="bbp_forum_id"><?php _e( 'Status:', 'bbpress' ); ?></label><br />
     80                            <?php bbp_form_forum_status_dropdown(); ?>
     81                        </p>
     82
     83                        <?php do_action( 'bbp_theme_after_forum_form_status' ); ?>
     84
     85                        <?php do_action( 'bbp_theme_before_forum_form_status' ); ?>
     86
     87                        <p>
     88                            <label for="bbp_forum_id"><?php _e( 'Visibility:', 'bbpress' ); ?></label><br />
     89                            <?php bbp_form_forum_visibility_dropdown(); ?>
     90                        </p>
     91
     92                        <?php do_action( 'bbp_theme_after_forum_visibility_status' ); ?>
     93
     94                        <?php if ( !bbp_is_single_forum() ) : ?>
     95
     96                            <hr />
     97
     98                            <?php do_action( 'bbp_theme_before_forum_form_parent' ); ?>
    6699
    67100                            <p>
    68                                 <label for="bbp_forum_id"><?php _e( 'Forum Type:', 'bbpress' ); ?></label><br />
    69                                 <?php bbp_form_forum_type_dropdown(); ?>
     101                                <label for="bbp_forum_id"><?php _e( 'Parent Forum:', 'bbpress' ); ?></label><br />
     102                                <?php bbp_dropdown( array( 'show_none' => __( '(No Parent)', 'bbpress' ), 'selected' => bbp_get_form_forum_parent() ) ); ?>
    70103                            </p>
    71104
    72                             <?php do_action( 'bbp_theme_after_forum_form_type' ); ?>
     105                            <?php do_action( 'bbp_theme_after_forum_form_parent' ); ?>
    73106
    74                             <?php do_action( 'bbp_theme_before_forum_form_status' ); ?>
     107                        <?php endif; ?>
     108
     109                    </fieldset>
     110
     111                    <fieldset class="bbp-forum-form-main">
     112
     113                        <?php do_action( 'bbp_theme_before_forum_form_title' ); ?>
     114
     115                        <p>
     116                            <label for="bbp_forum_title"><?php printf( __( 'Forum Name (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br />
     117                            <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(); ?>" />
     118                        </p>
     119
     120                        <?php do_action( 'bbp_theme_after_forum_form_title' ); ?>
     121
     122                        <?php do_action( 'bbp_theme_before_forum_form_content' ); ?>
     123
     124                        <?php if ( !function_exists( 'wp_editor' ) ) : ?>
    75125
    76126                            <p>
    77                                 <label for="bbp_forum_id"><?php _e( 'Status:', 'bbpress' ); ?></label><br />
    78                                 <?php bbp_form_forum_status_dropdown(); ?>
     127                                <label for="bbp_forum_content"><?php _e( 'Forum Description:', 'bbpress' ); ?></label><br />
     128                                <textarea id="bbp_forum_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_forum_content" cols="60" rows="10"><?php bbp_form_forum_content(); ?></textarea>
    79129                            </p>
    80130
    81                             <?php do_action( 'bbp_theme_after_forum_form_status' ); ?>
     131                        <?php else : ?>
    82132
    83                             <?php do_action( 'bbp_theme_before_forum_form_status' ); ?>
     133                            <?php bbp_the_content( array( 'context' => 'forum' ) ); ?>
    84134
    85                             <p>
    86                                 <label for="bbp_forum_id"><?php _e( 'Visibility:', 'bbpress' ); ?></label><br />
    87                                 <?php bbp_form_forum_visibility_dropdown(); ?>
     135                        <?php endif; ?>
     136
     137                        <?php do_action( 'bbp_theme_after_forum_form_content' ); ?>
     138
     139                        <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
     140
     141                            <p class="form-allowed-tags">
     142                                <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
     143                                <code><?php bbp_allowed_tags(); ?></code>
    88144                            </p>
    89145
    90                             <?php do_action( 'bbp_theme_after_forum_visibility_status' ); ?>
     146                        <?php endif; ?>
    91147
    92                             <?php if ( !bbp_is_single_forum() ) : ?>
     148                    </fieldset>
    93149
    94                                 <hr />
     150                    <?php do_action( 'bbp_theme_before_forum_form_submit_wrapper' ); ?>
    95151
    96                                 <?php do_action( 'bbp_theme_before_forum_form_parent' ); ?>
     152                    <div class="bbp-submit-wrapper">
    97153
    98                                 <p>
    99                                     <label for="bbp_forum_id"><?php _e( 'Parent Forum:', 'bbpress' ); ?></label><br />
    100                                     <?php bbp_dropdown( array( 'show_none' => __( '(No Parent)', 'bbpress' ), 'selected' => bbp_get_form_forum_parent() ) ); ?>
    101                                 </p>
     154                        <?php do_action( 'bbp_theme_before_forum_form_submit_button' ); ?>
    102155
    103                                 <?php do_action( 'bbp_theme_after_forum_form_parent' ); ?>
     156                        <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_forum_submit" name="bbp_forum_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
    104157
    105                             <?php endif; ?>
    106 
    107                         </fieldset>
    108 
    109                         <fieldset class="bbp-forum-form-main">
    110 
    111                             <?php do_action( 'bbp_theme_before_forum_form_title' ); ?>
    112 
    113                             <p>
    114                                 <label for="bbp_forum_title"><?php printf( __( 'Forum Name (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br />
    115                                 <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(); ?>" />
    116                             </p>
    117 
    118                             <?php do_action( 'bbp_theme_after_forum_form_title' ); ?>
    119 
    120                             <?php do_action( 'bbp_theme_before_forum_form_content' ); ?>
    121 
    122                             <?php if ( !function_exists( 'wp_editor' ) ) : ?>
    123 
    124                                 <p>
    125                                     <label for="bbp_forum_content"><?php _e( 'Forum Description:', 'bbpress' ); ?></label><br />
    126                                     <textarea id="bbp_forum_content" tabindex="<?php bbp_tab_index(); ?>" name="bbp_forum_content" cols="60" rows="10"><?php bbp_form_forum_content(); ?></textarea>
    127                                 </p>
    128 
    129                             <?php else : ?>
    130 
    131                                 <?php bbp_the_content( array( 'context' => 'forum' ) ); ?>
    132 
    133                             <?php endif; ?>
    134 
    135                             <?php do_action( 'bbp_theme_after_forum_form_content' ); ?>
    136 
    137                             <?php if ( !current_user_can( 'unfiltered_html' ) ) : ?>
    138 
    139                                 <p class="form-allowed-tags">
    140                                     <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
    141                                     <code><?php bbp_allowed_tags(); ?></code>
    142                                 </p>
    143 
    144                             <?php endif; ?>
    145 
    146                         </fieldset>
    147 
    148                         <?php do_action( 'bbp_theme_before_forum_form_submit_wrapper' ); ?>
    149 
    150                         <div class="bbp-submit-wrapper">
    151 
    152                             <?php do_action( 'bbp_theme_before_forum_form_submit_button' ); ?>
    153 
    154                             <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_forum_submit" name="bbp_forum_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
    155 
    156                             <?php do_action( 'bbp_theme_after_forum_form_submit_button' ); ?>
    157 
    158                         </div>
    159 
    160                         <?php do_action( 'bbp_theme_after_forum_form_submit_wrapper' ); ?>
     158                        <?php do_action( 'bbp_theme_after_forum_form_submit_button' ); ?>
    161159
    162160                    </div>
    163161
    164                     <?php bbp_forum_form_fields(); ?>
     162                    <?php do_action( 'bbp_theme_after_forum_form_submit_wrapper' ); ?>
    165163
    166                 </fieldset>
     164                </div>
    167165
    168                 <?php do_action( 'bbp_theme_after_forum_form' ); ?>
     166                <?php bbp_forum_form_fields(); ?>
    169167
    170             </form>
     168            </fieldset>
     169
     170            <?php do_action( 'bbp_theme_after_forum_form' ); ?>
     171
     172        </form>
     173    </div>
     174
     175<?php elseif ( bbp_is_forum_closed() ) : ?>
     176
     177    <div id="no-forum-<?php bbp_forum_id(); ?>" class="bbp-no-forum">
     178        <div class="bbp-template-notice">
     179            <p><?php printf( __( 'The forum &#8216;%s&#8217; is closed to new content.', 'bbpress' ), bbp_get_forum_title() ); ?></p>
    171180        </div>
     181    </div>
    172182
    173     <?php elseif ( bbp_is_forum_closed() ) : ?>
     183<?php else : ?>
    174184
    175         <div id="no-forum-<?php bbp_forum_id(); ?>" class="bbp-no-forum">
    176             <div class="bbp-template-notice">
    177                 <p><?php printf( __( 'The forum &#8216;%s&#8217; is closed to new content.', 'bbpress' ), bbp_get_forum_title() ); ?></p>
    178             </div>
     185    <div id="no-forum-<?php bbp_forum_id(); ?>" class="bbp-no-forum">
     186        <div class="bbp-template-notice">
     187            <p><?php is_user_logged_in() ? _e( 'You cannot create new forums at this time.', 'bbpress' ) : _e( 'You must be logged in to create new forums.', 'bbpress' ); ?></p>
    179188        </div>
     189    </div>
    180190
    181     <?php else : ?>
     191<?php endif; ?>
    182192
    183         <div id="no-forum-<?php bbp_forum_id(); ?>" class="bbp-no-forum">
    184             <div class="bbp-template-notice">
    185                 <p><?php is_user_logged_in() ? _e( 'You cannot create new forums at this time.', 'bbpress' ) : _e( 'You must be logged in to create new forums.', 'bbpress' ); ?></p>
    186             </div>
    187         </div>
     193<?php if ( bbp_is_forum_edit() ) : ?>
    188194
    189     <?php endif; ?>
     195</div>
     196
     197<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.