/
NameField.php
47 lines (37 loc) · 1011 Bytes
/
NameField.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
44
45
46
47
<?php
namespace Concrete\Core\User\Group\Search\Field\Field;
use Concrete\Core\Form\Service\Form;
use Concrete\Core\Search\Field\AbstractField;
use Concrete\Core\Search\ItemList\ItemList;
use Concrete\Core\Support\Facade\Application;
use Concrete\Core\User\Group\GroupList;
class NameField extends AbstractField
{
protected $requestVariables = [
'gName',
];
public function getKey()
{
return 'name';
}
public function getDisplayName()
{
return t('Name');
}
public function renderSearchField()
{
$app = Application::getFacadeApplication();
/** @var Form $form */
$form = $app->make(Form::class);
$html = $form->text('gName', $this->getData("gName"));
return $html;
}/** @noinspection PhpDocSignatureInspection */
/**
* @param GroupList $list
* @param $request
*/
public function filterList(ItemList $list)
{
$list->filterByName($this->data['gName']);
}
}