forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhabricatorProjectMembersProfileMenuItem.php
58 lines (44 loc) · 1.28 KB
/
PhabricatorProjectMembersProfileMenuItem.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
48
49
50
51
52
53
54
55
56
57
58
<?php
final class PhabricatorProjectMembersProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'project.members';
public function getMenuItemTypeName() {
return pht('Project Members');
}
private function getDefaultName() {
return pht('Members');
}
public function getDisplayName(
PhabricatorProfileMenuItemConfiguration $config) {
$default = $this->getDefaultName();
return $this->getNameFromConfig($config, $default);
}
public function getMenuItemTypeIcon() {
return 'fa-users';
}
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config) {
return array(
id(new PhabricatorTextEditField())
->setKey('name')
->setLabel(pht('Name'))
->setPlaceholder($this->getDefaultName())
->setValue($config->getMenuItemProperty('name')),
);
}
protected function newMenuItemViewList(
PhabricatorProfileMenuItemConfiguration $config) {
$project = $config->getProfileObject();
$id = $project->getID();
$name = $this->getDisplayName($config);
$icon = 'fa-group';
$uri = "/project/members/{$id}/";
$item = $this->newItemView()
->setURI($uri)
->setName($name)
->setIcon($icon);
return array(
$item,
);
}
}