Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/15/2015 07:57:03 PM (9 years ago)
Author:
tw2113
Message:

[Samus Aran]
I first battled the documentation inconsistencies on planet Zebes. It was there that I foiled the plans of the
Space Pirate leader Mother Brain to use the issues to attack galactic civilization...

I next fought the inconsistencies on their homeworld SR388. I completely eradicated them except for an @since tag,
which after hatching followed me like a confused child...

I personally delivered it to the Galactic Research Station at Ceres so scientists could study its energy production qualities...

The scientists' findings were astounding! They discovered that the powers of the docs inconsistencies
might be harnessed for the good of galactic civilization!

Satisfied that all was well, I left the station to seek a new bounty to hunt. But, I had hardly gone beyond the asteroid
belt when I picked up a distress signal!

Ceres station was under attack!

More documentation cleanup for part of BP-Core component.

See #6398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-admin.php

    r10318 r10356  
    1717 * @package BuddyPress
    1818 * @subpackage CoreAdministration
    19  * @todo Break this apart into each applicable Component
     19 * @todo Break this apart into each applicable Component.
    2020 *
    2121 * @since 1.6.0
     
    9797
    9898        // Paths and URLs
    99         $this->admin_dir  = trailingslashit( $bp->plugin_dir  . 'bp-core/admin' ); // Admin path
    100         $this->admin_url  = trailingslashit( $bp->plugin_url  . 'bp-core/admin' ); // Admin url
    101         $this->images_url = trailingslashit( $this->admin_url . 'images'        ); // Admin images URL
    102         $this->css_url    = trailingslashit( $this->admin_url . 'css'           ); // Admin css URL
    103         $this->js_url     = trailingslashit( $this->admin_url . 'js'            ); // Admin css URL
    104 
    105         // Main settings page
     99        $this->admin_dir  = trailingslashit( $bp->plugin_dir  . 'bp-core/admin' ); // Admin path.
     100        $this->admin_url  = trailingslashit( $bp->plugin_url  . 'bp-core/admin' ); // Admin url.
     101        $this->images_url = trailingslashit( $this->admin_url . 'images'        ); // Admin images URL.
     102        $this->css_url    = trailingslashit( $this->admin_url . 'css'           ); // Admin css URL.
     103        $this->js_url     = trailingslashit( $this->admin_url . 'js'            ); // Admin css URL.
     104
     105        // Main settings page.
    106106        $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
    107107
    108         // Main capability
     108        // Main capability.
    109109        $this->capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options';
    110110    }
     
    134134    private function setup_actions() {
    135135
    136         /** General Actions ***************************************************/
    137 
    138         // Add some page specific output to the <head>
     136        /* General Actions ***************************************************/
     137
     138        // Add some page specific output to the <head>.
    139139        add_action( 'bp_admin_head',            array( $this, 'admin_head'  ), 999 );
    140140
    141         // Add menu item to settings menu
     141        // Add menu item to settings menu.
    142142        add_action( bp_core_admin_hook(),       array( $this, 'admin_menus' ), 5 );
    143143
    144         // Enqueue all admin JS and CSS
     144        // Enqueue all admin JS and CSS.
    145145        add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
    146146
    147         /** BuddyPress Actions ************************************************/
    148 
    149         // Load the BuddyPress metabox in the WP Nav Menu Admin UI
     147        /* BuddyPress Actions ************************************************/
     148
     149        // Load the BuddyPress metabox in the WP Nav Menu Admin UI.
    150150        add_action( 'load-nav-menus.php', 'bp_admin_wp_nav_menu_meta_box' );
    151151
    152         // Add settings
     152        // Add settings.
    153153        add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) );
    154154
    155         // Add a link to BuddyPress About page to the admin bar
     155        // Add a link to BuddyPress About page to the admin bar.
    156156        add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 15 );
    157157
    158         // Add a description of new BuddyPress tools in the available tools page
     158        // Add a description of new BuddyPress tools in the available tools page.
    159159        add_action( 'tool_box',            'bp_core_admin_available_tools_intro' );
    160160        add_action( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' );
    161161
    162         // On non-multisite, catch
     162        // On non-multisite, catch.
    163163        add_action( 'load-users.php', 'bp_core_admin_user_manage_spammers' );
    164164
    165         /** Filters ***********************************************************/
    166 
    167         // Add link to settings page
     165        /* Filters ***********************************************************/
     166
     167        // Add link to settings page.
    168168        add_filter( 'plugin_action_links',               array( $this, 'modify_plugin_action_links' ), 10, 2 );
    169169        add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );
    170170
    171         // Add "Mark as Spam" row actions on users.php
     171        // Add "Mark as Spam" row actions on users.php.
    172172        add_filter( 'ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 );
    173173        add_filter( 'user_row_actions',    'bp_core_admin_user_row_actions', 10, 2 );
     
    185185    public function admin_menus() {
    186186
    187         // Bail if user cannot moderate
     187        // Bail if user cannot moderate.
    188188        if ( ! bp_current_user_can( 'manage_options' ) ) {
    189189            return;
    190190        }
    191191
    192         // About
     192        // About.
    193193        add_dashboard_page(
    194194            __( 'Welcome to BuddyPress',  'buddypress' ),
     
    199199        );
    200200
    201         // Credits
     201        // Credits.
    202202        add_dashboard_page(
    203203            __( 'Welcome to BuddyPress',  'buddypress' ),
     
    210210        $hooks = array();
    211211
    212         // Changed in BP 1.6 . See bp_core_admin_backpat_menu()
     212        // Changed in BP 1.6 . See bp_core_admin_backpat_menu().
    213213        $hooks[] = add_menu_page(
    214214            __( 'BuddyPress', 'buddypress' ),
     
    229229        );
    230230
    231         // Add the option pages
     231        // Add the option pages.
    232232        $hooks[] = add_submenu_page(
    233233            $this->settings_page,
     
    258258
    259259        // For consistency with non-Multisite, we add a Tools menu in
    260         // the Network Admin as a home for our Tools panel
     260        // the Network Admin as a home for our Tools panel.
    261261        if ( is_multisite() && bp_core_do_network_admin() ) {
    262262            $tools_parent = 'network-tools';
     
    269269                'bp_core_tools_top_level_item',
    270270                '',
    271                 24 // just above Settings
     271                24 // Just above Settings.
    272272            );
    273273
     
    293293        );
    294294
    295         // Fudge the highlighted subnav item when on a BuddyPress admin page
     295        // Fudge the highlighted subnav item when on a BuddyPress admin page.
    296296        foreach( $hooks as $hook ) {
    297297            add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
     
    310310    public function register_admin_settings() {
    311311
    312         /** Main Section ******************************************************/
    313 
    314         // Add the main section
     312        /* Main Section ******************************************************/
     313
     314        // Add the main section.
    315315        add_settings_section( 'bp_main', __( 'Main Settings', 'buddypress' ), 'bp_admin_setting_callback_main_section', 'buddypress' );
    316316
    317         // Hide toolbar for logged out users setting
     317        // Hide toolbar for logged out users setting.
    318318        add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
    319319        register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
    320320
    321         // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade
     321        // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade.
    322322        if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
    323323            add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
     
    325325        }
    326326
    327         // Allow account deletion
     327        // Allow account deletion.
    328328        add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
    329329        register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
    330330
    331         /** XProfile Section **************************************************/
     331        /* XProfile Section **************************************************/
    332332
    333333        if ( bp_is_active( 'xprofile' ) ) {
    334334
    335             // Add the main section
     335            // Add the main section.
    336336            add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' );
    337337
    338             // Avatars
     338            // Avatars.
    339339            add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' );
    340340            register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
    341341
    342             // Cover images
     342            // Cover images.
    343343            if ( bp_is_active( 'xprofile', 'cover_image' ) ) {
    344344                add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_xprofile' );
     
    346346            }
    347347
    348             // Profile sync setting
     348            // Profile sync setting.
    349349            add_settings_field( 'bp-disable-profile-sync',   __( 'Profile Syncing',  'buddypress' ), 'bp_admin_setting_callback_profile_sync', 'buddypress', 'bp_xprofile' );
    350350            register_setting  ( 'buddypress', 'bp-disable-profile-sync', 'intval' );
    351351        }
    352352
    353         /** Groups Section ****************************************************/
     353        /* Groups Section ****************************************************/
    354354
    355355        if ( bp_is_active( 'groups' ) ) {
    356356
    357             // Add the main section
     357            // Add the main section.
    358358            add_settings_section( 'bp_groups', __( 'Groups Settings',  'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' );
    359359
    360             // Allow subscriptions setting
     360            // Allow subscriptions setting.
    361361            add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation',   'buddypress', 'bp_groups' );
    362362            register_setting( 'buddypress', 'bp_restrict_group_creation', 'intval' );
     
    373373        }
    374374
    375         /** Forums ************************************************************/
     375        /* Forums ************************************************************/
    376376
    377377        if ( bp_is_active( 'forums' ) ) {
    378378
    379             // Add the main section
     379            // Add the main section.
    380380            add_settings_section( 'bp_forums', __( 'Legacy Group Forums', 'buddypress' ), 'bp_admin_setting_callback_bbpress_section', 'buddypress' );
    381381
    382             // Allow subscriptions setting
     382            // Allow subscriptions setting.
    383383            add_settings_field( 'bb-config-location', __( 'bbPress Configuration', 'buddypress' ), 'bp_admin_setting_callback_bbpress_configuration', 'buddypress', 'bp_forums' );
    384384            register_setting( 'buddypress', 'bb-config-location', '' );
    385385        }
    386386
    387         /** Activity Section **************************************************/
     387        /* Activity Section **************************************************/
    388388
    389389        if ( bp_is_active( 'activity' ) ) {
    390390
    391             // Add the main section
     391            // Add the main section.
    392392            add_settings_section( 'bp_activity', __( 'Activity Settings', 'buddypress' ), 'bp_admin_setting_callback_activity_section', 'buddypress' );
    393393
    394             // Activity commenting on blog and forum posts
     394            // Activity commenting on blog and forum posts.
    395395            add_settings_field( 'bp-disable-blogforum-comments', __( 'Blog &amp; Forum Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' );
    396396            register_setting( 'buddypress', 'bp-disable-blogforum-comments', 'bp_admin_sanitize_callback_blogforum_comments' );
    397397
    398             // Activity Heartbeat refresh
     398            // Activity Heartbeat refresh.
    399399            add_settings_field( '_bp_enable_heartbeat_refresh', __( 'Activity auto-refresh', 'buddypress' ), 'bp_admin_setting_callback_heartbeat', 'buddypress', 'bp_activity' );
    400400            register_setting( 'buddypress', '_bp_enable_heartbeat_refresh', 'intval' );
    401401
    402             // Allow activity akismet
     402            // Allow activity akismet.
    403403            if ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) {
    404404                add_settings_field( '_bp_enable_akismet', __( 'Akismet', 'buddypress' ), 'bp_admin_setting_callback_activity_akismet', 'buddypress', 'bp_activity' );
     
    433433     * @param array  $links Links array in which we would prepend our link.
    434434     * @param string $file  Current plugin basename.
    435      *
    436435     * @return array Processed links.
    437436     */
    438437    public function modify_plugin_action_links( $links, $file ) {
    439438
    440         // Return normal links if not BuddyPress
     439        // Return normal links if not BuddyPress.
    441440        if ( plugin_basename( buddypress()->basename ) != $file ) {
    442441            return $links;
    443442        }
    444443
    445         // Add a few links to the existing links array
     444        // Add a few links to the existing links array.
    446445        return array_merge( $links, array(
    447446            'settings' => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',
     
    457456    public function admin_head() {
    458457
    459         // Settings pages
     458        // Settings pages.
    460459        remove_submenu_page( $this->settings_page, 'bp-page-settings' );
    461460        remove_submenu_page( $this->settings_page, 'bp-settings'      );
    462461
    463         // Network Admin Tools
     462        // Network Admin Tools.
    464463        remove_submenu_page( 'network-tools', 'network-tools' );
    465464
    466         // About and Credits pages
     465        // About and Credits pages.
    467466        remove_submenu_page( 'index.php', 'bp-about'   );
    468467        remove_submenu_page( 'index.php', 'bp-credits' );
     
    797796    public static function welcome_text() {
    798797
    799         // Switch welcome text based on whether this is a new installation or not
     798        // Switch welcome text based on whether this is a new installation or not.
    800799        $welcome_text = ( self::is_new_install() )
    801800            ? __( 'Thank you for installing BuddyPress! BuddyPress helps you run any kind of social network on your WordPress, with member profiles, activity streams, user groups, messaging, and more.', 'buddypress' )
     
    825824     *
    826825     * @since 2.2.0
    827      * @param string $tab
     826     *
     827     * @param string $tab Tab to highlight as active.
    828828     */
    829829    public static function tab_navigation( $tab = 'whats_new' ) {
     
    865865    public static function display_version() {
    866866
    867         // Use static variable to prevent recalculations
     867        // Use static variable to prevent recalculations.
    868868        static $display = '';
    869869
    870         // Only calculate on first run
     870        // Only calculate on first run.
    871871        if ( '' === $display ) {
    872872
    873             // Get current version
     873            // Get current version.
    874874            $version = bp_get_version();
    875875
    876             // Check for prerelease hyphen
     876            // Check for prerelease hyphen.
    877877            $pre     = strpos( $version, '-' );
    878878
    879             // Strip prerelease suffix
     879            // Strip prerelease suffix.
    880880            $display = ( false !== $pre )
    881881                ? substr( $version, 0, $pre )
     
    887887    }
    888888}
    889 endif; // class_exists check
     889endif; // End class_exists check.
    890890
    891891/**
     
    902902
    903903    // These are strings we may use to describe maintenance/security releases, where we aim for no new strings.
    904 
    905904    _n_noop( 'Maintenance Release', 'Maintenance Releases', 'buddypress' );
    906905    _n_noop( 'Security Release', 'Security Releases', 'buddypress' );
Note: See TracChangeset for help on using the changeset viewer.