BP_User_Query search_terms should match against user_login and user_nicename in addition to xprofile fields

This changeset changes the search_terms logic in BP_User_Query so that it
matches user_login and user_nicename in the core users table. Then, via filter,
the xprofile component amends the WHERE clause so that search_terms are matched
in the users table OR the xprofile data table.

Clauses have been refactored to subqueries rather than storing the matched
user IDs in PHP, for improved performance.

See #5155

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8087 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Match user_nicename and user_login in addition to xprofile fields in messages autocomplete

The AJAX handler bp_legacy_theme_ajax_messages_autocomplete_results() now uses
BP_User_Query and its search_terms parameter for matching users.

Fixes #5155

Props imath for an initial patch

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8088 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8088

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8089 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve strings used for <title> and header of directory pages

Our legacy method for creating directory titles involved concatenating the
component name into '% Directory', which did not work well in languages where
a term like 'Groups Directory' would be translated into a single word. In
addition, there was inconistency between the <title> element on directory pages
and the header element used in the page body.

This changeset introduces a 'directory_title' parameter to BP_Core_Component,
so that directories can register a fully localizable string as the title/
header for directories.

To avoid filter name conflicts, the filter names associated with the headers
on group and blog directory pages were changed to _directory_header. See r7942,

See #4726, #4630

Fixes #4631

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8090 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Move .confirm javascript to a separate, properly enqueued file

This improves our compliance with WP standards, improves our integration with
caching systems, and allows plugins to manage the conditional loading of
scripts.

Fixes #5209

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8091 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8091

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8092 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Remove Invite noscript support for group invitations screens

Fixes #5281

Props imath

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8093 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Pinking shears

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8094 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
When deleting activity items, delete corresponding notifications

See #5289

Props imath

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8095 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8095

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8096 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
When demoting a member in a group, delete corresponding promotion notifications

See #5289

Props imath

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8097 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Tests: rename PHPUnit config file to phpunit.xml.dist

PHPUnit supports config files with both these names, but will use phpunit.xml over the .dist version.
Renaming our file lets users add/edit their own phpunit.xml without editing a BuddyPress core file.


git-svn-id: https://buddypress.svn.wordpress.org/trunk@8098 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
When a message is deleted, delete corresponding notifications

Fixes #5289

Props imath, henrywright

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8099 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Disable duplicate notification creation by default, and introduce 'allow_duplicate' param for override

Generally, it's undesirable to have duplicate notifications for a given
user-item-secondary_item-component-action combination (as when, say, someone
mentions you many times in a single message thread). This changeset introduces
duplicate protection, which can be overridden by passing the 'allow_duplicate'
param to bp_notifications_add_notification().

Fixes #5297

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8100 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8100

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8101 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Fix unit test to ensure no duplicate notifications are created

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8102 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Friends: Add cache file to component loader.

This file was never included during the BP component API refactor
from r3917.

See #5435.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8103 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8103

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8104 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Cache the friendship request user IDs for a given user.

This commit:
- Caches calls to BP_Friends_Friendship::get_friendship_request_user_ids()
- Invalidates the friend request cache when a friendship is saved or removed
- Adds unit tests

See #5435, #5414

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8105 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
In BP_UnitTestCase::create_user(), make sure to pass through parsed arguments

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8106 cdf35c40-ae34-48e0-9cc9-0c9da1808c22