Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2009 06:56:42 PM (17 years ago)
Author:
apeatling
Message:

Merging last few trunk changes and stripping all whitespace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bp-core/bp-core-admin.php

    r2029 r2076  
    44        global $wpdb, $bp, $current_blog;
    55?>
    6        
     6
    77        <?php
    88        if ( isset( $_POST['bp-admin-submit'] ) && isset( $_POST['bp-admin'] ) ) {
    99                if ( !check_admin_referer('bp-admin') )
    1010                        return false;
    11                
     11
    1212                // Settings form submitted, now save the settings.
    1313                foreach ( $_POST['bp-admin'] as $key => $value ) {
    14                        
     14
    1515                        if ( function_exists( 'xprofile_install' ) ) {
    1616                                if ( 'bp-xprofile-base-group-name' == $key ) {
    1717                                        $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s WHERE name = %s AND id = 1", $value, stripslashes( get_site_option('bp-xprofile-base-group-name') ) ) );
    1818                                }
    19                                
     19
    2020                                if ( 'bp-xprofile-fullname-field-name' == $key ) {
    2121                                        $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET name = %s WHERE name = %s AND group_id = 1", $value, stripslashes( get_site_option('bp-xprofile-fullname-field-name') ) ) );
    2222                                }
    2323                        }
    24                        
     24
    2525                        update_site_option( $key, $value );
    2626                }
    2727        }
    2828        ?>
    29        
     29
    3030        <div class="wrap">
    31                
     31
    3232                <h2><?php _e( 'BuddyPress Settings', 'buddypress' ) ?></h2>
    3333
    … …  
    3939
    4040                <form action="" method="post" id="bp-admin-form">
    41                
     41
    4242                        <table class="form-table">
    4343                        <tbody>
    … …  
    4747                                        <td>
    4848                                                <input name="bp-admin[bp-xprofile-base-group-name]" id="bp-xprofile-base-group-name" value="<?php echo get_site_option('bp-xprofile-base-group-name') ?>" />
    49                                         </td>                   
     49                                        </td>
    5050                                </tr>
    5151                                <tr>
    … …  
    6060                                                <input type="radio" name="bp-admin[bp-disable-profile-sync]"<?php if ( (int)get_site_option( 'bp-disable-profile-sync' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-profile-sync" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
    6161                                                <input type="radio" name="bp-admin[bp-disable-profile-sync]"<?php if ( !(int)get_site_option( 'bp-disable-profile-sync' ) || '' == get_site_option( 'bp-disable-profile-sync' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-profile-sync" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
    62                                         </td>                   
     62                                        </td>
    6363                                </tr>
    6464                                <?php endif; ?>
    … …  
    6868                                                <input type="radio" name="bp-admin[hide-loggedout-adminbar]"<?php if ( (int)get_site_option( 'hide-loggedout-adminbar' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-hide-loggedout-adminbar-yes" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
    6969                                                <input type="radio" name="bp-admin[hide-loggedout-adminbar]"<?php if ( !(int)get_site_option( 'hide-loggedout-adminbar' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-hide-loggedout-adminbar-no" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
    70                                         </td>                   
     70                                        </td>
    7171                                </tr>
    7272                                <tr>
    … …  
    8383                                                <input type="radio" name="bp-admin[non-friend-wire-posting]"<?php if ( (int)get_site_option( 'non-friend-wire-posting' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-non-friend-wire-post" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
    8484                                                <input type="radio" name="bp-admin[non-friend-wire-posting]"<?php if ( !(int)get_site_option( 'non-friend-wire-posting' ) ) : ?> checked="checked"<?php endif; ?> id="bp-admin-non-friend-wire-post" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
    85                                         </td>                   
    86                                 </tr>
    87                                 <?php } ?>                             
     85                                        </td>
     86                                </tr>
     87                                <?php } ?>
    8888                                <tr>
    8989                                        <th scope="row"><?php _e( 'Disable user account deletion?', 'buddypress' ) ?>:</th>
    … …  
    9191                                                <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( (int)get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
    9292                                                <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( !(int)get_site_option( 'bp-disable-account-deletion' ) || '' == get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
    93                                         </td>                   
     93                                        </td>
    9494                                </tr>
    9595                                <?php if ( function_exists( 'bp_forums_setup') ) : ?>
    … …  
    9999                                                <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( (int)get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
    100100                                                <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( !(int)get_site_option( 'bp-disable-forum-directory' ) || '' == get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
    101                                         </td>                   
    102                                 </tr>                           
    103                                 <?php endif; ?>
    104                                
     101                                        </td>
     102                                </tr>
     103                                <?php endif; ?>
     104
    105105                                <?php $themes = bp_core_get_buddypress_themes() ?>
    106106                                <?php if ( $themes ) : ?>
    … …  
    109109                                                <td>
    110110                                                                <select name="bp-admin[active-member-theme]" id="active-member-theme">
    111                                                                 <?php 
    112                                                                 for ( $i = 0; $i < count($themes); $i++ ) { 
     111                                                                <?php
     112                                                                for ( $i = 0; $i < count($themes); $i++ ) {
    113113                                                                        if ( $themes[$i]['template'] == get_site_option( 'active-member-theme' ) ) {
    114114                                                                                $selected = ' selected="selected"';
    … …  
    120120                                                                <?php } ?>
    121121                                                        </select>
    122                                                 </td>                   
     122                                                </td>
    123123                                        </tr>
    124124                                <?php else : ?>
    … …  
    129129                                        <?php endif; ?>
    130130                                <?php endif; ?>
    131                                                        
     131
    132132                                <tr>
    133133                                        <th scope="row"><?php _e( 'Default User Avatar', 'buddypress' ) ?></th>
    … …  
    147147
    148148                        <?php do_action( 'bp_core_admin_screen' ) ?>
    149                        
     149
    150150                        <p class="submit">
    151151                                <input class="button-primary" type="submit" name="bp-admin-submit" id="bp-admin-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
    … …  
    153153
    154154                        <?php wp_nonce_field( 'bp-admin' ) ?>
    155                
     155
    156156                </form>
    157                
     157
    158158        </div>
    159        
    160 <?php 
     159
     160<?php
    161161}
    162162
    … …  
    164164        global $wpdb, $bp;
    165165?>
    166        
     166
    167167        <?php
    168168        if ( isset( $_POST['bp-admin-component-submit'] ) && isset( $_POST['bp_components'] ) ) {
    169169                if ( !check_admin_referer('bp-admin-component-setup') )
    170170                        return false;
    171                
     171
    172172                // Settings form submitted, now save the settings.
    173173                foreach ( $_POST['bp_components'] as $key => $value ) {
    174174                        if ( !(int) $value )
    175                                 $disabled[$key] = 1;   
     175                                $disabled[$key] = 1;
    176176                }
    177177                update_site_option( 'bp-deactivated-components', $disabled );
    178178        }
    179179        ?>
    180        
     180
    181181        <div class="wrap">
    182                
     182
    183183                <h2><?php _e( 'BuddyPress Component Setup', 'buddypress' ) ?></h2>
    184                
     184
    185185                <?php if ( isset( $_POST['bp-admin-component-submit'] ) ) : ?>
    186186                        <div id="message" class="updated fade">
    … …  
    188188                        </div>
    189189                <?php endif; ?>
    190        
     190
    191191                <form action="" method="post" id="bp-admin-component-form">
    192                
     192
    193193                        <p>
    194                         <?php _e( 
    195                                 'By default, all BuddyPress components are enabled. You can selectively disable any of the 
     194                        <?php _e(
     195                                'By default, all BuddyPress components are enabled. You can selectively disable any of the
    196196                                components by using the form below. Your BuddyPress installation will continue to function, however
    197197                                the features of the disabled components will no longer be accessible to
    … …  
    199199                                ', 'buddypress' )?>
    200200                        </p>
    201                        
     201
    202202                        <?php $disabled_components = get_site_option( 'bp-deactivated-components' ); ?>
    203                        
     203
    204204                        <table class="form-table" style="width: 80%">
    205205                        <tbody>
    … …  
    210210                                                <input type="radio" name="bp_components[bp-activity.php]" value="1"<?php if ( !isset( $disabled_components['bp-activity.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> &nbsp;
    211211                                                <input type="radio" name="bp_components[bp-activity.php]" value="0"<?php if ( isset( $disabled_components['bp-activity.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    212                                         </td>                   
     212                                        </td>
    213213                                </tr>
    214214                                <?php endif; ?>
    … …  
    219219                                                <input type="radio" name="bp_components[bp-blogs.php]" value="1"<?php if ( !isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
    220220                                                <input type="radio" name="bp_components[bp-blogs.php]" value="0"<?php if ( isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    221                                         </td>                   
     221                                        </td>
    222222                                </tr>
    223223                                <?php endif; ?>
    … …  
    228228                                                <input type="radio" name="bp_components[bp-forums.php]" value="1"<?php if ( !isset( $disabled_components['bp-forums.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
    229229                                                <input type="radio" name="bp_components[bp-forums.php]" value="0"<?php if ( isset( $disabled_components['bp-forums.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    230                                         </td>                   
     230                                        </td>
    231231                                </tr>
    232232                                <?php endif; ?>
    … …  
    237237                                                <input type="radio" name="bp_components[bp-friends.php]" value="1"<?php if ( !isset( $disabled_components['bp-friends.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
    238238                                                <input type="radio" name="bp_components[bp-friends.php]" value="0"<?php if ( isset( $disabled_components['bp-friends.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    239                                         </td>                   
     239                                        </td>
    240240                                </tr>
    241241                                <?php endif; ?>
    … …  
    246246                                                <input type="radio" name="bp_components[bp-groups.php]" value="1"<?php if ( !isset( $disabled_components['bp-groups.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
    247247                                                <input type="radio" name="bp_components[bp-groups.php]" value="0"<?php if ( isset( $disabled_components['bp-groups.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    248                                         </td>                   
     248                                        </td>
    249249                                </tr>
    250250                                <?php endif; ?>
    … …  
    255255                                                <input type="radio" name="bp_components[bp-messages.php]" value="1"<?php if ( !isset( $disabled_components['bp-messages.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
    256256                                                <input type="radio" name="bp_components[bp-messages.php]" value="0"<?php if ( isset( $disabled_components['bp-messages.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    257                                         </td>                   
     257                                        </td>
    258258                                </tr>
    259259                                <?php endif; ?>
    … …  
    264264                                                <input type="radio" name="bp_components[bp-wire.php]" value="1"<?php if ( !isset( $disabled_components['bp-wire.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?>  &nbsp;
    265265                                                <input type="radio" name="bp_components[bp-wire.php]" value="0"<?php if ( isset( $disabled_components['bp-wire.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>
    266                                         </td>                   
     266                                        </td>
    267267                                </tr>
    268268                                <?php endif; ?>
    … …  
    287287                        </tbody>
    288288                        </table>
    289                        
     289
    290290                        <p class="submit">
    291291                                <input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>
    292292                        </p>
    293                        
     293
    294294                        <?php wp_nonce_field( 'bp-admin-component-setup' ) ?>
    295                
     295
    296296                </form>
    297297
    298298        </div>
    299        
    300 <?php 
     299
     300<?php
    301301}
    302302
Note: See TracChangeset for help on using the changeset viewer.