Changeset 3825
- Timestamp:
- 03/25/2012 09:37:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-widgets.php
r3620 r3825 25 25 26 26 /** 27 * Register the widget28 *29 * @since bbPress (r3389)30 *31 * @uses register_widget()32 */33 function register_widget() {34 register_widget( 'BBP_Login_Widget' );35 }36 37 /**38 27 * bbPress Login Widget 39 28 * … … 45 34 * widget options 46 35 */ 47 function BBP_Login_Widget() {36 public function __construct() { 48 37 $widget_ops = apply_filters( 'bbp_login_widget_options', array( 49 38 'classname' => 'bbp_widget_login', 50 'description' => __( ' The login widget.', 'bbpress' )39 'description' => __( 'A simple login form with optional links to sign-up and lost password pages.', 'bbpress' ) 51 40 ) ); 52 41 53 parent::WP_Widget( false, __( 'bbPress Login Widget', 'bbpress' ), $widget_ops ); 42 parent::__construct( false, __( '(bbPress) Login Widget', 'bbpress' ), $widget_ops ); 43 } 44 45 /** 46 * Register the widget 47 * 48 * @since bbPress (r3389) 49 * 50 * @uses register_widget() 51 */ 52 public function register_widget() { 53 register_widget( 'BBP_Login_Widget' ); 54 54 } 55 55 … … 64 64 * @uses get_template_part() To get the login/logged in form 65 65 */ 66 function widget( $args, $instance ) {66 public function widget( $args, $instance ) { 67 67 extract( $args ); 68 68 … … 152 152 * @param array $old_instance The old instance options 153 153 */ 154 function update( $new_instance, $old_instance ) {154 public function update( $new_instance, $old_instance ) { 155 155 $instance = $old_instance; 156 156 $instance['title'] = strip_tags( $new_instance['title'] ); … … 170 170 * @uses BBP_Login_Widget::get_field_name() To output the field name 171 171 */ 172 function form( $instance ) {172 public function form( $instance ) { 173 173 174 174 // Form values … … 210 210 211 211 /** 212 * Register the widget213 *214 * @since bbPress (r3389)215 *216 * @uses register_widget()217 */218 function register_widget() {219 register_widget( 'BBP_Views_Widget' );220 }221 222 /**223 212 * bbPress View Widget 224 213 * … … 230 219 * widget options 231 220 */ 232 function BBP_Views_Widget() {221 public function __construct() { 233 222 $widget_ops = apply_filters( 'bbp_views_widget_options', array( 234 223 'classname' => 'widget_display_views', 235 'description' => __( 'A list of views.', 'bbpress' )224 'description' => __( 'A list of registered optional topic views.', 'bbpress' ) 236 225 ) ); 237 226 238 parent::WP_Widget( false, __( 'bbPress View List', 'bbpress' ), $widget_ops ); 227 parent::__construct( false, __( '(bbPress) Topic Views List', 'bbpress' ), $widget_ops ); 228 } 229 230 /** 231 * Register the widget 232 * 233 * @since bbPress (r3389) 234 * 235 * @uses register_widget() 236 */ 237 public function register_widget() { 238 register_widget( 'BBP_Views_Widget' ); 239 239 } 240 240 … … 251 251 * @uses bbp_view_title() To output the view title 252 252 */ 253 function widget( $args, $instance ) {253 public function widget( $args, $instance ) { 254 254 255 255 // Only output widget contents if views exist … … 286 286 * @param array $old_instance The old instance options 287 287 */ 288 function update( $new_instance, $old_instance ) {288 public function update( $new_instance, $old_instance ) { 289 289 $instance = $old_instance; 290 290 $instance['title'] = strip_tags( $new_instance['title'] ); … … 302 302 * @uses BBP_Views_Widget::get_field_name() To output the field name 303 303 */ 304 function form( $instance ) {304 public function form( $instance ) { 305 305 $title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?> 306 306 … … 327 327 328 328 /** 329 * Register the widget330 *331 * @since bbPress (r3389)332 *333 * @uses register_widget()334 */335 function register_widget() {336 register_widget( 'BBP_Forums_Widget' );337 }338 339 /**340 329 * bbPress Forum Widget 341 330 * … … 347 336 * widget options 348 337 */ 349 function BBP_Forums_Widget() {338 public function __construct() { 350 339 $widget_ops = apply_filters( 'bbp_forums_widget_options', array( 351 340 'classname' => 'widget_display_forums', 352 'description' => __( 'A list of forums .', 'bbpress' )341 'description' => __( 'A list of forums with an option to set the parent.', 'bbpress' ) 353 342 ) ); 354 343 355 parent::WP_Widget( false, __( 'bbPress Forum List', 'bbpress' ), $widget_ops ); 344 parent::__construct( false, __( '(bbPress) Forums List', 'bbpress' ), $widget_ops ); 345 } 346 347 /** 348 * Register the widget 349 * 350 * @since bbPress (r3389) 351 * 352 * @uses register_widget() 353 */ 354 public function register_widget() { 355 register_widget( 'BBP_Forums_Widget' ); 356 356 } 357 357 … … 376 376 * @uses bbp_forum_title() To display the forum title 377 377 */ 378 function widget( $args, $instance ) {378 public function widget( $args, $instance ) { 379 379 extract( $args ); 380 380 … … 421 421 * @param array $old_instance The old instance options 422 422 */ 423 function update( $new_instance, $old_instance ) {423 public function update( $new_instance, $old_instance ) { 424 424 $instance = $old_instance; 425 425 $instance['title'] = strip_tags( $new_instance['title'] ); … … 443 443 * @uses BBP_Forums_Widget::get_field_name() To output the field name 444 444 */ 445 function form( $instance ) {445 public function form( $instance ) { 446 446 $title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 447 447 $parent_forum = !empty( $instance['parent_forum'] ) ? esc_attr( $instance['parent_forum'] ) : '0'; ?> … … 479 479 480 480 /** 481 * Register the widget482 *483 * @since bbPress (r3389)484 *485 * @uses register_widget()486 */487 function register_widget() {488 register_widget( 'BBP_Topics_Widget' );489 }490 491 /**492 481 * bbPress Topic Widget 493 482 * … … 499 488 * widget options 500 489 */ 501 function BBP_Topics_Widget() {490 public function __construct() { 502 491 $widget_ops = apply_filters( 'bbp_topics_widget_options', array( 503 492 'classname' => 'widget_display_topics', … … 505 494 ) ); 506 495 507 parent::WP_Widget( false, __( 'bbPress Topics List', 'bbpress' ), $widget_ops ); 496 parent::__construct( false, __( '(bbPress) Recent Topics', 'bbpress' ), $widget_ops ); 497 } 498 499 /** 500 * Register the widget 501 * 502 * @since bbPress (r3389) 503 * 504 * @uses register_widget() 505 */ 506 public function register_widget() { 507 register_widget( 'BBP_Topics_Widget' ); 508 508 } 509 509 … … 529 529 * @uses bbp_get_topic_reply_count() To get the topic reply count 530 530 */ 531 function widget( $args, $instance ) {531 public function widget( $args, $instance ) { 532 532 533 533 extract( $args ); … … 624 624 * @param array $old_instance The old instance options 625 625 */ 626 function update( $new_instance, $old_instance ) {626 public function update( $new_instance, $old_instance ) { 627 627 $instance = $old_instance; 628 628 $instance['title'] = strip_tags( $new_instance['title'] ); … … 643 643 * @uses BBP_Topics_Widget::get_field_name() To output the field name 644 644 */ 645 function form( $instance ) {645 public function form( $instance ) { 646 646 $title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 647 647 $max_shown = !empty( $instance['max_shown'] ) ? esc_attr( $instance['max_shown'] ) : ''; … … 673 673 674 674 /** 675 * Register the widget676 *677 * @since bbPress (r3389)678 *679 * @uses register_widget()680 */681 function register_widget() {682 register_widget( 'BBP_Replies_Widget' );683 }684 685 /**686 675 * bbPress Replies Widget 687 676 * … … 693 682 * widget options 694 683 */ 695 function BBP_Replies_Widget() {684 public function __construct() { 696 685 $widget_ops = apply_filters( 'bbp_replies_widget_options', array( 697 686 'classname' => 'widget_display_replies', 698 'description' => __( 'A list of bbPressrecent replies.', 'bbpress' )687 'description' => __( 'A list of the most recent replies.', 'bbpress' ) 699 688 ) ); 700 689 701 parent::WP_Widget( false, 'bbPress Reply List', $widget_ops ); 690 parent::__construct( false, __( '(bbPress) Recent Replies', 'bbpress' ), $widget_ops ); 691 } 692 693 /** 694 * Register the widget 695 * 696 * @since bbPress (r3389) 697 * 698 * @uses register_widget() 699 */ 700 public function register_widget() { 701 register_widget( 'BBP_Replies_Widget' ); 702 702 } 703 703 … … 725 725 * @uses get_the_time() To get the time of the reply 726 726 */ 727 function widget( $args, $instance ) {727 public function widget( $args, $instance ) { 728 728 729 729 extract( $args ); … … 760 760 761 761 /* translators: bbpress replies widget: 1: reply author, 2: reply link, 3: reply date, 4: reply time */ 762 printf( _x( $show_date == 'on' ? '%1$s on %2$s, %3$s, %4$s' : '%1$s on %2$s', 'widgets', 'bbpress' ), $author_link, $reply_link, get_the_date(), get_the_time() ); 762 if ( $show_date == 'on' ) { 763 printf( _x( '%1$s on %2$s, %3$s, %4$s', 'widgets', 'bbpress' ), $author_link, $reply_link, get_the_date(), get_the_time() ); 764 } else { 765 printf( _x( '%1$s on %2$s', 'widgets', 'bbpress' ), $author_link, $reply_link ); 766 } 767 763 768 ?> 764 769 … … 784 789 * @param array $old_instance The old instance options 785 790 */ 786 function update( $new_instance, $old_instance ) {791 public function update( $new_instance, $old_instance ) { 787 792 $instance = $old_instance; 788 793 $instance['title'] = strip_tags( $new_instance['title'] ); … … 802 807 * @uses BBP_Replies_Widget::get_field_name() To output the field name 803 808 */ 804 function form( $instance ) {809 public function form( $instance ) { 805 810 $title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 806 811 $max_shown = !empty( $instance['max_shown'] ) ? esc_attr( $instance['max_shown'] ) : '';
Note: See TracChangeset
for help on using the changeset viewer.