Changeset 3402
- Timestamp:
- 11/12/2010 09:38:13 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-widgets.php
r3336 r3402 13 13 class BP_Core_Members_Widget extends WP_Widget { 14 14 function bp_core_members_widget() { 15 parent::WP_Widget( false, $name = __( 'Members', 'buddypress' ) ); 15 $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ) ); 16 parent::WP_Widget( false, $name = __( 'Members', 'buddypress' ), $widget_ops ); 16 17 17 18 if ( is_active_widget( false, false, $this->id_base ) ) … … 29 30 echo $before_widget; 30 31 echo $before_title 31 . $ widget_name32 . $instance['title'] 32 33 . $after_title; ?> 33 34 … … 89 90 function update( $new_instance, $old_instance ) { 90 91 $instance = $old_instance; 92 $instance['title'] = strip_tags( $new_instance['title'] ); 91 93 $instance['max_members'] = strip_tags( $new_instance['max_members'] ); 92 94 $instance['member_default'] = strip_tags( $new_instance['member_default'] ); … … 96 98 97 99 function form( $instance ) { 98 $instance = wp_parse_args( (array) $instance, array( 'max_members' => 5, 'member_default' => 'active' ) ); 100 $defaults = array( 101 'title' => __( 'Members', 'buddypress' ), 102 'max_members' => 5, 103 'member_default' => 'active' 104 ); 105 $instance = wp_parse_args( (array) $instance, $defaults ); 106 107 $title = strip_tags( $instance['title'] ); 99 108 $max_members = strip_tags( $instance['max_members'] ); 100 109 $member_default = strip_tags( $instance['member_default'] ); 101 110 ?> 111 112 <p><label for="bp-core-widget-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> 102 113 103 114 <p><label for="bp-core-widget-members-max"><?php _e('Max members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p> … … 121 132 class BP_Core_Whos_Online_Widget extends WP_Widget { 122 133 function bp_core_whos_online_widget() { 123 parent::WP_Widget( false, $name = __( "Who's Online Avatars", 'buddypress' ) ); 134 $widget_ops = array( 'description' => __( 'Avatars of users who are currently online', 'buddypress' ) ); 135 parent::WP_Widget( false, $name = __( "Who's Online Avatars", 'buddypress' ), $widget_ops ); 124 136 } 125 137 … … 131 143 echo $before_widget; 132 144 echo $before_title 133 . $ widget_name145 . $instance['title'] 134 146 . $after_title; ?> 135 147 … … 156 168 function update( $new_instance, $old_instance ) { 157 169 $instance = $old_instance; 170 $instance['title'] = strip_tags( $new_instance['title'] ); 158 171 $instance['max_members'] = strip_tags( $new_instance['max_members'] ); 159 172 … … 162 175 163 176 function form( $instance ) { 164 $instance = wp_parse_args( (array) $instance, array( 'max_members' => 15 ) ); 177 $defaults = array( 178 'title' => __( "Who's Online", 'buddypress' ), 179 'max_members' => 15 180 ); 181 $instance = wp_parse_args( (array) $instance, $defaults ); 182 183 $title = strip_tags( $instance['title'] ); 165 184 $max_members = strip_tags( $instance['max_members'] ); 166 185 ?> 167 186 187 <p><label for="bp-core-widget-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> 188 168 189 <p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p> 169 190 <?php … … 175 196 class BP_Core_Recently_Active_Widget extends WP_Widget { 176 197 function bp_core_recently_active_widget() { 177 parent::WP_Widget( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ) ); 198 $widget_ops = array( 'description' => __( 'Avatars of recently active members', 'buddypress' ) ); 199 parent::WP_Widget( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ), $widget_ops ); 178 200 } 179 201 … … 185 207 echo $before_widget; 186 208 echo $before_title 187 . $ widget_name209 . $instance['title'] 188 210 . $after_title; ?> 189 211 … … 210 232 function update( $new_instance, $old_instance ) { 211 233 $instance = $old_instance; 234 $instance['title'] = strip_tags( $new_instance['title'] ); 212 235 $instance['max_members'] = strip_tags( $new_instance['max_members'] ); 213 236 … … 216 239 217 240 function form( $instance ) { 218 $instance = wp_parse_args( (array) $instance, array( 'max_members' => 15 ) ); 241 $defaults = array( 242 'title' => 'Recently Active Members', 243 'max_members' => 15 244 ); 245 $instance = wp_parse_args( (array) $instance, $defaults ); 246 247 $title = strip_tags( $instance['title'] ); 219 248 $max_members = strip_tags( $instance['max_members'] ); 220 249 ?> 250 251 <p><label for="bp-core-widget-members-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> 221 252 222 253 <p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p> -
trunk/bp-groups/bp-groups-widgets.php
r3336 r3402 11 11 class BP_Groups_Widget extends WP_Widget { 12 12 function bp_groups_widget() { 13 parent::WP_Widget( false, $name = __( 'Groups', 'buddypress' ) ); 13 $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ) ); 14 parent::WP_Widget( false, $name = __( 'Groups', 'buddypress' ), $widget_ops ); 14 15 15 16 if ( is_active_widget( false, false, $this->id_base ) ) … … 27 28 echo $before_widget; 28 29 echo $before_title 29 . $ widget_name30 . $instance['title'] 30 31 . $after_title; ?> 31 32 … … 81 82 function update( $new_instance, $old_instance ) { 82 83 $instance = $old_instance; 84 $instance['title'] = strip_tags( $new_instance['title'] ); 83 85 $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); 84 86 $instance['group_default'] = strip_tags( $new_instance['group_default'] ); … … 88 90 89 91 function form( $instance ) { 90 $instance = wp_parse_args( (array) $instance, array( 'max_groups' => 5, 'group_default' => 'active' ) ); 92 $defaults = array( 93 'title' => __( 'Groups', 'buddypress' ), 94 'max_members' => 5, 95 'group_default' => 'active' 96 ); 97 $instance = wp_parse_args( (array) $instance, $defaults ); 98 99 $title = strip_tags( $instance['title'] ); 91 100 $max_groups = strip_tags( $instance['max_groups'] ); 92 101 $group_default = strip_tags( $instance['group_default'] ); 93 102 ?> 103 104 <p><label for="bp-groups-widget-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> 94 105 95 106 <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p>
Note: See TracChangeset
for help on using the changeset viewer.