Changeset 5822 for trunk/bp-messages/bp-messages-template.php
- Timestamp:
- 02/21/2012 08:50:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-template.php
r5773 r5822 28 28 var $pag_num; 29 29 var $pag_links; 30 var $search_terms; 30 31 31 32 function bp_messages_box_template( $user_id, $box, $per_page, $max, $type ) { … … 33 34 } 34 35 35 function __construct( $user_id, $box, $per_page, $max, $type ) {36 function __construct( $user_id, $box, $per_page, $max, $type, $search_terms ) { 36 37 $this->pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1; 37 $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page; 38 39 $this->user_id = $user_id; 40 $this->box = $box; 41 $this->type = $type; 42 38 $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page; 39 40 $this->user_id = $user_id; 41 $this->box = $box; 42 $this->type = $type; 43 $this->search_terms = $search_terms; 44 43 45 if ( 'notices' == $this->box ) { 44 46 $this->threads = BP_Messages_Notice::get_notices(); 45 47 } else { 46 $threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page );48 $threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page, $this->search_terms ); 47 49 48 50 $this->threads = $threads['threads']; … … 169 171 170 172 $defaults = array( 171 'user_id' => bp_loggedin_user_id(), 172 'box' => 'inbox', 173 'per_page' => 10, 174 'max' => false, 175 'type' => 'all' 173 'user_id' => bp_loggedin_user_id(), 174 'box' => 'inbox', 175 'per_page' => 10, 176 'max' => false, 177 'type' => 'all', 178 'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '' 176 179 ); 177 180 … … 194 197 } 195 198 196 $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type );199 $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type, $search_terms ); 197 200 } 198 201 … … 354 357 355 358 echo sprintf( __( 'Viewing message %1$s to %2$s (of %3$s messages)', 'buddypress' ), $from_num, $to_num, $total ); ?><?php 359 } 360 361 /** 362 * Output the Private Message search form 363 * 364 * @since BuddyPress (1.6) 365 */ 366 function bp_message_search_form() { 367 368 $default_search_value = bp_get_search_default_text( 'messages' ); 369 $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?> 370 371 <form action="" method="get" id="search-message-form"> 372 <label><input type="text" name="s" id="messages_search" <?php if ( $search_value === $default_search_value ) : ?>placeholder="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> <?php if ( $search_value !== $default_search_value ) : ?>value="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> /></label> 373 <input type="submit" id="messages_search_submit" name="messages_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" /> 374 </form> 375 376 <?php 356 377 } 357 378
Note: See TracChangeset
for help on using the changeset viewer.