Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/07/2008 07:16:51 AM (18 years ago)
Author:
apeatling
Message:

Bug fixes:

  • Fixed group avatar upload issues
  • Fixed validation on group name/desc/news
  • Fixed support for https://
  • Base support for upcoming home theme and widgets
  • Re-factored JS and CSS inclusion with wp_enqueue_script/styles
File:
1 edited

Legend:

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

    r309 r373  
    33function xprofile_add_signup_css() {
    44        if ( $_SERVER['SCRIPT_NAME'] == '/wp-signup.php' )
    5                 echo '<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/css/signup.css" type="text/css" />';
     5                echo '<link rel="stylesheet" href="' . site_url() . '/wp-content/mu-plugins/bp-xprofile/css/signup.css" type="text/css" />';
    66}
    77add_action( 'wp_head', 'xprofile_add_signup_css' );
     
    1010function xprofile_add_admin_css() {
    1111        if ( strpos( $_GET['page'], 'xprofile' ) !== false ) {
    12                 echo '<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-xprofile/css/admin.css" type="text/css" />';
     12                echo '<link rel="stylesheet" href="' . site_url() . '/wp-content/mu-plugins/bp-xprofile/css/admin.css" type="text/css" />';
    1313        }
    1414}
     
    1818function xprofile_add_admin_js() {
    1919        if ( strpos( $_GET['page'], 'xprofile' ) !== false ) {
    20                 wp_enqueue_script( 'bp-xprofile-admin-js', get_option('siteurl') . "/wp-content/mu-plugins/bp-xprofile/js/admin.js" );
     20                wp_enqueue_script( 'bp-xprofile-admin-js', site_url() . "/wp-content/mu-plugins/bp-xprofile/js/admin.js" );
    2121                add_action( 'admin_head', 'bp_core_add_cropper_js' );
    2222        }
     
    2424add_action( 'admin_menu', 'xprofile_add_admin_js' );
    2525
     26function xprofile_add_cropper_js() {
     27        global $bp;
     28
     29        if ( $_SERVER['SCRIPT_NAME'] == '/wp-activate.php' || $bp['current_action'] == 'change-avatar' || ( isset($_GET['page']) && $_GET['page'] == 'bp-xprofile.php' ) ) {
     30                wp_enqueue_script('jquery');
     31                wp_enqueue_script('prototype');
     32                wp_enqueue_script('scriptaculous-root');
     33                wp_enqueue_script('cropper');
     34                add_action( 'wp_head', 'bp_core_add_cropper_js' );
     35        }
     36       
     37        if ( isset($_GET['page']) && $_GET['page'] == 'bp-xprofile.php' ) {
     38                add_action( 'admin_head', 'bp_core_add_cropper_js' );
     39        }
     40}
     41add_action( 'activate_header', 'xprofile_add_cropper_js' );
     42add_action( 'template_redirect', 'xprofile_add_cropper_js' );
     43add_action( 'admin_menu', 'xprofile_add_cropper_js' );
     44
    2645?>
Note: See TracChangeset for help on using the changeset viewer.