Move navbar_complete to Acl

This commit is contained in:
Hypolite Petovan 2018-02-25 20:04:30 -05:00
parent 824262b824
commit 207eac4a16
2 changed files with 6 additions and 7 deletions

View file

@ -9,9 +9,3 @@ use Friendica\Model\Contact;
require_once "mod/proxy.php"; require_once "mod/proxy.php";
function navbar_complete(App $a) {
$search = notags(trim($_REQUEST['search']));
$mode = $_REQUEST['smode'];
return Acl::contactAutocomplete($search, $mode);
}

View file

@ -4,6 +4,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Acl;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -184,7 +185,11 @@ function acl_content(App $a)
); );
} elseif ($type == 'x') { } elseif ($type == 'x') {
// autocomplete for global contact search (e.g. navbar search) // autocomplete for global contact search (e.g. navbar search)
$r = navbar_complete($a); $search = notags(trim($_REQUEST['search']));
$mode = $_REQUEST['smode'];
$r = Acl::contactAutocomplete($search, $mode);
$contacts = []; $contacts = [];
foreach ($r as $g) { foreach ($r as $g) {
$contacts[] = [ $contacts[] = [