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-groups/bp-groups-cssjs.php

    r309 r373  
    88function groups_add_js() {
    99        global $bp;
     10
     11        if ( $bp['current_component'] == $bp['groups']['slug'] )
     12                wp_enqueue_script( 'bp-groups-js', site_url() . '/wp-content/mu-plugins/bp-groups/js/general.js' );
     13}
     14add_action( 'template_redirect', 'groups_add_js' );
     15
     16function groups_add_cropper_js() {
     17        global $create_group_step;
    1018       
    11         if ( !isset($_GET['page']) )
    12                 $_GET['page'] = null;
    13 
    14         if ( strpos( $_GET['page'], 'groups' ) !== false || $bp['current_component'] == $bp['groups']['slug'] ) {
    15                 echo '
    16                         <script src="' . get_option('siteurl') . '/wp-content/mu-plugins/bp-groups/js/general.js" type="text/javascript"></script>';
     19        if ( $create_group_step == '3' ) {
     20                wp_enqueue_script('jquery');
     21                wp_enqueue_script('prototype');
     22                wp_enqueue_script('scriptaculous-root');
     23                wp_enqueue_script('cropper');
     24                add_action( 'wp_head', 'bp_core_add_cropper_js' );
    1725        }
    1826}
    19 add_action( 'wp_head', 'groups_add_js' );
    20 add_action( 'admin_head', 'groups_add_js' );
     27add_action( 'template_redirect', 'groups_add_cropper_js' );
    2128
    22 /**************************************************************************
    23  add_css()
    24  
    25  Inserts the CSS needed to style the groups pages.
    26  **************************************************************************/   
    27 
    28 function groups_add_css()
    29 {
    30         ?>
    31        
    32         <?php
    33 }
    3429
    3530?>
Note: See TracChangeset for help on using the changeset viewer.