Skip to:
Content

BuddyPress.org

Changeset 4976


Ignore:
Timestamp:
08/14/2011 12:53:55 PM (13 years ago)
Author:
djpaul
Message:

Fix loading of admin/buddy bar RTL stylesheets.
Stop buddybar CSS loading when using admin bar.
Add RTL files for BP's tweaks to the admin bar.
Fixes #3479

Location:
trunk/bp-core
Files:
2 added
3 edited

Legend:

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

    r4820 r4976  
    227227    global $wp_version;
    228228
     229    if ( !bp_use_wp_admin_bar() )
     230        return;
     231
    229232    // Admin bar styles
    230233    if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
     
    239242
    240243    if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    241         $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin_bar-rtl.dev.css';
     244        $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar-rtl.dev.css';
    242245    else
    243         $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin_bar-rtl.css';
     246        $stylesheet = BP_PLUGIN_URL . '/bp-core/css/admin-bar-rtl.css';
    244247
    245248    wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), '20110723' );
    246249}
    247250add_action( 'bp_init', 'bp_core_load_admin_bar_css' );
    248 
    249251?>
  • trunk/bp-core/bp-core-buddybar.php

    r4920 r4976  
    546546            return;
    547547
    548         // Admin bar styles
    549         if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility
    550             $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
    551         elseif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
    552             $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.dev.css';
    553         else
    554             $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.css';
    555 
    556         wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), '20110723' );
    557 
    558548        // Actions used to build the BP admin bar
    559549        add_action( 'bp_adminbar_logo',  'bp_adminbar_logo' );
     
    570560
    571561/**
    572  * Load the buddybar's RTL stylesheet if appropriate.
    573  *
    574  * This can't be done in bp_core_load_admin_bar() because that function is called before locale.php is included.
    575  *
    576  * @since 1.5
    577  */
    578 function bp_core_load_buddybar_rtl_stylesheet() {
     562 * Handle the BuddyBar CSS
     563 */
     564function bp_core_load_buddybar_css() {
     565    if ( bp_use_wp_admin_bar() )
     566        return;
     567
     568    if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility
     569        $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
     570    elseif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
     571        $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.dev.css';
     572    else
     573        $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.css';
     574
     575    wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), '20110723' );
     576
    579577    if ( !is_rtl() )
    580578        return;
     
    587585    wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), '20110723' );
    588586}
    589 add_action( 'wp', 'bp_core_load_buddybar_rtl_stylesheet' );
     587add_action( 'bp_init', 'bp_core_load_buddybar_css' );
    590588?>
  • trunk/bp-core/css/admin-bar.dev.css

    r4741 r4976  
    55}
    66
    7 /* These extra bits move the user links to the right side
    8 
    9 #wpadminbar .quicklinks #wp-admin-bar-bp-register,
    10 #wpadminbar .quicklinks #wp-admin-bar-bp-login {
    11     float: right;
    12 }
    13 #wpadminbar .quicklinks li#wp-admin-bar-my-account,
    14 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar {
    15     float: right;
    16 }
    17 
    18 #wpadminbar .quicklinks li#wp-admin-bar-my-account ul,
    19 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul {
    20 
    21 }
    22 
    23 #wpadminbar .quicklinks li#wp-admin-bar-my-account ul li,
    24 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul li {
    25     float: right;
    26 }
    27 
    28 #wpadminbar .quicklinks li#wp-admin-bar-my-account ul,
    29 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul {
    30     left: auto;
    31     right: 0;
    32 }
    33 
    34 #wpadminbar .quicklinks li#wp-admin-bar-my-account ul ul,
    35 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul ul {
    36     right: 0;
    37     left: auto;
    38 }
    39 
    40 #wpadminbar .quicklinks li#wp-admin-bar-my-account.menupop li:hover > ul,
    41 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar.menupop li.hover > ul {
    42     margin-right: 100%;
    43     margin-left: 0;
    44 }
    45 
    46 
    47 #wpadminbar .quicklinks li#wp-admin-bar-my-account.menupop ul li a > span,
    48 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar.menupop ul li a > span {
    49     background: url(../images/admin-bar-sprite-rtl.png?d=11122010) left -29px no-repeat;
    50     padding-right: 0;
    51     padding-left: 1.5em;
    52 }
    53 
    54 #wpadminbar .quicklinks li#wp-admin-bar.menupop li a img.blavatar,
    55 #wpadminbar .quicklinks li#wp-admin-bar-my-account.menupop li a img.blavatar {
    56     margin-right: 0;
    57     margin-left: 8px;
    58 }
    59 
    60 #wpadminbar .quicklinks li#wp-admin-bar-my-account > a,
    61 #wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a {
    62     border-right: none;
    63     border-left: 1px solid #686868;
    64 }
    65 
    66 End extra bits */
    67 
    687/* Displayed User */
    69 
    708#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a {
    719    border-left: none;
    7210    background: url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;
    7311}
    74 
    7512#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img,
    7613#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img {
     
    8522    float: none;
    8623}
    87 
    8824#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,
    8925#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
    9026    left: 30px;
    9127}
    92 
    9328#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,
    9429#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
     
    9732
    9833/* Displayed Group */
    99 
    10034#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a {
    10135    border-left: none;
    10236    background: url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;
    10337}
    104 
    105 #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img {
    106     width: 16px;
    107     height: 16px;
    108     display: inline;
    109     border: 1px solid #999;
    110     vertical-align: middle;
    111     margin: -2px 23px 0 -5px;
    112     padding: 0;
    113     background: #eee;
    114     float: none;
    115 }
    116 
    11738#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul {
    11839    left: 0;
    11940}
    120 
    12141#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul {
    12242    left: 0;
    12343}
    124 
    12544#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,
    12645#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,
Note: See TracChangeset for help on using the changeset viewer.