Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/17/2012 12:03:03 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Remove experimental Bozo functionality. We can use the 'participate' to prevent forum participation without creating topics or replies.
  • Introduce functions to reset, save, and remove user capabilities.
  • Use these functions in both theme-side and admin-side profiles.
  • Add capabilities to bbp-twentyten theme. This will be moved into the stand-alone bbp-twentyten theme soon'ish.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bbp-themes/bbp-twentyten/bbpress/form-user-edit.php

    r4034 r4222  
    125125        <div id="password">
    126126            <label for="pass1"><?php _e( 'New Password', 'bbpress' ); ?></label>
    127             <fieldset class="bbp-form">
     127            <fieldset class="bbp-form password">
    128128                <input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" tabindex="<?php bbp_tab_index(); ?>" />
    129129                <span class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'bbpress' ); ?></span>
     
    139139        <?php if ( current_user_can( 'edit_users' ) && ! bbp_is_user_home_edit() ) : ?>
    140140
    141             <div>
    142                 <label for="role"><?php _e( 'Role:', 'bbpress' ) ?></label>
    143 
    144                 <?php bbp_edit_user_role(); ?>
    145 
    146             </div>
    147 
    148         <?php endif; ?>
    149 
    150         <?php if ( is_multisite() && is_super_admin() && current_user_can( 'manage_network_options' ) ) : ?>
    151 
    152             <div>
    153                 <label for="role"><?php _e( 'Super Admin', 'bbpress' ); ?></label>
    154                 <label>
    155                     <input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( bbp_get_displayed_user_id() ) ); ?> tabindex="<?php bbp_tab_index(); ?>" />
    156                     <?php _e( 'Grant this user super admin privileges for the Network.', 'bbpress' ); ?>
    157                 </label>
    158             </div>
     141            <h2 class="entry-title"><?php _e( 'User Role', 'bbpress' ) ?></h2>
     142
     143            <fieldset class="bbp-form">
     144                <legend><?php _e( 'User Role', 'bbpress' ); ?></legend>
     145
     146                <?php if ( is_multisite() && is_super_admin() && current_user_can( 'manage_network_options' ) ) : ?>
     147
     148                    <div>
     149                        <label for="super_admin"><?php _e( 'Super Admin', 'bbpress' ); ?></label>
     150                        <label>
     151                            <input class="checkbox" type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( bbp_get_displayed_user_id() ) ); ?> tabindex="<?php bbp_tab_index(); ?>" />
     152                            <?php _e( 'Grant this user super admin privileges for the Network.', 'bbpress' ); ?>
     153                        </label>
     154                    </div>
     155
     156                <?php endif; ?>
     157
     158                <div>
     159                    <label for="role"><?php _e( 'Role', 'bbpress' ) ?></label>
     160
     161                    <?php bbp_edit_user_role(); ?>
     162
     163                </div>
     164
     165                <div>
     166                    <label for=""><?php _e( 'Forum Capabilities', 'bbpress' ); ?></label>
     167
     168                    <fieldset class="bbp-form capabilities">
     169                        <legend><?php _e( 'Forum Capabilities', 'bbpress' ); ?></legend>
     170
     171                        <?php foreach ( bbp_get_capability_groups() as $group ) : ?>
     172
     173                            <dl class="bbp-user-capabilities">
     174                                <dt><?php bbp_capability_group_title( $group ); ?></dt>
     175
     176                                <?php foreach ( bbp_get_capabilities_for_group( $group ) as $capability ) : ?>
     177
     178                                    <dd>
     179                                        <label for="_bbp_<?php echo $capability; ?>">
     180                                            <input class="checkbox" type="checkbox" id="_bbp_<?php echo $capability; ?>" name="_bbp_<?php echo $capability; ?>" value="1" <?php checked( user_can( bbp_get_displayed_user_id(), $capability ) ); ?> tabindex="<?php bbp_tab_index(); ?>" />
     181                                            <?php bbp_capability_title( $capability ); ?>
     182                                        </label>
     183                                    </dd>
     184
     185                                <?php endforeach; ?>
     186
     187                            </dl>
     188
     189                        <?php endforeach; ?>
     190                    </fieldset>
     191                </div>
     192
     193                <div>
     194                    <label for="bbp-default-caps"><?php _e( 'Reset Forum Capabilities', 'bbpress' ); ?></label>
     195                    <label>
     196                        <input class="checkbox" type="checkbox" id="bbp-default-caps" name="bbp-default-caps" tabindex="<?php bbp_tab_index(); ?>" />
     197                        <?php _e( 'Reset forum capabilities to match the user role.', 'bbpress' ); ?>
     198                    </label>
     199                </div>
     200
     201            </fieldset>
    159202
    160203        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.