/
directory.php
43 lines (38 loc) · 1.23 KB
/
directory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use UserAttributeKey;
use Loader;
use Concrete\Core\User\UserList;
class Directory extends PublicProfilePageController
{
/**
* @var \Concrete\Core\User\UserList
*/
protected $userList;
public function on_start()
{
parent::on_start();
$this->requireAsset('css', 'core/frontend/pagination');
$this->userList = new UserList();
$this->userList->sortByUserID();
}
public function on_before_render()
{
$pagination = $this->userList->getPagination();
$users = $pagination->getCurrentPageResults();
$this->set('userList', $this->userList);
$this->set('users', $users);
$this->set('total', $pagination->getTotalResults());
$this->set('attribs', UserAttributeKey::getMemberListList());
$this->set('keywords', isset($_REQUEST['keywords']) ? h($_REQUEST['keywords']) : '');
$this->set('pagination', $pagination);
}
public function search_members()
{
$keywords = $this->get('keywords');
if ($keywords != '') {
$this->userList->filterByKeywords($keywords);
}
}
}