Changeset 9429
- Timestamp:
- 02/04/2015 02:38:10 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-admin.php
r9421 r9429 188 188 189 189 // Bail if user cannot moderate 190 if ( ! bp_current_user_can( 'manage_options' ) ) 190 if ( ! bp_current_user_can( 'manage_options' ) ) { 191 191 return; 192 } 192 193 193 194 // About … … 351 352 add_settings_section( 'bp_groups', __( 'Groups Settings', 'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' ); 352 353 353 if ( empty( $avatar_setting ) ) 354 if ( empty( $avatar_setting ) ) { 354 355 $avatar_setting = 'bp_groups'; 356 } 355 357 356 358 // Allow subscriptions setting … … 432 434 433 435 // Return normal links if not BuddyPress 434 if ( plugin_basename( buddypress()->basename ) != $file ) 436 if ( plugin_basename( buddypress()->basename ) != $file ) { 435 437 return $links; 438 } 436 439 437 440 // Add a few links to the existing links array … … 487 490 */ 488 491 public function about_screen() { 489 $is_new_install = ! empty( $_GET['is_new_install'] ); 490 $welcome_text = ( $is_new_install ) 491 ? __( 'Thank you for installing BuddyPress! BuddyPress %s gives you the components you need to turn your WordPress powered site into a thriving membership community.', 'buddypress' ) 492 : __( 'BuddyPress %s comes with a bunch of great improvements we think you’re really going to like.', 'buddypress' ); 493 494 list( $display_version ) = explode( '-', bp_get_version() ); ?> 492 ?> 495 493 496 494 <div class="wrap about-wrap"> 497 <h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1> 498 <div class="about-text"> 499 <?php printf( $welcome_text, $display_version ); ?> 500 </div> 501 502 <div class="bp-badge"></div> 503 504 <h2 class="nav-tab-wrapper"> 505 <a class="nav-tab nav-tab-active" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>"> 506 <?php _e( 'What’s New', 'buddypress' ); ?> 507 </a><a class="nav-tab" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>"> 508 <?php _e( 'Credits', 'buddypress' ); ?> 509 </a> 510 </h2> 511 512 <?php if ( $is_new_install ) : ?> 495 496 <?php self::welcome_text(); ?> 497 498 <?php self::tab_navigation( __METHOD__ ); ?> 499 500 <?php if ( self::is_new_install() ) : ?> 513 501 514 502 <div id="welcome-panel" class="welcome-panel"> … … 644 632 */ 645 633 public function credits_screen() { 646 647 $is_new_install = ! empty( $_GET['is_new_install'] ); 648 649 list( $display_version ) = explode( '-', bp_get_version() ); ?> 634 ?> 650 635 651 636 <div class="wrap about-wrap"> 652 <h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1> 653 <div class="about-text"> 654 <?php if ( $is_new_install ) : ?> 655 <?php printf( __( 'Thank you for installing BuddyPress! BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you’re going to love it.', 'buddypress' ), $display_version ); ?> 656 <?php else : ?> 657 <?php printf( __( 'Howdy. BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you’re going to love it.', 'buddypress' ), $display_version ); ?> 658 <?php endif; ?> 659 </div> 660 661 <div class="bp-badge"></div> 662 663 <h2 class="nav-tab-wrapper"> 664 <a class="nav-tab" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>"> 665 <?php _e( 'What’s New', 'buddypress' ); ?> 666 </a><a class="nav-tab nav-tab-active" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>"> 667 <?php _e( 'Credits', 'buddypress' ); ?> 668 </a> 669 </h2> 670 671 <p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks.', 'buddypress' ); ?></p> 637 638 <?php self::welcome_text(); ?> 639 640 <?php self::tab_navigation( __METHOD__ ); ?> 641 642 <p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks like these.', 'buddypress' ); ?></p> 672 643 673 644 <h4 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h4> … … 743 714 </ul> 744 715 745 <h4 class="wp-people-group"><?php printf( __( 'Contributors to BuddyPress %s', 'buddypress' ), $display_version); ?></h4>716 <h4 class="wp-people-group"><?php printf( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h4> 746 717 <p class="wp-credits-list"> 747 718 <a href="https://profiles.wordpress.org/andemann/">andemann</a>, … … 803 774 <?php 804 775 } 776 777 /** 778 * Output welcome text and badge for What's New and Credits pages 779 * 780 * @since BuddyPress (2.2.0) 781 */ 782 public static function welcome_text() { 783 784 // Switch welcome text based on whether this is a new installation or not 785 $welcome_text = ( self::is_new_install() ) 786 ? __( 'Thank you for installing BuddyPress! BuddyPress %s gives you the components you need to turn your WordPress powered site into a thriving membership community.', 'buddypress' ) 787 : __( 'BuddyPress %s comes with a bunch of great improvements we think you’re really going to like.', 'buddypress' ); 788 789 ?> 790 791 <h1><?php printf( esc_html__( 'Welcome to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h1> 792 <div class="about-text"> 793 <?php printf( $welcome_text, self::display_version() ); ?> 794 </div> 795 796 <div class="bp-badge"></div> 797 798 <?php 799 } 800 801 /** 802 * Output tab navigation for `What's New` and `Credits` pages 803 * 804 * @since BuddyPress (2.2.0) 805 * @param string $tab 806 */ 807 public static function tab_navigation( $tab = 'whats_new' ) { 808 ?> 809 810 <h2 class="nav-tab-wrapper"> 811 <a class="nav-tab <?php if ( 'BP_Admin::about_screen' === $tab ) : ?>nav-tab-active<?php endif; ?>" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>"> 812 <?php esc_html_e( 'What’s New', 'buddypress' ); ?> 813 </a><a class="nav-tab <?php if ( 'BP_Admin::credits_screen' === $tab ) : ?>nav-tab-active<?php endif; ?>" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>"> 814 <?php esc_html_e( 'Credits', 'buddypress' ); ?> 815 </a> 816 </h2> 817 818 <?php 819 } 820 821 /** Helpers ***************************************************************/ 822 823 /** 824 * Return true/false based on whether a query argument is set 825 * 826 * @see bp_do_activation_redirect() 827 * 828 * @since BuddyPress (2.2.0) 829 * @return bool 830 */ 831 public static function is_new_install() { 832 return (bool) isset( $_GET['is_new_install'] ); 833 } 834 835 /** 836 * Return a user-friendly version-number string, for use in translations 837 * 838 * @since BuddyPress (2.2.0) 839 * @return string 840 */ 841 public static function display_version() { 842 843 // Use static variable to prevent recalculations 844 static $display = ''; 845 846 // Only calculate on first run 847 if ( '' === $display ) { 848 849 // Get current version 850 $version = bp_get_version(); 851 852 // Check for prerelease hyphen 853 $pre = strpos( $version, '-' ); 854 855 // Strip prerelease suffix 856 $display = ( false !== $pre ) 857 ? substr( $version, 0, $pre ) 858 : $version; 859 } 860 861 // Done! 862 return $display; 863 } 805 864 } 806 865 endif; // class_exists check
Note: See TracChangeset
for help on using the changeset viewer.