Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/14/2011 07:35:58 AM (16 years ago)
Author:
johnjamesjacoby
Message:

First round of WordPress 3.1 adjustments for BuddyPress installer/upgrader.

File:
1 edited

Legend:

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

    r3702 r3706  
    3434 */
    3535function bp_core_admin_menu_icon_css() {
    36         global $bp;
    37 ?>
     36        global $bp; ?>
    3837
    3938        <style type="text/css">
    40                 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo BP_PLUGIN_URL . '/bp-core/images/admin_menu_icon.png' ?> ) !important; background-position: -1px -32px; }
    41                 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a, ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a { background-position: -1px 0; }
     39                /* Wizard Icon */
     40                ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img { display: none; }
     41                ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }
     42                ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,
     43                ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a {
     44                        background-position: -1px 0;
     45                }
     46
     47                /* Settings Icon */
    4248                ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img { display: none; }
     49                ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }
     50                ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,
     51                ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a {
     52                        background-position: -1px 0;
     53                }
    4354        </style>
    4455
    … …  
    8596        $image = apply_filters( 'bp_inline_cropper_image', getimagesize( BP_AVATAR_UPLOAD_PATH . $bp->avatar_admin->image->dir ) );
    8697        $aspect_ratio = 1;
     98       
     99        $full_height = (int) constant( 'BP_AVATAR_FULL_HEIGHT' );
     100        $full_width  = (int) constant( 'BP_AVATAR_FULL_WIDTH'  );
    87101
    88102        // Calculate Aspect Ratio
    89         if ( (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) && ( (int) constant( 'BP_AVATAR_FULL_WIDTH' ) != (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) ) )
    90                 $aspect_ratio = (int) constant( 'BP_AVATAR_FULL_WIDTH' ) / (int) constant( 'BP_AVATAR_FULL_HEIGHT' );
     103        if ( $full_height && ( $full_width != $full_height ) )
     104                $aspect_ratio = $full_width / $full_height;
    91105
    92106        $width  = $image[0] / 2;
    … …  
    115129                function showPreview(coords) {
    116130                        if ( parseInt(coords.w) > 0 ) {
    117                                 var rx = <?php echo (int) constant( 'BP_AVATAR_FULL_WIDTH' ) ?> / coords.w;
    118                                 var ry = <?php echo (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) ?> / coords.h;
     131                                var rx = <?php echo $full_width; ?> / coords.w;
     132                                var ry = <?php echo $full_height; ?> / coords.h;
    119133
    120134                                jQuery('#avatar-crop-preview').css({
    121135                                <?php if ( $image ) : ?>
    122                                         width: Math.round(rx * <?php echo $image[0] ?>) + 'px',
    123                                         height: Math.round(ry * <?php echo $image[1] ?>) + 'px',
     136                                        width: Math.round(rx * <?php echo $image[0]; ?>) + 'px',
     137                                        height: Math.round(ry * <?php echo $image[1]; ?>) + 'px',
    124138                                <?php endif; ?>
    125139                                        marginLeft: '-' + Math.round(rx * coords.x) + 'px',
Note: See TracChangeset for help on using the changeset viewer.