Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/people/menuitem/PhabricatorPeopleDetailsProfileMenuItem.php
12256 views
1
<?php
2
3
final class PhabricatorPeopleDetailsProfileMenuItem
4
extends PhabricatorProfileMenuItem {
5
6
const MENUITEMKEY = 'people.details';
7
8
public function getMenuItemTypeName() {
9
return pht('User Details');
10
}
11
12
private function getDefaultName() {
13
return pht('User Details');
14
}
15
16
public function getDisplayName(
17
PhabricatorProfileMenuItemConfiguration $config) {
18
$default = $this->getDefaultName();
19
return $this->getNameFromConfig($config, $default);
20
}
21
22
public function buildEditEngineFields(
23
PhabricatorProfileMenuItemConfiguration $config) {
24
return array(
25
id(new PhabricatorTextEditField())
26
->setKey('name')
27
->setLabel(pht('Name'))
28
->setPlaceholder($this->getDefaultName())
29
->setValue($config->getMenuProperty('name')),
30
);
31
}
32
33
protected function newMenuItemViewList(
34
PhabricatorProfileMenuItemConfiguration $config) {
35
36
$user = $config->getProfileObject();
37
$uri = urisprintf(
38
'/p/%s/',
39
$user->getUsername());
40
41
$item = $this->newItemView()
42
->setURI($uri)
43
->setName(pht('Profile'))
44
->setIcon('fa-user');
45
46
return array(
47
$item,
48
);
49
}
50
51
}
52
53