Skip to:
Content

BuddyPress.org

Changeset 6022


Ignore:
Timestamp:
05/11/2012 05:38:50 PM (14 years ago)
Author:
boonebgorges
Message:

Pinking shears in Core component

Location:
trunk/bp-core
Files:
8 edited

Legend:

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

    r5999 r6022  
    174174                add_action( 'admin_notices',         array( $this, 'admin_notices' ) );
    175175                add_action( 'network_admin_notices', array( $this, 'admin_notices' ) );
    176                
     176
    177177                // Enqueue all admin JS and CSS
    178178                add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts'   ) );
     
    237237                // Not in maintenance mode
    238238                } else {
    239        
     239
    240240                        // Bail if user cannot moderate
    241241                        if ( ! bp_current_user_can( 'manage_options' ) )
     
    349349                        // Allow subscriptions setting
    350350                        add_settings_field( '_bp_group_creation', __( 'Group Creation',   'buddypress' ), 'bp_admin_setting_callback_group_creation',   'buddypress', 'bp_groups' );
    351                         register_setting  ( 'buddypress',         '_bp_group_creation',   'intval'                                                                                );                   
     351                        register_setting  ( 'buddypress',         '_bp_group_creation',   'intval'                                                                                );
    352352                }
    353353
     
    540540         *
    541541         * @global string $pagenow
    542          * @return If no notice is needed 
     542         * @return If no notice is needed
    543543         */
    544544        public function admin_notices() {
  • trunk/bp-core/bp-core-avatars.php

    r5956 r6022  
    1515function bp_core_set_avatar_constants() {
    1616        global $bp;
    17        
     17
    1818        if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
    1919                define( 'BP_AVATAR_THUMB_WIDTH', 50 );
     
    113113
    114114        /** Set item_id ***********************************************************/
    115        
     115
    116116        if ( empty( $item_id ) ) {
    117117
     
    130130
    131131                                break;
    132                        
     132
    133133                        case 'user'  :
    134134                        default      :
     
    145145
    146146        $class = apply_filters( 'bp_core_avatar_class', $class, $item_id, $object, $params );
    147        
     147
    148148        /** Set avatar_dir ********************************************************/
    149149
     
    164164
    165165                                break;
    166                        
     166
    167167                        case 'user'  :
    168168                        default      :
     
    181181
    182182        if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) {
    183                
     183
    184184                // Get item name for alt/title tags
    185185                $item_name = '';
     
    194194                                $item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) );
    195195                                break;
    196                        
     196
    197197                        case 'user'  :
    198198                        default :
     
    207207        /** Sanity Checks *********************************************************/
    208208
    209         // Get a fallback for the 'alt' parameter       
     209        // Get a fallback for the 'alt' parameter
    210210        if ( empty( $alt ) )
    211211                $alt = __( 'Avatar Image', 'buddypress' );
     
    727727function bp_core_avatar_upload_path() {
    728728        global $bp;
    729        
     729
    730730        // See if the value has already been calculated and stashed in the $bp global
    731731        if ( isset( $bp->avatar->upload_path ) ) {
     
    740740                                switch_to_blog( bp_get_root_blog_id() );
    741741                        }
    742                        
     742
    743743                        // Get upload directory information from current site
    744744                        $upload_dir = wp_upload_dir();
    745                
     745
    746746                        // Directory does not exist and cannot be created
    747747                        if ( !empty( $upload_dir['error'] ) ) {
    748748                                $basedir = '';
    749                
     749
    750750                        } else {
    751751                                $basedir = $upload_dir['basedir'];
    752752                        }
    753                        
     753
    754754                        // Will bail if not switched
    755755                        restore_current_blog();
    756756                }
    757                
     757
    758758                // Stash in $bp for later use
    759759                $bp->avatar->upload_path = $basedir;
    760760        }
    761        
     761
    762762        return apply_filters( 'bp_core_avatar_upload_path', $basedir );
    763763}
     
    773773function bp_core_avatar_url() {
    774774        global $bp;
    775        
     775
    776776        // See if the value has already been calculated and stashed in the $bp global
    777777        if ( isset( $bp->avatar->url ) ) {
     
    785785                        // Get upload directory information from current site
    786786                        $upload_dir = wp_upload_dir();
    787                
     787
    788788                        // Directory does not exist and cannot be created
    789789                        if ( !empty( $upload_dir['error'] ) ) {
    790790                                $baseurl = '';
    791                
     791
    792792                        } else {
    793793                                $baseurl = $upload_dir['baseurl'];
     
    841841function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
    842842        global $bp;
    843        
     843
    844844        $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false;
    845        
     845
    846846        return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
    847847}
     
    905905function bp_core_avatar_original_max_width() {
    906906        global $bp;
    907        
     907
    908908        return apply_filters( 'bp_core_avatar_original_max_width', (int) $bp->avatar->original_max_width );
    909909}
     
    919919function bp_core_avatar_original_max_filesize() {
    920920        global $bp;
    921        
     921
    922922        return apply_filters( 'bp_core_avatar_original_max_filesize', (int) $bp->avatar->original_max_filesize );
    923923}
     
    933933function bp_core_avatar_default() {
    934934        global $bp;
    935        
     935
    936936        return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default );
    937937}
     
    947947function bp_core_avatar_default_thumb() {
    948948        global $bp;
    949        
     949
    950950        return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default );
    951951}
  • trunk/bp-core/bp-core-classes.php

    r6015 r6022  
    275275                                        $uids = $wpdb->escape( $include );
    276276                                }
    277        
     277
    278278                                if ( !empty( $uids ) ) {
    279279                                        $sql['where_users'] = "AND u.ID IN ({$uids})";
     
    282282                                $friend_ids = friends_get_friend_user_ids( $user_id );
    283283                                $friend_ids = $wpdb->escape( implode( ',', (array) $friend_ids ) );
    284        
     284
    285285                                if ( !empty( $friend_ids ) ) {
    286286                                        $sql['where_friends'] = "AND u.ID IN ({$friend_ids})";
    287        
     287
    288288                                // User has no friends, return false since there will be no users to fetch.
    289289                                } else {
  • trunk/bp-core/bp-core-filters.php

    r5927 r6022  
    2222function bp_core_exclude_pages( $pages ) {
    2323        global $bp;
    24        
     24
    2525        if ( bp_is_root_blog() ) {
    2626                if ( !empty( $bp->pages->activate ) )
    2727                        $pages[] = $bp->pages->activate->id;
    28        
     28
    2929                if ( !empty( $bp->pages->register ) )
    3030                        $pages[] = $bp->pages->register->id;
    31        
     31
    3232                if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) )
    3333                        $pages[] = $bp->pages->forums->id;
     
    279279                // Get the component's ID to try and get it's name
    280280                $component_id = $component_name = bp_current_component();
    281                
     281
    282282                // Use the actual component name
    283283                if ( !empty( $bp->{$component_id}->name ) ) {
    284284                        $component_name = $bp->{$component_id}->name;
    285                        
     285
    286286                // Fall back on the component ID (probably same as current_component)
    287287                } elseif ( !empty( $bp->{$component_id}->id ) ) {
  • trunk/bp-core/bp-core-functions.php

    r6015 r6022  
    7777                if ( !empty( $bp->db_version_raw ) )
    7878                        $retval = $bp->db_version_raw;
    79                
     79
    8080                return $retval;
    8181        }
     
    481481        if ( !is_user_logged_in() )
    482482                return false;
    483                
     483
    484484        $user_id = bp_loggedin_user_id();
    485485
     
    950950 * A utility for parsing individual function arguments into an array.
    951951 *
    952  * The purpose of this function is to help with backward compatibility in cases where 
     952 * The purpose of this function is to help with backward compatibility in cases where
    953953 *
    954954 *   function foo( $bar = 1, $baz = false, $barry = array(), $blip = false ) { // ...
  • trunk/bp-core/bp-core-loader.php

    r5721 r6022  
    3737         * This involves figuring out the currently required, active, deactive,
    3838         * and optional components.
    39          * 
    40          * @since BuddyPress (1.5)
    41          *
    42          * @global BuddyPress $bp 
     39         *
     40         * @since BuddyPress (1.5)
     41         *
     42         * @global BuddyPress $bp
    4343         */
    4444        private function bootstrap() {
     
    134134         * @since BuddyPress (1.5)
    135135         *
    136          * @global BuddyPress $bp 
     136         * @global BuddyPress $bp
    137137         */
    138138        function setup_globals() {
     
    241241 * @since BuddyPress (1.6)
    242242 *
    243  * @global BuddyPress $bp 
     243 * @global BuddyPress $bp
    244244 */
    245245function bp_setup_core() {
  • trunk/bp-core/bp-core-options.php

    r5976 r6022  
    8383                // Users from all sites can post
    8484                '_bp_enable_akismet'              => true,
    85                
     85
    8686                /** BuddyBar **********************************************************/
    8787
     
    125125 *
    126126 * @since BuddyPress (1.6)
    127  * 
     127 *
    128128 * @uses bp_get_default_options() To get default options
    129129 * @uses delete_option() Removes default options
     
    251251 * When switching from single to multisite we need to copy blog options to
    252252 * site options.
    253  * 
     253 *
    254254 * This function is no longer used
    255255 *
     
    322322                $root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta );
    323323        }
    324        
     324
    325325        // Missing some options, so do some one-time fixing
    326326        if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) {
     
    358358                        $root_blog_options_meta[$old_meta_key] = $old_meta_value;
    359359                }
    360                
     360
    361361                $root_blog_options_meta = array_merge( $root_blog_options_meta, $existing_options );
    362362                unset( $existing_options );
  • trunk/bp-core/bp-core-widgets.php

    r5930 r6022  
    3636
    3737                echo $before_widget;
    38                
     38
    3939                $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
    40                
     40
    4141                echo $before_title
    4242                   . $title
     
    9898        function update( $new_instance, $old_instance ) {
    9999                $instance = $old_instance;
    100                
     100
    101101                $instance['title']          = strip_tags( $new_instance['title'] );
    102102                $instance['max_members']    = strip_tags( $new_instance['max_members'] );
     
    123123
    124124                <p><label for="bp-core-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
    125                
     125
    126126                <p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Members directory', 'buddypress' ) ?></label></p>
    127127
Note: See TracChangeset for help on using the changeset viewer.