Ticket #7312: class-bp-groups-widget.php.patch
File class-bp-groups-widget.php.patch, 4.1 KB (added by , 8 years ago) |
---|
-
class-bp-groups-widget.php
110 110 'per_page' => $max_groups, 111 111 'max' => $max_groups, 112 112 ); 113 $show_groupsort = ! empty( $instance['show_groupsort'] ) ? true : (bool)$instance['show_groupsort']; 114 $show_meta = ! empty( $instance['show_meta'] ) ? true : (bool)$instance['show_meta']; 113 115 114 116 // Back up the global. 115 117 $old_groups_template = $groups_template; … … 117 119 ?> 118 120 119 121 <?php if ( bp_has_groups( $group_args ) ) : ?> 122 <?php if ( $show_groupsort ) : ?> 120 123 <div class="item-options" id="groups-list-options"> 121 124 <a href="<?php bp_groups_directory_permalink(); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> 122 125 <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span> … … 124 127 <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span> 125 128 <a href="<?php bp_groups_directory_permalink(); ?>" id="popular-groups" <?php if ( $instance['group_default'] == 'popular' ) : ?> class="selected"<?php endif; ?>><?php _e("Popular", 'buddypress') ?></a> 126 129 </div> 130 <?php endif; ?> 127 131 128 132 <ul id="groups-list" class="item-list" aria-live="polite" aria-relevant="all" aria-atomic="true"> 129 133 <?php while ( bp_groups() ) : bp_the_group(); ?> … … 134 138 135 139 <div class="item"> 136 140 <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div> 141 <?php if ($show_meta) : ?> 137 142 <div class="item-meta"> 138 143 <span class="activity"> 139 144 <?php … … 147 152 ?> 148 153 </span> 149 154 </div> 155 <?php endif; ?> 150 156 </div> 151 157 </li> 152 158 … … 185 191 $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); 186 192 $instance['group_default'] = strip_tags( $new_instance['group_default'] ); 187 193 $instance['link_title'] = (bool) $new_instance['link_title']; 188 194 $instance['show_groupsort']= (bool) $new_instance['show_groupsort']; 195 $instance['show_meta'] = (bool) $new_instance['show_meta']; 196 189 197 return $instance; 190 198 } 191 199 … … 202 210 'title' => __( 'Groups', 'buddypress' ), 203 211 'max_groups' => 5, 204 212 'group_default' => 'active', 205 'link_title' => false 213 'link_title' => false, 214 'show_groupsort'=> true, 215 'show_meta' => true 206 216 ); 207 217 $instance = wp_parse_args( (array) $instance, $defaults ); 208 218 … … 210 220 $max_groups = strip_tags( $instance['max_groups'] ); 211 221 $group_default = strip_tags( $instance['group_default'] ); 212 222 $link_title = (bool) $instance['link_title']; 223 $show_groupsort = (bool) $instance['show_groupsort']; 224 $show_meta = (bool) $instance['show_meta']; 213 225 ?> 214 226 215 227 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p> … … 226 238 <option value="popular" <?php selected( $group_default, 'popular' ); ?>><?php _e( 'Popular', 'buddypress' ) ?></option> 227 239 </select> 228 240 </p> 241 <p><label for="<?php echo $this->get_field_id('show_groupsort') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('show_groupsort') ?>" id="<?php echo $this->get_field_id('show_groupsort') ?>" value="1" <?php checked( $show_groupsort ) ?> /> <?php _e( 'Show the sorting of the groups', 'buddypress' ) ?></label></p> 242 <p><label for="<?php echo $this->get_field_id('show_meta') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('show_meta') ?>" id="<?php echo $this->get_field_id('show_meta') ?>" value="1" <?php checked( $show_meta ) ?> /> <?php _e( 'Show the meta information of the group', 'buddypress' ) ?></label></p> 229 243 <?php 230 244 } 231 245 }