Changeset 4330 for trunk/includes/admin/users.php
- Timestamp:
- 11/04/2012 02:11:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/users.php
r4309 r4330 49 49 // User profile edit/display actions 50 50 add_action( 'edit_user_profile', array( $this, 'secondary_role_display' ) ); 51 52 // Show advanced capabilities53 if ( bbp_use_advanced_capability_editor() ) {54 55 // Admin styles56 add_action( 'admin_head', array( $this, 'admin_head' ) );57 58 // User profile edit/display actions59 add_action( 'edit_user_profile', array( $this, 'advanced_capability_display' ) );60 61 // Noop WordPress additional caps output area62 add_filter( 'additional_capabilities_display', '__return_false' );63 }64 }65 66 /**67 * Add some general styling to the admin area68 *69 * @since bbPress (r2464)70 *71 * @uses bbp_get_forum_post_type() To get the forum post type72 * @uses bbp_get_topic_post_type() To get the topic post type73 * @uses bbp_get_reply_post_type() To get the reply post type74 * @uses sanitize_html_class() To sanitize the classes75 */76 public function admin_head() {77 ?>78 79 <style type="text/css" media="screen">80 /*<![CDATA[*/81 div.bbp-user-capabilities {82 margin: 0 10px 10px;83 display: inline-block;84 vertical-align: top;85 }86 87 div.bbp-user-capabilities h4 {88 margin: 0 0 10px;89 }90 91 p.bbp-default-caps-wrapper {92 clear: both;93 margin: 80px -10px 0;94 }95 /*]]>*/96 </style>97 98 <?php99 51 } 100 52 … … 150 102 <?php 151 103 } 152 153 /**154 * Responsible for displaying bbPress's advanced capability interface.155 *156 * Hidden by default. Must be explicitly enabled.157 *158 * @since bbPress (r2464)159 *160 * @param WP_User $profileuser User data161 * @uses do_action() Calls 'bbp_user_profile_forums'162 * @return bool Always false163 */164 public function advanced_capability_display( $profileuser ) {165 166 // Bail if current user cannot edit users167 if ( ! current_user_can( 'edit_user', $profileuser->ID ) )168 return; ?>169 170 <table class="form-table">171 <tbody>172 <tr>173 <th><?php _e( 'This user can:', 'bbpress' ); ?></th>174 175 <td>176 <fieldset>177 <legend class="screen-reader-text"><span><?php _e( 'Additional Capabilities', 'bbpress' ); ?></span></legend>178 179 <?php foreach ( bbp_get_capability_groups() as $group ) : ?>180 181 <div class="bbp-user-capabilities">182 <h4><?php bbp_capability_group_title( $group ); ?></h4>183 184 <?php foreach ( bbp_get_capabilities_for_group( $group ) as $capability ) : ?>185 186 <label for="_bbp_<?php echo $capability; ?>">187 <input id="_bbp_<?php echo $capability; ?>" name="_bbp_<?php echo $capability; ?>" type="checkbox" id="_bbp_<?php echo $capability; ?>" value="1" <?php checked( user_can( $profileuser->ID, $capability ) ); ?> />188 <?php bbp_capability_title( $capability ); ?>189 </label>190 <br />191 192 <?php endforeach; ?>193 194 </div>195 196 <?php endforeach; ?>197 198 <p class="bbp-default-caps-wrapper">199 <input type="submit" name="bbp-default-caps" class="button" value="<?php esc_attr_e( 'Reset to Default', 'bbpress' ); ?>"/>200 </p>201 202 </fieldset>203 </td>204 </tr>205 206 </tbody>207 </table>208 209 <?php210 }211 104 } 212 105 new BBP_Users_Admin();
Note: See TracChangeset
for help on using the changeset viewer.