Changeset 8438
- Timestamp:
- 05/21/2014 12:11:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/admin/bp-members-classes.php
r8272 r8438 55 55 global $usersearch; 56 56 57 $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : ''; 58 57 $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : ''; 59 58 $signups_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) ); 60 61 $paged = $this->get_pagenum(); 59 $paged = $this->get_pagenum(); 62 60 63 61 $args = array( … … 100 98 // Remove the 'current' class from the 'All' link 101 99 $views['all'] = str_replace( 'class="current"', '', $views['all'] ); 102 $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '" class="current">' . sprintf( _x( 'Pending <span class="count">(%s)</span>', 'signup users', 'buddypress' ), number_format_i18n( $this->signup_counts ) ) . '</a>';100 $views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) ); 103 101 104 102 return $views; … … 125 123 return apply_filters( 'bp_members_signup_columns', array( 126 124 'cb' => '<input type="checkbox" />', 127 'username' => __( 'Username', 'buddypress' ),128 'name' => __( 'Name', 'buddypress' ),129 'email' => __( 'Email', 'buddypress' ),130 'registered' => __( 'Registered', 'buddypress' ),131 'date_sent' => __( 'Last Sent', 'buddypress' ),132 'count_sent' => __( ' # Times Emailed', 'buddypress' )125 'username' => __( 'Username', 'buddypress' ), 126 'name' => __( 'Name', 'buddypress' ), 127 'email' => __( 'Email', 'buddypress' ), 128 'registered' => __( 'Registered', 'buddypress' ), 129 'date_sent' => __( 'Last Sent', 'buddypress' ), 130 'count_sent' => __( 'Emails Sent', 'buddypress' ) 133 131 ) ); 134 132 } … … 142 140 $actions = array( 143 141 'activate' => _x( 'Activate', 'Pending signup action', 'buddypress' ), 144 'resend' => _x( 'Email', 'Pending signup action', 'buddypress' ),142 'resend' => _x( 'Email', 'Pending signup action', 'buddypress' ), 145 143 ); 146 144 … … 168 166 // Specific case when BuddyPress is not network activated 169 167 if ( is_multisite() && current_user_can( 'manage_network_users') ) { 170 $link = '<a href="' . esc_url( network_admin_url( 'settings.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>';168 $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'settings.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) ); 171 169 } elseif ( current_user_can( 'manage_options' ) ) { 172 $link = '<a href="' . esc_url( bp_get_admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>';170 $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( bp_get_admin_url( 'options-general.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) ); 173 171 } 174 172 175 173 printf( __( 'Registration is disabled. %s', 'buddypress' ), $link ); 176 174 } 177 175 178 176 } 179 177 … … 223 221 */ 224 222 public function column_cb( $signup_object = null ) { 225 226 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php echo esc_html( sprintf( __( 'Select %s', 'buddypress' ), $signup_object->user_login )); ?></label>223 ?> 224 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php printf( esc_html__( 'Select %s', 'buddypress' ), $signup_object->user_login ); ?></label> 227 225 <input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" /> 228 226 <?php … … 269 267 ); 270 268 271 echo $avatar . '<strong><a href="' . $activate_link .'" class="edit" title="' . esc_attr__( 'Activate', 'buddypress' ) . '">' . $signup_object->user_login .'</a></strong><br/>';269 echo $avatar . sprintf( '<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url( $activate_link ), esc_attr__( 'Activate', 'buddypress' ), $signup_object->user_login ); 272 270 273 271 $actions = array(); 274 272 275 $actions['activate'] = '<a href="' . esc_url( $activate_link ) . '">' . __( 'Activate', 'buddypress' ) . '</a>'; 276 277 $actions['resend'] = '<a href="' . esc_url( $email_link ) . '">' . __( 'Email', 'buddypress' ) . '</a>'; 273 $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) ); 274 $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), __( 'Email', 'buddypress' ) ); 278 275 279 276 if ( current_user_can( 'delete_users' ) ) { 280 $actions['delete'] = '<a href="' . esc_url( $delete_link ) . '" class="delete">' . __( 'Delete', 'buddypress' ) . '</a>';277 $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) ); 281 278 } 282 279 283 280 $actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object ); 281 284 282 echo $this->row_actions( $actions ); 285 283 } … … 304 302 */ 305 303 public function column_email( $signup_object = null ) { 306 echo '<a href="mailto:' . esc_attr( $signup_object->user_email ) . '">' . esc_html( $signup_object->user_email ) .'</a>';304 printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $signup_object->user_email ), esc_html( $signup_object->user_email ) ); 307 305 } 308 306 … … 382 380 */ 383 381 public function prepare_items() { 384 global $usersearch, $wpdb, $mode; 385 386 $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : ''; 387 382 global $usersearch, $mode; 383 384 $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : ''; 388 385 $signups_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) ); 389 390 $paged = $this->get_pagenum(); 386 $paged = $this->get_pagenum(); 391 387 392 388 $args = array( … … 398 394 ); 399 395 400 if ( isset( $_REQUEST['orderby'] ) ) 396 if ( isset( $_REQUEST['orderby'] ) ) { 401 397 $args['orderby'] = $_REQUEST['orderby']; 402 403 if ( isset( $_REQUEST['order'] ) ) 398 } 399 400 if ( isset( $_REQUEST['order'] ) ) { 404 401 $args['order'] = $_REQUEST['order']; 405 406 $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; 407 402 } 403 404 $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; 408 405 $signups = BP_Signup::get( $args ); 409 406 410 $this->items = $signups['signups'];407 $this->items = $signups['signups']; 411 408 $this->signup_counts = $signups['total']; 412 409 … … 424 421 * @uses WP_MS_Users_List_Table::get_views() to get the users views 425 422 */ 426 function get_views() {423 public function get_views() { 427 424 $views = parent::get_views(); 428 425 429 $views['all'] = str_replace( 'class="current"', '', $views['all'] ); 430 $class = ' class="current"'; 431 432 $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '" class="current">' . sprintf( _x( 'Pending <span class="count">(%s)</span>', 'signup users', 'buddypress' ), number_format_i18n( $this->signup_counts ) ) . '</a>'; 426 // Remove the 'current' class from the 'All' link 427 $views['all'] = str_replace( 'class="current"', '', $views['all'] ); 428 $views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) ); 433 429 434 430 return $views; … … 443 439 return apply_filters( 'bp_members_ms_signup_columns', array( 444 440 'cb' => '<input type="checkbox" />', 445 'username' => __( 'Username', 'buddypress' ),446 'name' => __( 'Name', 'buddypress' ),447 'email' => __( 'Email', 'buddypress' ),448 'registered' => __( 'Registered', 'buddypress' ),449 'date_sent' => __( 'Last Sent', 'buddypress' ),450 'count_sent' => __( ' # Times Emailed', 'buddypress' )441 'username' => __( 'Username', 'buddypress' ), 442 'name' => __( 'Name', 'buddypress' ), 443 'email' => __( 'Email', 'buddypress' ), 444 'registered' => __( 'Registered', 'buddypress' ), 445 'date_sent' => __( 'Last Sent', 'buddypress' ), 446 'count_sent' => __( 'Emails Sent', 'buddypress' ) 451 447 ) ); 452 448 } … … 460 456 $actions = array( 461 457 'activate' => _x( 'Activate', 'Pending signup action', 'buddypress' ), 462 'resend' => _x( 'Email', 'Pending signup action', 'buddypress' ),458 'resend' => _x( 'Email', 'Pending signup action', 'buddypress' ), 463 459 ); 464 460 … … 484 480 485 481 if ( current_user_can( 'manage_network_users' ) ) { 486 $link = '<a href="' . esc_url( network_admin_url( 'settings.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>';482 $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'settings.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) ); 487 483 } 488 484 … … 536 532 */ 537 533 public function column_cb( $signup_object = null ) { 538 539 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php echo esc_html( sprintf( __( 'Select %s', 'buddypress' ), $signup_object->user_login )); ?></label>534 ?> 535 <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php printf( esc_html__( 'Select %s', 'buddypress' ), $signup_object->user_login ); ?></label> 540 536 <input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" /> 541 537 <?php … … 582 578 ); 583 579 584 echo $avatar . '<strong><a href="' . esc_url( $activate_link ) .'" class="edit" title="' . esc_attr__( 'Activate', 'buddypress' ) . '">' . $signup_object->user_login .'</a></strong><br/>'; 585 586 $actions['activate'] = '<a href="' . esc_url( $activate_link ) . '">' . __( 'Activate', 'buddypress' ) . '</a>'; 587 588 $actions['resend'] = '<a href="' . esc_url( $email_link ) . '">' . __( 'Email', 'buddypress' ) . '</a>'; 580 echo $avatar . sprintf( '<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url( $activate_link ), esc_attr__( 'Activate', 'buddypress' ), $signup_object->user_login ); 581 582 $actions = array(); 583 584 $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) ); 585 $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), __( 'Email', 'buddypress' ) ); 589 586 590 587 if ( current_user_can( 'delete_users' ) ) { 591 $actions['delete'] = '<a href="' . esc_url( $delete_link ) . '" class="delete">' . __( 'Delete', 'buddypress' ) . '</a>';588 $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) ); 592 589 } 593 590 594 591 $actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object ); 592 595 593 echo $this->row_actions( $actions ); 596 594 } … … 615 613 */ 616 614 public function column_email( $signup_object = null ) { 617 echo '<a href="mailto:' . esc_attr( $signup_object->user_email ) . '">' . esc_html( $signup_object->user_email ) .'</a>';615 printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $signup_object->user_email ), esc_html( $signup_object->user_email ) ); 618 616 } 619 617 … … 628 626 global $mode; 629 627 630 if ( 'list' == $mode ) {628 if ( 'list' === $mode ) { 631 629 $date = 'Y/m/d'; 632 630 } else { … … 645 643 global $mode; 646 644 647 if ( 'list' == $mode ) {645 if ( 'list' === $mode ) { 648 646 $date = 'Y/m/d'; 649 647 } else {
Note: See TracChangeset
for help on using the changeset viewer.