Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
12256 views
1
<?php
2
3
final class PhabricatorHomeLauncherProfileMenuItem
4
extends PhabricatorProfileMenuItem {
5
6
const MENUITEMKEY = 'home.launcher.menu';
7
8
public function getMenuItemTypeName() {
9
return pht('More Applications');
10
}
11
12
private function getDefaultName() {
13
return pht('More Applications');
14
}
15
16
public function getDisplayName(
17
PhabricatorProfileMenuItemConfiguration $config) {
18
$default = $this->getDefaultName();
19
return $this->getNameFromConfig($config, $default);
20
}
21
22
public function getMenuItemTypeIcon() {
23
return 'fa-ellipsis-h';
24
}
25
26
public function canHideMenuItem(
27
PhabricatorProfileMenuItemConfiguration $config) {
28
return false;
29
}
30
31
public function canMakeDefault(
32
PhabricatorProfileMenuItemConfiguration $config) {
33
return false;
34
}
35
36
public function buildEditEngineFields(
37
PhabricatorProfileMenuItemConfiguration $config) {
38
return array(
39
id(new PhabricatorTextEditField())
40
->setKey('name')
41
->setLabel(pht('Name'))
42
->setPlaceholder($this->getDefaultName())
43
->setValue($config->getMenuItemProperty('name')),
44
);
45
}
46
47
protected function newMenuItemViewList(
48
PhabricatorProfileMenuItemConfiguration $config) {
49
$viewer = $this->getViewer();
50
51
$name = $this->getDisplayName($config);
52
$icon = 'fa-ellipsis-h';
53
$uri = '/applications/';
54
55
$item = $this->newItemView()
56
->setURI($uri)
57
->setName($name)
58
->setIcon($icon);
59
60
return array(
61
$item,
62
);
63
}
64
65
}
66
67