Skip to:
Content

BuddyPress.org

Ticket #6827: 6827.patch

File 6827.patch, 18.8 KB (added by mercime, 9 years ago)
  • src/bp-core/admin/css/common-rtl.css

     
    169169        content: "\f108";
    170170}
    171171
    172 #adminmenu li.toplevel_page_bp-components .wp-menu-image,
    173 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image {
     172#adminmenu #toplevel_page_buddypress-menu .wp-menu-image:before,
     173#adminmenu #toplevel_page_buddypress-menu_user .wp-menu-image:before,
     174#adminmenu #toplevel_page_buddypress-menu_network .wp-menu-image:before {
    174175        content: "\f448";
    175176}
    176177
    177178/* Settings - Dashicons (WP 3.8+) */
     179.toplevel_page_buddypress-menu td.plugin-title span,
    178180.settings_page_bp-components td.plugin-title span {
    179181        float: right;
    180182        width: 18px;
     
    182184        margin-left: 5px;
    183185}
    184186
     187.toplevel_page_buddypress-menu td.plugin-title span:before,
    185188.settings_page_bp-components td.plugin-title span:before {
    186189        font-family: 'dashicons';
    187190        font-size: 18px;
    188191}
    189192
     193.toplevel_page_buddypress-menu tr.activity td.plugin-title span:before,
    190194.settings_page_bp-components tr.activity td.plugin-title span:before {
    191195        content: "\f452";
    192196}
    193197
     198.toplevel_page_buddypress-menu tr.notifications td.plugin-title span:before,
    194199.settings_page_bp-components tr.notifications td.plugin-title span:before {
    195200        content: "\f339";
    196201}
    197202
     203.toplevel_page_buddypress-menu tr.xprofile td.plugin-title span:before,
    198204.settings_page_bp-components tr.xprofile td.plugin-title span:before {
    199205        content: "\f336";
    200206}
    201207
     208.toplevel_page_buddypress-menu tr.settings td.plugin-title span:before,
    202209.settings_page_bp-components tr.settings td.plugin-title span:before {
    203210        content: "\f108";
    204211}
    205212
     213.toplevel_page_buddypress-menu tr.groups td.plugin-title span:before,
    206214.settings_page_bp-components tr.groups td.plugin-title span:before {
    207215        content: "\f456";
    208216}
    209217
     218.toplevel_page_buddypress-menu tr.messages td.plugin-title span:before,
    210219.settings_page_bp-components tr.messages td.plugin-title span:before {
    211220        content: "\f457";
    212221}
    213222
     223.toplevel_page_buddypress-menu tr.forums td.plugin-title span:before,
    214224.settings_page_bp-components tr.forums td.plugin-title span:before {
    215225        content: "\f452";
    216226}
    217227
     228.toplevel_page_buddypress-menu tr.blogs td.plugin-title span:before,
    218229.settings_page_bp-components tr.blogs td.plugin-title span:before {
    219230        content: "\f120";
    220231}
    221232
     233.toplevel_page_buddypress-menu tr.friends td.plugin-title span:before,
    222234.settings_page_bp-components tr.friends td.plugin-title span:before {
    223235        content: "\f454";
    224236}
    225237
     238.toplevel_page_buddypress-menu tr.core td.plugin-title span:before,
    226239.settings_page_bp-components tr.core td.plugin-title span:before {
    227240        content: "\f448";
    228241}
    229242
     243.toplevel_page_buddypress-menu tr.members td.plugin-title span:before,
    230244.settings_page_bp-components tr.members td.plugin-title span:before {
    231245        content: "\f307";
    232246}
     
    236250}
    237251
    238252@media screen and ( max-width: 782px ) {
     253        .toplevel_page_buddypress-menu td.plugin-title span,
    239254        .settings_page_bp-components td.plugin-title span {
    240255                margin-top: 5px;
    241256        }
  • src/bp-core/admin/css/common.css

     
    169169        content: "\f108";
    170170}
    171171
    172 #adminmenu li.toplevel_page_bp-components .wp-menu-image,
    173 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image {
     172#adminmenu #toplevel_page_buddypress-menu .wp-menu-image:before,
     173#adminmenu #toplevel_page_buddypress-menu_user .wp-menu-image:before,
     174#adminmenu #toplevel_page_buddypress-menu_network .wp-menu-image:before {
    174175        content: "\f448";
    175176}
    176177
    177178/* Settings - Dashicons (WP 3.8+) */
     179.toplevel_page_buddypress-menu td.plugin-title span,
    178180.settings_page_bp-components td.plugin-title span {
    179181        float: left;
    180182        width: 18px;
     
    182184        margin-right: 5px;
    183185}
    184186
     187.toplevel_page_buddypress-menu td.plugin-title span:before,
    185188.settings_page_bp-components td.plugin-title span:before {
    186189        font-family: 'dashicons';
    187190        font-size: 18px;
    188191}
    189192
     193.toplevel_page_buddypress-menu tr.activity td.plugin-title span:before,
    190194.settings_page_bp-components tr.activity td.plugin-title span:before {
    191195        content: "\f452";
    192196}
    193197
     198.toplevel_page_buddypress-menu tr.notifications td.plugin-title span:before,
    194199.settings_page_bp-components tr.notifications td.plugin-title span:before {
    195200        content: "\f339";
    196201}
    197202
     203.toplevel_page_buddypress-menu tr.xprofile td.plugin-title span:before,
    198204.settings_page_bp-components tr.xprofile td.plugin-title span:before {
    199205        content: "\f336";
    200206}
    201207
     208.toplevel_page_buddypress-menu tr.settings td.plugin-title span:before,
    202209.settings_page_bp-components tr.settings td.plugin-title span:before {
    203210        content: "\f108";
    204211}
    205212
     213.toplevel_page_buddypress-menu tr.groups td.plugin-title span:before,
    206214.settings_page_bp-components tr.groups td.plugin-title span:before {
    207215        content: "\f456";
    208216}
    209217
     218.toplevel_page_buddypress-menu tr.messages td.plugin-title span:before,
    210219.settings_page_bp-components tr.messages td.plugin-title span:before {
    211220        content: "\f457";
    212221}
    213222
     223.toplevel_page_buddypress-menu tr.forums td.plugin-title span:before,
    214224.settings_page_bp-components tr.forums td.plugin-title span:before {
    215225        content: "\f452";
    216226}
    217227
     228.toplevel_page_buddypress-menu tr.blogs td.plugin-title span:before,
    218229.settings_page_bp-components tr.blogs td.plugin-title span:before {
    219230        content: "\f120";
    220231}
    221232
     233.toplevel_page_buddypress-menu tr.friends td.plugin-title span:before,
    222234.settings_page_bp-components tr.friends td.plugin-title span:before {
    223235        content: "\f454";
    224236}
    225237
     238.toplevel_page_buddypress-menu tr.core td.plugin-title span:before,
    226239.settings_page_bp-components tr.core td.plugin-title span:before {
    227240        content: "\f448";
    228241}
    229242
     243.toplevel_page_buddypress-menu tr.members td.plugin-title span:before,
    230244.settings_page_bp-components tr.members td.plugin-title span:before {
    231245        content: "\f307";
    232246}
     
    236250}
    237251
    238252@media screen and ( max-width: 782px ) {
     253        .toplevel_page_buddypress-menu td.plugin-title span,
    239254        .settings_page_bp-components td.plugin-title span {
    240255                margin-top: 5px;
    241256        }
  • src/bp-core/classes/class-bp-admin.php

     
    181181                add_filter( 'ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 );
    182182                add_filter( 'user_row_actions',    'bp_core_admin_user_row_actions', 10, 2 );
    183183
     184                // BuddyPress top level menu.
     185                add_filter( 'bp_admin_menu_order', array( $this, 'bp_core_top_level_admin_menu_order' ), 1 );
     186
    184187                // Emails
    185188                add_filter( 'bp_admin_menu_order', array( $this, 'emails_admin_menu_order' ), 20 );
    186189        }
     
    191194         * Contextually hooked to site or network-admin depending on current configuration.
    192195         *
    193196         * @since 1.6.0
     197         * @since 2.5.0 Add back the BuddyPress top level menu.
    194198         *
    195199         * @uses add_management_page() To add the Recount page in Tools section.
    196200         * @uses add_options_page() To add the Forums settings page in Settings
     
    221225                        array( $this, 'credits_screen' )
    222226                );
    223227
     228                // Admin Links.
     229                add_dashboard_page(
     230                        __( 'Welcome to BuddyPress',  'buddypress' ),
     231                        __( 'Welcome to BuddyPress',  'buddypress' ),
     232                        'manage_options',
     233                        'bp-admin-links',
     234                        array( $this, 'admin_links_screen' )
     235                );
     236
    224237                $hooks = array();
    225238
    226                 // Changed in BP 1.6 . See bp_core_admin_backpat_menu().
     239                // Changed in BP 2.5.0. Bring back top level menu.
    227240                $hooks[] = add_menu_page(
    228241                        __( 'BuddyPress', 'buddypress' ),
    229242                        __( 'BuddyPress', 'buddypress' ),
    230243                        $this->capability,
    231                         'bp-general-settings',
    232                         'bp_core_admin_backpat_menu',
    233                         'div'
     244                        'buddypress-menu',
     245                        'bp_core_admin_components_settings'
    234246                );
    235247
    236248                $hooks[] = add_submenu_page(
     249                        'buddypress-menu',
     250                        __( 'Settings', 'buddypress' ),
     251                        __( 'Settings', 'buddypress' ),
     252                        $this->capability,
     253                        'buddypress-menu',
     254                        'bp_core_admin_components_settings'
     255                );
     256
     257                $hooks[] = add_submenu_page(
     258                        'buddypress-menu',
     259                        __( 'Admin Links', 'buddypress' ),
     260                        __( 'Admin Links', 'buddypress' ),
     261                        $this->capability,
     262                        'bp-admin-links',
     263                        'admin_links_screen'
     264                );
     265
     266                $hooks[] = add_submenu_page(
    237267                        'bp-general-settings',
    238268                        __( 'BuddyPress Help', 'buddypress' ),
    239269                        __( 'Help', 'buddypress' ),
     
    331361        }
    332362
    333363        /**
     364         * Add the BuddyPress top level menu to custom menus array.
     365         *
     366         * This ensures that the BuddyPress top level menu item appears
     367         * in the proper order on the main Dashboard menu.
     368         *
     369         * @since 2.5.0
     370         *
     371         * @param array $custom_menus Array of BP top-level menu items.
     372         * @return array Menu item array, with BuddyPress menu added.
     373         */
     374        public function bp_core_top_level_admin_menu_order( $custom_menus = array() ) {
     375                array_push( $custom_menus, 'buddypress-menu' );
     376                return $custom_menus;
     377        }
     378
     379        /**
    334380         * Register site-admin nav menu elements.
    335381         *
    336382         * @since 2.5.0
     
    522568                // Network Admin Tools.
    523569                remove_submenu_page( 'network-tools', 'network-tools' );
    524570
    525                 // About and Credits pages.
    526                 remove_submenu_page( 'index.php', 'bp-about'   );
    527                 remove_submenu_page( 'index.php', 'bp-credits' );
     571                // About, Credits, and Admin Link pages.
     572                remove_submenu_page( 'index.php', 'bp-about'       );
     573                remove_submenu_page( 'index.php', 'bp-credits'     );
     574                remove_submenu_page( 'index.php', 'bp-admin-links' );
    528575        }
    529576
    530577        /**
     
    552599
    553600                        <?php self::tab_navigation( __METHOD__ ); ?>
    554601
    555                         <?php if ( self::is_new_install() ) : ?>
    556 
    557                                 <div id="welcome-panel" class="welcome-panel">
    558                                         <div class="welcome-panel-content">
    559                                                 <h3 style="margin:0"><?php _e( 'Getting Started with BuddyPress', 'buddypress' ); ?></h3>
    560                                                 <div class="welcome-panel-column-container">
    561                                                         <div class="welcome-panel-column">
    562                                                                 <h4><?php _e( 'Configure BuddyPress', 'buddypress' ); ?></h4>
    563                                                                 <ul>
    564                                                                         <li><?php printf(
    565                                                                         '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Set Up Components', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) )
    566                                                                         ); ?></li>
    567                                                                         <li><?php printf(
    568                                                                         '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Assign Components to Pages', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), $this->settings_page ) ) )
    569                                                                         ); ?></li>
    570                                                                         <li><?php printf(
    571                                                                         '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Customize Settings', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), $this->settings_page ) ) )
    572                                                                         ); ?></li>
    573                                                                 </ul>
    574                                                                 <a class="button button-primary button-hero" style="margin-bottom:20px;margin-top:0;" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Get Started', 'buddypress' ); ?></a>
    575                                                         </div>
    576                                                         <div class="welcome-panel-column">
    577                                                                 <h4><?php _e( 'Administration Tools', 'buddypress' ); ?></h4>
    578                                                                 <ul>
    579                                                                         <?php if ( bp_is_active( 'members' ) ) : ?>
    580                                                                                 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add User Profile Fields', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ) ) ); ?></li>
    581                                                                         <?php endif; ?>
    582                                                                         <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage User Signups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-signups' ), 'users.php' ) ) ) ); ?></li>
    583                                                                         <?php if ( bp_is_active( 'activity' ) ) : ?>
    584                                                                                 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Moderate Activity Streams', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-activity' ), 'admin.php' ) ) ) ); ?></li>
    585                                                                         <?php endif; ?>
    586                                                                         <?php if ( bp_is_active( 'groups' ) ) : ?>
    587                                                                                 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage Groups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) ) ); ?></li>
    588                                                                         <?php endif; ?>
    589                                                                         <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Repair Data', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), 'tools.php' ) ) ) ); ?>
    590                                                                         </li>
    591                                                                 </ul>
    592                                                         </div>
    593                                                         <div class="welcome-panel-column welcome-panel-last">
    594                                                                 <h4><?php _e( 'Community and Support', 'buddypress'  ); ?></h4>
    595                                                                 <p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Looking for help? The <a href="https://codex.buddypress.org/">BuddyPress Codex</a> has you covered.', 'buddypress' ) ?></p>
    596                                                                 <p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Can&#8217;t find what you need? Stop by <a href="https://buddypress.org/support/">our support forums</a>, where active BuddyPress users and developers are waiting to share tips and more.', 'buddypress' ) ?></p>
    597                                                         </div>
    598                                                 </div>
    599                                         </div>
    600                                 </div>
    601 
    602                         <?php endif; ?>
    603 
    604602                        <div class="headline-feature">
    605603                                <h3><?php esc_html_e( 'Cover Images For Members And Groups', 'buddypress' ); ?></h3>
    606604
     
    824822        }
    825823
    826824        /**
     825         * Output the Admin Links screen.
     826         *
     827         * @since 2.5.0
     828         */
     829        public function admin_links_screen() {
     830        ?>
     831
     832                <div class="wrap about-wrap">
     833
     834                        <?php self::welcome_text(); ?>
     835
     836                        <?php self::tab_navigation( __METHOD__ ); ?>
     837
     838                                <table class="form-table">
     839                                        <tbody>
     840                                                <tr>
     841                                                        <th scope="row"><?php _e( 'BuddyPress Settings', 'buddypress' ); ?></th>
     842                                                        <td>
     843                                                                <p><?php printf('<a href="%s">' . __( 'Settings &mdash; BuddyPress &mdash; Components', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ) ); ?></p>
     844                                                                <p><?php printf('<a href="%s">' . __( 'Settings &mdash; BuddyPress &mdash; Pages', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), $this->settings_page ) ) ) ); ?></p>
     845                                                                <p><?php printf('<a href="%s">' . __( 'Settings &mdash; BuddyPress &mdash; Options', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), $this->settings_page ) ) ) ); ?></p>
     846                                                        </td>
     847                                                </tr>
     848                                                <tr>
     849                                                        <th scope="row"><?php _e( 'Check Pending Users', 'buddypress' ); ?></th>
     850                                                        <td>
     851                                                                <p><?php printf( '<a href="%s">' . __( 'Users &mdash; Manage Signups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-signups' ), 'users.php' ) ) ) ); ?></p>
     852                                                        </td>
     853                                                </tr>
     854                                                <?php if ( bp_is_active( 'xprofile' ) ) : ?>
     855                                                        <tr>
     856                                                                <th scope="row"><?php _e( 'Add User Profile Fields', 'buddypress' ); ?></th>
     857                                                                <td>
     858                                                                        <p><?php printf( '<a href="%s">' . __( 'Users &mdash; Profile Fields', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ) ) ); ?></p>
     859                                                                </td>
     860                                                        </tr>
     861                                                <?php endif; ?>
     862                                                <?php if ( bp_is_active( 'activity' ) ) : ?>
     863                                                        <tr>
     864                                                                <th scope="row"><?php _e( 'Moderate Activities', 'buddypress' ); ?></th>
     865                                                                <td>
     866                                                                        <p><?php printf( '<a href="%s">' . __( 'List of Sitewide Activities', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-activity' ), 'admin.php' ) ) ) ); ?></p>
     867                                                                </td>
     868                                                        </tr>
     869                                                <?php endif; ?>
     870                                                <?php if ( bp_is_active( 'groups' ) ) : ?>
     871                                                        <tr>
     872                                                                <th scope="row"><?php _e( 'Manage Groups', 'buddypress' ); ?></th>
     873                                                                <td>
     874                                                                        <p><?php printf( '<a href="%s">' . __( 'List of all Groups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) ) ); ?></p>
     875                                                                </td>
     876                                                        </tr>
     877                                                <?php endif; ?>
     878                                                <tr>
     879                                                        <th scope="row"><?php _e( 'Customize Emails', 'buddypress' ); ?></th>
     880                                                        <td>
     881                                                                <?php if ( bp_is_network_activated() ) : ?>
     882                                                                        <p><?php printf( '<a href="%s">' . __( 'List of Email Templates', 'buddypress' ) . '</a>', esc_url( get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() ) ) ); ?></p>
     883                                                                <?php else : ?>
     884                                                                        <p><?php printf( '<a href="%s">' . __( 'List of Email Templates', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'post_type' => 'bp-email' ), 'edit.php' ) ) ) ); ?></p>
     885                                                                <?php endif; ?>
     886                                                                <?php if ( bp_is_network_activated() ) : ?>
     887                                                                        <p><?php printf( '<a href="%s">' . __( 'Add New Email Template', 'buddypress' ) . '</a>', esc_url( get_admin_url( bp_get_root_blog_id(), 'post-new.php?post_type=' . bp_get_email_post_type() ) ) ); ?></p>
     888                                                                <?php else : ?>
     889                                                                        <p><?php printf( '<a href="%s">' . __( 'Add New Email Template', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'post_type' => 'bp-email' ), 'post-new.php' ) ) ) ); ?></p>
     890                                                                <?php endif; ?>
     891                                                                <p><?php _e( 'Appearance &mdash; Emails', 'buddypress' ); ?></p>
     892                                                        </td>
     893                                                </tr>
     894                                                <tr>
     895                                                        <th scope="row"><?php _e( 'Repair Data', 'buddypress' ); ?></th>
     896                                                        <td>
     897                                                                <p><?php printf( '<a href="%s">' . __( 'Tools &mdash; BuddyPress', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), 'tools.php' ) ) ) ); ?></p>
     898                                                        </td>
     899                                                </tr>
     900                                                <tr>
     901                                                        <th scope="row"><?php _e( 'Community and Support', 'buddypress'  ); ?></th>
     902                                                        <td>
     903                                                                <p><?php _e( 'Looking for help? The <a href="https://codex.buddypress.org/">BuddyPress Codex</a> has you covered.', 'buddypress' ) ?></p>
     904                                                                <p><?php _e( 'Can&#8217;t find what you need? Stop by <a href="https://buddypress.org/support/">our support forums</a>, where active BuddyPress users and developers are waiting to share tips and more.', 'buddypress' ) ?></p>
     905                                                        </td>
     906                                                </tr>
     907                                        </tbody>
     908                                </table>
     909
     910                <?php
     911        }
     912
     913        /**
    827914         * Output welcome text and badge for What's New and Credits pages.
    828915         *
    829916         * @since 2.2.0
     
    869956                                <?php esc_html_e( 'What&#8217;s New', 'buddypress' ); ?>
    870957                        </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' ) ) ); ?>">
    871958                                <?php esc_html_e( 'Credits', 'buddypress' ); ?>
    872                         </a>
     959                        </a><a class="nav-tab <?php if ( 'BP_Admin::admin_links_screen' === $tab ) : ?>nav-tab-active<?php endif; ?>" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-admin-links' ), 'index.php' ) ) ); ?>">
     960                                <?php esc_html_e( 'Admin Links', 'buddypress' ); ?>
     961                         </a>
    873962                </h2>
    874963
    875964        <?php