Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2009 07:54:21 PM (16 years ago)
Author:
apeatling
Message:

Merging 1.1 branch changes and syncing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-widgets.php

    r1926 r2077  
    33/* Register widgets for groups component */
    44function groups_register_widgets() {
    5     add_action('widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");') );   
     5    add_action('widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");') );
    66}
    77add_action( 'plugins_loaded', 'groups_register_widgets' );
     
    1212    function bp_groups_widget() {
    1313        parent::WP_Widget( false, $name = __( 'Groups', 'buddypress' ) );
    14        
     14
    1515        if ( is_active_widget( false, false, $this->id_base ) )
    16             wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery', 'jquery-livequery-pack') );       
     16            wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery', 'jquery-livequery-pack') );
    1717    }
    1818
    1919    function widget($args, $instance) {
    2020        global $bp;
    21        
     21
    2222        extract( $args );
    23        
     23
    2424        echo $before_widget;
    2525        echo $before_title
    26            . $widget_name 
     26           . $widget_name
    2727           . $after_title; ?>
    28        
     28
    2929        <?php if ( bp_has_site_groups( 'type=popular&per_page=' . $instance['max_groups'] . '&max=' . $instance['max_groups'] ) ) : ?>
    3030            <div class="item-options" id="groups-list-options">
    3131                <span class="ajax-loader" id="ajax-loader-groups"></span>
    32                 <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> | 
    33                 <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> | 
     32                <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
     33                <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
    3434                <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="popular-groups" class="selected"><?php _e("Popular", 'buddypress') ?></a>
    3535            </div>
    36            
     36
    3737            <ul id="groups-list" class="item-list">
    3838                <?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
     
    4949
    5050                <?php endwhile; ?>
    51             </ul>       
     51            </ul>
    5252            <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
    5353            <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo attribute_escape( $instance['max_groups'] ); ?>" />
    54            
     54
    5555        <?php else: ?>
    5656
     
    6060
    6161        <?php endif; ?>
    62            
     62
    6363        <?php echo $after_widget; ?>
    6464    <?php
     
    8484function groups_ajax_widget_groups_list() {
    8585    global $bp;
    86        
     86
    8787    check_ajax_referer('groups_widget_groups_list');
    8888
     
    101101    if ( bp_has_site_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?>
    102102        <?php echo "0[[SPLIT]]"; ?>
    103                
     103
    104104        <ul id="groups-list" class="item-list">
    105105            <?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
     
    113113                        <div class="item-meta">
    114114                            <span class="activity">
    115                                 <?php 
     115                                <?php
    116116                                if ( 'newest-groups' == $_POST['filter'] ) {
    117117                                    bp_the_site_group_date_created();
     
    128128
    129129            <?php endwhile; ?>
    130         </ul>       
     130        </ul>
    131131        <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
    132132        <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo attribute_escape( $_POST['max_groups'] ); ?>" />
    133        
     133
    134134    <?php else: ?>
    135135
     
    137137
    138138    <?php endif;
    139    
     139
    140140}
    141141add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
Note: See TracChangeset for help on using the changeset viewer.