Skip to:
Content

BuddyPress.org

Ticket #7881: 7881.patch

File 7881.patch, 6.2 KB (added by imath, 8 years ago)
  • src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php

    diff --git src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php
    index 8aa71cf83..ac0b5a842 100644
     
    9393<script type="text/html" id="tmpl-bp-messages-filters">
    9494        <li class="user-messages-search" role="search" data-bp-search="{{data.box}}">
    9595                <div class="bp-search messages-search">
    96                         <form action="" method="get" id="user_messages_search_form" class="bp-messages-search-form" data-bp-search="messages">
    97                                 <label for="user_messages_search" class="bp-screen-reader-text">
    98                                         <?php _e( 'Search Messages', 'buddypress' ); ?>
    99                                 </label>
    100                                 <input type="search" id="user_messages_search" placeholder="<?php echo esc_attr_x( 'Search', 'search placeholder text', 'buddypress' ); ?>"/>
    101                                 <button type="submit" id="user_messages_search_submit">
    102                                         <span class="dashicons dashicons-search" aria-hidden="true"></span>
    103                                         <span class="bp-screen-reader-text"><?php echo esc_html_x( 'Search', 'button', 'buddypress' ); ?></span>
    104                                 </button>
    105                         </form>
     96                        <?php bp_nouveau_message_search_form(); ?>
    10697                </div>
    10798        </li>
    10899        <li class="user-messages-bulk-actions"></li>
  • src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/search-form.php

    diff --git src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/search-form.php src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/search-form.php
    index e69de29bb..bff11037c 100644
     
     1<?php
     2/**
     3 * BP Nouveau Messages search form template.
     4 *
     5 * @since 3.2.0
     6 * @version 3.2.0
     7 */
     8?>
     9<form action="" method="get" id="user_messages_search_form" class="bp-messages-search-form" data-bp-search="messages">
     10        <label for="user_messages_search" class="bp-screen-reader-text">
     11                <?php _e( 'Search Messages', 'buddypress' ); ?>
     12        </label>
     13        <input type="search" id="user_messages_search" placeholder="<?php echo esc_attr_x( 'Search', 'search placeholder text', 'buddypress' ); ?>"/>
     14        <button type="submit" id="user_messages_search_submit">
     15                <span class="dashicons dashicons-search" aria-hidden="true"></span>
     16                <span class="bp-screen-reader-text"><?php echo esc_html_x( 'Search', 'button', 'buddypress' ); ?></span>
     17        </button>
     18</form>
  • src/bp-templates/bp-nouveau/includes/messages/functions.php

    diff --git src/bp-templates/bp-nouveau/includes/messages/functions.php src/bp-templates/bp-nouveau/includes/messages/functions.php
    index 8e697cd6b..93cfaab2e 100644
    function bp_nouveau_messages_localize_scripts( $params = array() ) {  
    137137        return $params;
    138138}
    139139
    140 /**
    141  * @since 3.0.0
    142  */
    143 function bp_nouveau_message_search_form() {
    144         $query_arg   = bp_core_get_component_search_query_arg( 'messages' );
    145         $placeholder = bp_get_search_default_text( 'messages' );
    146 
    147         $search_form_html = '<form action="" method="get" id="search-messages-form">
    148                 <label for="messages_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="messages_search" placeholder="' . esc_attr( $placeholder ) . '" /></label>
    149                 <input type="submit" id="messages_search_submit" name="messages_search_submit" value="' . esc_attr_x( 'Search', 'button', 'buddypress' ) . '" />
    150         </form>';
    151 
    152         /**
    153          * Filters the private message component search form.
    154          *
    155          * @since 3.0.0
    156          *
    157          * @param string $search_form_html HTML markup for the message search form.
    158          */
    159         echo apply_filters( 'bp_nouveau_message_search_form', $search_form_html );
    160 }
    161 add_filter( 'bp_message_search_form', 'bp_nouveau_message_search_form', 10, 1 );
    162 
    163140/**
    164141 * @since 3.0.0
    165142 */
  • src/bp-templates/bp-nouveau/includes/messages/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/messages/template-tags.php src/bp-templates/bp-nouveau/includes/messages/template-tags.php
    index 2176661f1..9dcc4ea64 100644
    function bp_nouveau_messages_member_interface() {  
    6161         */
    6262        do_action( 'bp_after_member_messages_content' );
    6363}
     64
     65/**
     66 * Output the Member's messages search form.
     67 *
     68 * @since  3.0.0
     69 * @since  3.2.0 Move the function into Template Tags and use a template part.
     70 */
     71function bp_nouveau_message_search_form() {
     72        $search_form_html = bp_buffer_template_part( 'common/js-templates/messages/search-form', null, false );
     73
     74        /**
     75         * Filters the private message component search form.
     76         *
     77         * @since 2.2.0
     78         *
     79         * @param string $search_form_html HTML markup for the message search form.
     80         */
     81        echo apply_filters( 'bp_message_search_form', $search_form_html );
     82}
  • src/bp-templates/bp-nouveau/includes/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php
    index 6526378aa..fb8984546 100644
    function bp_nouveau_search_default_text( $text = '', $is_attr = true ) {  
    18491849 * @since 3.0.0
    18501850 */
    18511851function bp_nouveau_search_form() {
    1852         bp_get_template_part( 'common/search/search-form' );
     1852        $search_form_html = bp_buffer_template_part( 'common/search/search-form', null, false );
    18531853
    18541854        $objects = bp_nouveau_get_search_objects();
    18551855        if ( empty( $objects['primary'] ) || empty( $objects['secondary'] ) ) {
     1856                echo $search_form_html;
    18561857                return;
    18571858        }
    18581859
    18591860        if ( 'dir' === $objects['primary'] ) {
     1861                /**
     1862                 * Filter here to edit the HTML output of the directory search form.
     1863                 *
     1864                 * NB: This will take in charge the following BP Core Components filters
     1865                 *     - bp_directory_members_search_form
     1866                 *     - bp_directory_blogs_search_form
     1867                 *     - bp_directory_groups_search_form
     1868                 *
     1869                 * @since 1.9.0
     1870                 *
     1871                 * @param string $search_form_html The HTML output for the directory search form.
     1872                 */
     1873                echo apply_filters( "bp_directory_{$objects['secondary']}_search_form", $search_form_html );
     1874
    18601875                if ( 'activity' === $objects['secondary'] ) {
    18611876                        /**
    18621877                         * Fires before the display of the activity syndication options.