diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-12-20 20:06:39 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-12-20 20:06:39 -0500 |
commit | ae708a712a5dd932c01e734f8450b899b1407a70 (patch) | |
tree | 348c01ad849fbeeee0fba74118b4536af4119333 /app/Controller/UserAjaxController.php | |
parent | a957195952e2c93177628ab07936d783da1388c3 (diff) |
Offer the possibility to override internal formatter objects from plugins
Diffstat (limited to 'app/Controller/UserAjaxController.php')
-rw-r--r-- | app/Controller/UserAjaxController.php | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/Controller/UserAjaxController.php b/app/Controller/UserAjaxController.php index d93bfe9a..17567a00 100644 --- a/app/Controller/UserAjaxController.php +++ b/app/Controller/UserAjaxController.php @@ -3,8 +3,6 @@ namespace Kanboard\Controller; use Kanboard\Filter\UserNameFilter; -use Kanboard\Formatter\UserAutoCompleteFormatter; -use Kanboard\Formatter\UserMentionFormatter; use Kanboard\Model\UserModel; /** @@ -25,7 +23,7 @@ class UserAjaxController extends BaseController $search = $this->request->getStringParam('term'); $filter = $this->userQuery->withFilter(new UserNameFilter($search)); $filter->getQuery()->asc(UserModel::TABLE.'.name')->asc(UserModel::TABLE.'.username'); - $this->response->json($filter->format(new UserAutoCompleteFormatter($this->container))); + $this->response->json($filter->format($this->userAutoCompleteFormatter)); } /** @@ -39,11 +37,7 @@ class UserAjaxController extends BaseController $query = $this->request->getStringParam('search'); $users = $this->projectPermissionModel->findUsernames($project_id, $query); - $this->response->json( - UserMentionFormatter::getInstance($this->container) - ->withUsers($users) - ->format() - ); + $this->response->json($this->userMentionFormatter->withUsers($users)->format()); } /** |