Changeset 4222
- Timestamp:
- 09/17/2012 12:03:03 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbp-admin/bbp-users.php
r4219 r4222 110 110 return; 111 111 112 // Load up the user113 $user = new WP_User( $user_id );114 115 112 // Either reset caps for role 116 113 if ( ! empty( $_POST['bbp-default-caps'] ) ) { 117 118 // Remove all caps 119 foreach ( bbp_get_capability_groups() as $group ) { 120 foreach ( bbp_get_capabilities_for_group( $group ) as $capability ) { 121 $user->remove_cap( $capability ); 122 } 123 } 114 bbp_reset_user_caps( $user_id ); 124 115 125 116 // Or set caps individually 126 117 } else { 127 128 // Loop through capability groups 129 foreach ( bbp_get_capability_groups() as $group ) { 130 foreach ( bbp_get_capabilities_for_group( $group ) as $capability ) { 131 132 // Maybe add cap 133 if ( ! empty( $_POST['_bbp_' . $capability] ) && ! $user->has_cap( $capability ) ) { 134 $user->add_cap( $capability, true ); 135 136 // Maybe remove cap 137 } elseif ( empty( $_POST['_bbp_' . $capability] ) && $user->has_cap( $capability ) ) { 138 $user->add_cap( $capability, false ); 139 } 140 } 141 } 118 bbp_save_user_caps( $user_id ); 142 119 } 143 120 } -
trunk/bbp-includes/bbp-core-caps.php
r4206 r4222 115 115 'moderate', 116 116 'throttle', 117 'view_trash', 118 'bozo' 117 'view_trash' 119 118 ) ); 120 119 } … … 277 276 $retval = __( 'View items in forum trash', 'bbpress' ); 278 277 break; 279 case 'bozo' :280 $retval = __( 'User is a forum bozo', 'bbpress' );281 break;282 278 283 279 // Forum caps … … 426 422 /** General ***********************************************************/ 427 423 428 case 'bozo' : 429 430 // Inactive users are not bozos 424 /** 425 * The 'participate' capability is similar to WordPress's 'read' cap, 426 * in that it is the minimum required cap to perform any other bbPress 427 * related thing. 428 */ 429 case 'participate' : 430 431 // Inactive users cannot participate 431 432 if ( bbp_is_user_inactive( $user_id ) ) { 432 433 $caps = array( 'do_not_allow' ); 433 434 434 // Moderators are not bozos435 // Moderators are always participants 435 436 } elseif ( user_can( $user_id, 'moderate' ) ) { 437 $caps = array( $cap ); 438 439 // Map to read 440 } else { 441 $caps = array( 'read' ); 442 } 443 444 break; 445 446 case 'moderate' : 447 448 // All admins are administrators 449 if ( user_can( $user_id, 'administrator' ) ) { 450 $caps = array( 'read' ); 451 } 452 break; 453 454 /** Reading ***********************************************************/ 455 456 case 'read_private_forums' : 457 case 'read_hidden_forums' : 458 459 // Non-participants cannot never read private/hidden forums 460 if ( ! user_can( $user_id, 'participate' ) ) { 436 461 $caps = array( 'do_not_allow' ); 437 } 438 439 break; 440 441 /** Reading ***********************************************************/ 462 463 // Moderators can always read private/hidden forums 464 } elseif ( user_can( $user_id, 'moderate' ) ) { 465 $caps = array( $cap ); 466 } 467 468 break; 442 469 443 470 case 'read_forum' : … … 445 472 case 'read_reply' : 446 473 447 // Get the post 448 $_post = get_post( $args[0] ); 449 if ( !empty( $_post ) ) { 450 451 // Get caps for post type object 452 $post_type = get_post_type_object( $_post->post_type ); 453 $caps = array(); 454 455 // Post is public 456 if ( bbp_get_public_status_id() == $_post->post_status ) { 457 $caps[] = 'read'; 458 459 // User is author so allow read 460 } elseif ( (int) $user_id == (int) $_post->post_author ) { 461 $caps[] = 'read'; 462 463 // Unknown so map to private posts 464 } else { 465 $caps[] = $post_type->cap->read_private_posts; 474 // User cannot participate 475 if ( ! user_can( $user_id, 'participate' ) ) { 476 $caps = array( 'do_not_allow' ); 477 478 // Do some post ID based logic 479 } else { 480 481 // Get the post 482 $_post = get_post( $args[0] ); 483 if ( !empty( $_post ) ) { 484 485 // Get caps for post type object 486 $post_type = get_post_type_object( $_post->post_type ); 487 488 // Post is public 489 if ( bbp_get_public_status_id() == $_post->post_status ) { 490 $caps = array( 'particpate' ); 491 492 // User is author so allow read 493 } elseif ( (int) $user_id == (int) $_post->post_author ) { 494 $caps = array( 'participate' ); 495 496 // Unknown so map to private posts 497 } else { 498 $caps = array( $post_type->cap->read_private_forums ); 499 } 466 500 } 467 501 } … … 475 509 case 'publish_replies' : 476 510 477 // Add do_not_allow cap if user is spam or deleted478 if ( bbp_is_user_inactive( $user_id ) )511 // Non participants cannot participate 512 if ( ! user_can( $user_id, 'participate' ) ) { 479 513 $caps = array( 'do_not_allow' ); 480 514 515 // Moderators can always edit 516 } elseif ( user_can( $user_id, 'moderate' ) ) { 517 $caps = array( $cap ); 518 } 519 481 520 break; 482 521 … … 484 523 485 524 // Used primarily in wp-admin 486 case 'edit_forums' : 487 case 'edit_topics' : 488 case 'edit_replies' : 489 490 // Add do_not_allow cap if user is spam or deleted 491 if ( bbp_is_user_inactive( $user_id ) ) 525 case 'edit_forums' : 526 case 'edit_topics' : 527 case 'edit_replies' : 528 case 'edit_others_topics' : 529 case 'edit_others_replies' : 530 531 // Moderators can always edit 532 if ( ! user_can( $user_id, 'participate' ) ) { 492 533 $caps = array( 'do_not_allow' ); 534 535 // Moderators can always edit forum content 536 } elseif ( user_can( $user_id, 'moderate' ) ) { 537 $caps = array( $cap ); 538 } 493 539 494 540 break; … … 567 613 $caps[] = 'do_not_allow'; 568 614 615 // Moderators can always edit forum content 616 } elseif ( user_can( $user_id, 'moderate' ) ) { 617 $caps[] = 'participate'; 618 569 619 // Unknown so map to delete_others_posts 570 620 } else { 571 621 $caps[] = $post_type->cap->delete_others_posts; 572 622 } 623 } 624 625 break; 626 627 // Moderation override 628 case 'delete_topics' : 629 case 'delete_replies' : 630 case 'delete_others_topics' : 631 case 'delete_others_replies' : 632 633 // Moderators can always edit 634 if ( ! user_can( $user_id, 'participate' ) ) { 635 $caps = array( 'do_not_allow' ); 636 637 // Moderators can always edit forum content 638 } elseif ( user_can( $user_id, 'moderate' ) ) { 639 $caps = array( $cap ); 640 } 641 642 break; 643 644 /** Topic Tags ********************************************************/ 645 646 case 'manage_topic_tags' : 647 case 'edit_topic_tags' : 648 case 'delete_topic_tags' : 649 case 'assign_topic_tags' : 650 651 // Moderators can always edit 652 if ( ! user_can( $user_id, 'participate' ) ) { 653 $caps = array( 'do_not_allow' ); 654 655 // Moderators can always edit forum content 656 } elseif ( user_can( $user_id, 'moderate' ) ) { 657 $caps = array( $cap ); 573 658 } 574 659 … … 748 833 749 834 return apply_filters( 'bbp_get_caps_for_role', $caps, $role ); 835 } 836 837 /** 838 * Remove all bbPress capabilities for a given user 839 * 840 * @since bbPress (r4221) 841 * 842 * @param int $user_id 843 * @return boolean True on success, false on failure 844 */ 845 function bbp_remove_user_caps( $user_id = 0 ) { 846 847 // Bail if no user was passed 848 if ( empty( $user_id ) ) 849 return false; 850 851 // Load up the user 852 $user = new WP_User( $user_id ); 853 854 // Remove all caps 855 foreach ( bbp_get_capability_groups() as $group ) 856 foreach ( bbp_get_capabilities_for_group( $group ) as $capability ) 857 $user->remove_cap( $capability ); 858 859 // Success 860 return true; 861 } 862 863 /** 864 * Remove all bbPress capabilities for a given user 865 * 866 * @since bbPress (r4221) 867 * 868 * @param int $user_id 869 * @return boolean True on success, false on failure 870 */ 871 function bbp_reset_user_caps( $user_id = 0 ) { 872 873 // Bail if no user was passed 874 if ( empty( $user_id ) ) 875 return false; 876 877 // Bail if not a member of this blog 878 if ( ! user_can( $user_id, 'read' ) ) 879 return false; 880 881 // Remove all caps for user 882 bbp_remove_user_caps( $user_id ); 883 884 // Load up the user 885 $user = new WP_User( $user_id ); 886 887 // User has no role so bail 888 if ( ! isset( $user->roles ) ) 889 return false; 890 891 // Use first user role 892 $caps = bbp_get_caps_for_role( array_shift( $user->roles ) ); 893 894 // Add caps for the first role 895 foreach ( $caps as $cap ) 896 $user->add_cap( $cap, true ); 897 898 // Success 899 return true; 900 } 901 902 /** 903 * Save all bbPress capabilities for a given user 904 * 905 * @since bbPress (r4221) 906 * 907 * @param type $user_id 908 * @return boolean 909 */ 910 function bbp_save_user_caps( $user_id = 0 ) { 911 912 // Bail if no user was passed 913 if ( empty( $user_id ) ) 914 return false; 915 916 // Bail if not a member of this blog 917 if ( ! user_can( $user_id, 'read' ) ) 918 return false; 919 920 // Load up the user 921 $user = new WP_User( $user_id ); 922 923 // Loop through capability groups 924 foreach ( bbp_get_capability_groups() as $group ) { 925 foreach ( bbp_get_capabilities_for_group( $group ) as $capability ) { 926 927 // Maybe add cap 928 if ( ! empty( $_POST['_bbp_' . $capability] ) && ! $user->has_cap( $capability ) ) { 929 $user->add_cap( $capability, true ); 930 931 // Maybe remove cap 932 } elseif ( empty( $_POST['_bbp_' . $capability] ) && $user->has_cap( $capability ) ) { 933 $user->add_cap( $capability, false ); 934 } 935 } 936 } 937 938 // Success 939 return true; 750 940 } 751 941 -
trunk/bbp-includes/bbp-core-functions.php
r4209 r4222 366 366 } 367 367 368 /**369 * Return the bozo post status ID370 *371 * @since bbPress (r4167)372 *373 * @return string374 */375 function bbp_get_bozo_status_id() {376 return bbpress()->bozo_status_id;377 }378 379 368 /** Rewrite IDs ***************************************************************/ 380 369 -
trunk/bbp-includes/bbp-reply-functions.php
r4218 r4222 221 221 if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 222 222 $reply_status = bbp_get_pending_status_id(); 223 224 // Maybe set as bozo status225 } elseif ( bbp_is_user_bozo() ) {226 $reply_status = bbp_get_bozo_status_id();227 223 228 224 // Default … … 391 387 392 388 // Define local variable(s) 393 $reply = $reply_id = $ topic_id = $forum_id = $anonymous_data = 0;389 $reply = $reply_id = $reply_author = $topic_id = $forum_id = $anonymous_data = 0; 394 390 $reply_title = $reply_content = $reply_edit_reason = $terms = ''; 395 391 … … 422 418 423 419 // Check users ability to create new reply 424 if ( ! bbp_is_reply_anonymous( $reply_id ) ) {420 if ( ! bbp_is_reply_anonymous( $reply_id ) ) { 425 421 426 422 // User cannot edit this reply … … 430 426 } 431 427 428 // Set reply author 429 $reply_author = bbp_get_reply_author_id( $reply_id ); 430 432 431 // It is an anonymous post 433 432 } else { … … 494 493 /** Reply Blacklist *******************************************************/ 495 494 496 if ( !bbp_check_for_blacklist( $anonymous_data, bbp_get_reply_author_id( $reply_id ), $reply_title, $reply_content ) )495 if ( !bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) 497 496 bbp_add_error( 'bbp_reply_blacklist', __( '<strong>ERROR</strong>: Your reply cannot be edited at this time.', 'bbpress' ) ); 498 497 … … 500 499 501 500 // Maybe put into moderation 502 if ( !bbp_check_for_moderation( $anonymous_data, bbp_get_reply_author_id( $reply_id ), $reply_title, $reply_content ) ) {501 if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 503 502 $reply_status = bbp_get_pending_status_id(); 504 505 // Maybe set as bozo status506 } elseif ( bbp_is_user_bozo() ) {507 $reply_status = bbp_get_bozo_status_id();508 503 509 504 // Default … … 544 539 'post_content' => $reply_content, 545 540 'post_status' => $reply_status, 546 'post_parent' => $ reply->post_parent,547 'post_author' => $reply ->post_author,541 'post_parent' => $topic_id, 542 'post_author' => $reply_author, 548 543 'post_type' => bbp_get_reply_post_type() 549 544 ) ); … … 589 584 590 585 // Update counts, etc... 591 do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply ->post_author , true /* Is edit */ );586 do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author , true /* Is edit */ ); 592 587 593 588 /** Additional Actions (After Save) ***********************************/ -
trunk/bbp-includes/bbp-reply-template.php
r4216 r4222 44 44 * 45 45 * @param mixed $args All the arguments supported by {@link WP_Query} 46 * @uses bbp_is_user_bozo() To add the bozo post status47 46 * @uses bbp_show_lead_topic() Are we showing the topic as a lead? 48 47 * @uses bbp_get_topic_id() To get the topic id … … 75 74 } 76 75 77 // Add the bozo status if user is a bozo78 if ( bbp_is_user_bozo() ) {79 $post_statuses[] = bbp_get_bozo_status_id();80 }81 82 76 $default_reply_search = !empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false; 83 77 $default_post_parent = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any'; -
trunk/bbp-includes/bbp-topic-functions.php
r4218 r4222 243 243 if ( !bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) { 244 244 $topic_status = bbp_get_pending_status_id(); 245 246 // Maybe set as bozo status247 } elseif ( bbp_is_user_bozo() ) {248 $topic_status = bbp_get_bozo_status_id();249 245 250 246 // Default to published … … 438 434 439 435 // Define local variable(s) 440 $topic = $topic_id = $ forum_id = $anonymous_data = 0;436 $topic = $topic_id = $topic_author = $forum_id = $anonymous_data = 0; 441 437 $topic_title = $topic_content = $topic_edit_reason = ''; 442 438 … … 463 459 464 460 // Check users ability to create new topic 465 if ( ! bbp_is_topic_anonymous( $topic_id ) ) {461 if ( ! bbp_is_topic_anonymous( $topic_id ) ) { 466 462 467 463 // User cannot edit this topic … … 470 466 } 471 467 468 // Set topic author 469 $topic_author = bbp_get_topic_author_id( $topic_id ); 470 472 471 // It is an anonymous post 473 472 } else { … … 550 549 /** Topic Blacklist *******************************************************/ 551 550 552 if ( !bbp_check_for_blacklist( $anonymous_data, bbp_get_topic_author_id( $topic_id ), $topic_title, $topic_content ) )551 if ( !bbp_check_for_blacklist( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) 553 552 bbp_add_error( 'bbp_topic_blacklist', __( '<strong>ERROR</strong>: Your topic cannot be edited at this time.', 'bbpress' ) ); 554 553 … … 558 557 if ( !bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) { 559 558 $topic_status = bbp_get_pending_status_id(); 560 561 // Maybe set as bozo status562 } elseif ( bbp_is_user_bozo() ) {563 $topic_status = bbp_get_bozo_status_id();564 559 565 560 // Default to published … … 610 605 'post_status' => $topic_status, 611 606 'post_parent' => $forum_id, 612 'post_author' => $topic ->post_author,607 'post_author' => $topic_author, 613 608 'post_type' => bbp_get_topic_post_type(), 614 609 'tax_input' => $terms, … … 664 659 665 660 // Update counts, etc... 666 do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic ->post_author , true /* Is edit */ );661 do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author , true /* Is edit */ ); 667 662 668 663 // If the new forum id is not equal to the old forum id, run the -
trunk/bbp-includes/bbp-topic-template.php
r4171 r4222 63 63 * @param mixed $args All the arguments supported by {@link WP_Query} 64 64 * @uses current_user_can() To check if the current user can edit other's topics 65 * @uses bbp_is_user_bozo() To add the bozo post status66 65 * @uses bbp_get_topic_post_type() To get the topic post type 67 66 * @uses WP_Query To make query and get the topics … … 91 90 } else { 92 91 $post_statuses = array( bbp_get_public_status_id(), bbp_get_closed_status_id() ); 93 }94 95 // Add the bozo status if user is a bozo96 if ( bbp_is_user_bozo() ) {97 $post_statuses[] = bbp_get_bozo_status_id();98 92 } 99 93 -
trunk/bbp-includes/bbp-user-functions.php
r4196 r4222 934 934 $edit_user = edit_user( $user_id ); 935 935 936 // Either reset caps for role 937 if ( ! empty( $_POST['bbp-default-caps'] ) ) { 938 bbp_reset_user_caps( $user_id ); 939 940 // Or set caps individually 941 } else { 942 bbp_save_user_caps( $user_id ); 943 } 944 936 945 // Error(s) editng the user, so copy them into the global 937 946 if ( is_wp_error( $edit_user ) ) { … … 1336 1345 1337 1346 /** 1338 * Checks if user is a bozo.1339 *1340 * @since bbPress (r4169)1341 *1342 * @uses is_user_logged_in() To check if user is logged in1343 * @uses bbp_get_displayed_user_id() To get current user ID1344 * @uses bbp_is_user_active() To check if user is active1345 *1346 * @param int $user_id The user ID to check. Defaults to current user ID1347 * @return bool True if inactive, false if active1348 */1349 function bbp_is_user_bozo( $user_id = 0 ) {1350 1351 // Default to current user1352 if ( empty( $user_id ) && is_user_logged_in() )1353 $user_id = bbp_get_current_user_id();1354 1355 // Anonymous users are not bozos1356 if ( empty( $user_id ) )1357 return false;1358 1359 // Return if a user has the bozo capability1360 return (bool) apply_filters( 'bbp_is_user_bozo', user_can( $user_id, 'bozo' ), $user_id );1361 }1362 1363 /**1364 1347 * Return a user's main role 1365 1348 * -
trunk/bbp-includes/bbp-user-template.php
r4207 r4222 449 449 } elseif ( user_can( $user_id, 'moderate' ) ) { 450 450 $role = __( 'Moderator', 'bbpress' ); 451 452 // Bozo453 } elseif ( user_can( $user_id, 'bozo' ) ) {454 $role = __( 'Bozo', 'bbpress' );455 451 456 452 // Participant -
trunk/bbp-theme-compat/bbpress/form-user-edit.php
r4196 r4222 125 125 <div id="password"> 126 126 <label for="pass1"><?php _e( 'New Password', 'bbpress' ); ?></label> 127 <fieldset class="bbp-form ">127 <fieldset class="bbp-form password"> 128 128 <input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" tabindex="<?php bbp_tab_index(); ?>" /> 129 129 <span class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'bbpress' ); ?></span> … … 143 143 <?php if ( current_user_can( 'edit_users' ) && ! bbp_is_user_home_edit() ) : ?> 144 144 145 <h2 class="entry-title"><?php _e( ' Capabilities', 'bbpress' ) ?></h2>145 <h2 class="entry-title"><?php _e( 'User Role', 'bbpress' ) ?></h2> 146 146 147 147 <fieldset class="bbp-form"> 148 <legend><?php _e( 'Forum Capabilities', 'bbpress' ); ?></legend> 149 150 <div> 151 <label for="role"><?php _e( 'Role', 'bbpress' ) ?></label> 152 153 <?php bbp_edit_user_role(); ?> 154 155 </div> 148 <legend><?php _e( 'User Role', 'bbpress' ); ?></legend> 156 149 157 150 <?php if ( is_multisite() && is_super_admin() && current_user_can( 'manage_network_options' ) ) : ?> … … 168 161 169 162 <div> 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 163 <label for="role"><?php _e( 'Role', 'bbpress' ) ?></label> 164 165 <?php bbp_edit_user_role(); ?> 166 167 </div> 168 169 <div> 170 <label for=""><?php _e( 'Forum Capabilities', 'bbpress' ); ?></label> 171 172 <fieldset class="bbp-form capabilities"> 173 <legend><?php _e( 'Forum Capabilities', 'bbpress' ); ?></legend> 174 175 <?php foreach ( bbp_get_capability_groups() as $group ) : ?> 176 177 <dl class="bbp-user-capabilities"> 178 <dt><?php bbp_capability_group_title( $group ); ?></dt> 179 180 <?php foreach ( bbp_get_capabilities_for_group( $group ) as $capability ) : ?> 181 182 <dd> 183 <label for="_bbp_<?php echo $capability; ?>"> 184 <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(); ?>" /> 185 <?php bbp_capability_title( $capability ); ?> 186 </label> 187 </dd> 188 189 <?php endforeach; ?> 190 191 </dl> 192 193 <?php endforeach; ?> 194 </fieldset> 195 </div> 196 197 <div> 198 <label for="bbp-default-caps"><?php _e( 'Reset', 'bbpress' ); ?></label> 199 <label> 200 <input class="checkbox" type="checkbox" id="bbp-default-caps" name="bbp-default-caps" tabindex="<?php bbp_tab_index(); ?>" /> 201 <?php _e( 'Reset forum capabilities to match the user role.', 'bbpress' ); ?> 202 </label> 191 203 </div> 192 204 -
trunk/bbp-theme-compat/css/bbpress.css
r4197 r4222 589 589 #bbpress-forums #bbp-your-profile fieldset fieldset { 590 590 margin: 0; 591 width: 260px;592 591 border: none; 593 592 padding: 0; … … 595 594 float: none; 596 595 } 597 #bbp-your-profile fieldset fieldset span.description { 596 #bbpress-forums #bbp-your-profile fieldset fieldset.password { 597 width: 260px; 598 } 599 #bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl { 600 margin: 0; 601 } 602 #bbp-your-profile fieldset fieldset.password span.description { 598 603 margin-left: 0; 599 604 margin-bottom: 20px; -
trunk/bbp-themes/bbp-twentyten/bbpress/form-user-edit.php
r4034 r4222 125 125 <div id="password"> 126 126 <label for="pass1"><?php _e( 'New Password', 'bbpress' ); ?></label> 127 <fieldset class="bbp-form ">127 <fieldset class="bbp-form password"> 128 128 <input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" tabindex="<?php bbp_tab_index(); ?>" /> 129 129 <span class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'bbpress' ); ?></span> … … 139 139 <?php if ( current_user_can( 'edit_users' ) && ! bbp_is_user_home_edit() ) : ?> 140 140 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> 159 202 160 203 <?php endif; ?> -
trunk/bbp-themes/bbp-twentyten/css/bbpress.css
r3987 r4222 556 556 #container #bbp-your-profile fieldset fieldset { 557 557 margin: 0; 558 width: 260px;559 558 border: none; 560 559 padding: 0; 561 560 clear: none; 562 561 float: none; 562 } 563 #bbp-your-profile fieldset fieldset.password { 564 width: 260px; 565 } 566 #bbp-your-profile fieldset fieldset.capabilities dl { 567 margin: 0; 563 568 } 564 569 #bbp-your-profile fieldset fieldset span.description { -
trunk/bbpress.php
r4215 r4222 209 209 $this->hidden_status_id = apply_filters( 'bbp_hidden_post_status', 'hidden' ); 210 210 $this->trash_status_id = apply_filters( 'bbp_trash_post_status', 'trash' ); 211 $this->bozo_status_id = apply_filters( 'bbp_bozo_post_status', 'bozo' );212 211 213 212 // Other identifiers … … 710 709 ); 711 710 712 // Bozo713 register_post_status(714 bbp_get_bozo_status_id(),715 apply_filters( 'bbp_register_bozo_post_status', array(716 'label' => _x( 'Bozo', 'post', 'bbpress' ),717 'label_count' => _nx_noop( 'Bozo <span class="count">(%s)</span>', 'Bozo <span class="count">(%s)</span>', 'bbpress' ),718 'private' => true,719 'exclude_from_search' => true,720 'show_in_admin_status_list' => true,721 'show_in_admin_all_list' => false722 ) )723 );724 725 711 /** 726 712 * Trash fix … … 829 815 830 816 /** 817 * Register the bbPress capabilities 818 * 819 * @since bbPress (r3031) 820 * 821 * @uses BBP_Capabilities 822 */ 823 public function register_capabilities() { 824 $this->capabilities = new BBP_Capabilities(); 825 } 826 827 /** 831 828 * Setup the currently logged-in user 832 829 *
Note: See TracChangeset
for help on using the changeset viewer.