ACL: Contact list is now sorted, forums reappeared
This commit is contained in:
parent
03e2b04e8f
commit
b1fa0e8e26
1 changed files with 13 additions and 3 deletions
|
@ -258,10 +258,20 @@ class ACL extends BaseObject
|
||||||
*/
|
*/
|
||||||
public static function getContactListByUserId(int $user_id)
|
public static function getContactListByUserId(int $user_id)
|
||||||
{
|
{
|
||||||
$acl_contacts = Contact::selectToArray(
|
$fields = ['id', 'name', 'addr', 'micro'];
|
||||||
['id', 'name', 'addr', 'micro'],
|
$params = ['order' => ['name']];
|
||||||
['uid' => $user_id, 'pending' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]]
|
$acl_contacts = Contact::selectToArray($fields,
|
||||||
|
['uid' => $user_id, 'self' => false, 'blocked' => false, 'archive' => false, 'deleted' => false,
|
||||||
|
'pending' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]], $params
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$acl_forums = Contact::selectToArray($fields,
|
||||||
|
['uid' => $user_id, 'self' => false, 'blocked' => false, 'archive' => false, 'deleted' => false,
|
||||||
|
'pending' => false, 'contact-type' => Contact::TYPE_COMMUNITY], $params
|
||||||
|
);
|
||||||
|
|
||||||
|
$acl_contacts = array_merge($acl_forums, $acl_contacts);
|
||||||
|
|
||||||
array_walk($acl_contacts, function (&$value) {
|
array_walk($acl_contacts, function (&$value) {
|
||||||
$value['type'] = 'contact';
|
$value['type'] = 'contact';
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue