Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / project / menuitem / PhabricatorProjectDetailsProfileMenuItem.php
blob6e206de567dc0b73bdc7c2d2ccea3d853e0eee1b
1 <?php
3 final class PhabricatorProjectDetailsProfileMenuItem
4 extends PhabricatorProfileMenuItem {
6 const MENUITEMKEY = 'project.details';
8 public function getMenuItemTypeName() {
9 return pht('Project Details');
12 private function getDefaultName() {
13 return pht('Project Details');
16 public function getDisplayName(
17 PhabricatorProfileMenuItemConfiguration $config) {
18 $default = $this->getDefaultName();
19 return $this->getNameFromConfig($config, $default);
22 public function getMenuItemTypeIcon() {
23 return 'fa-file-text-o';
26 public function canHideMenuItem(
27 PhabricatorProfileMenuItemConfiguration $config) {
28 return false;
31 public function canMakeDefault(
32 PhabricatorProfileMenuItemConfiguration $config) {
33 return true;
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')),
47 protected function newMenuItemViewList(
48 PhabricatorProfileMenuItemConfiguration $config) {
50 $project = $config->getProfileObject();
52 $id = $project->getID();
53 $name = $project->getName();
54 $icon = $project->getDisplayIconIcon();
56 $uri = "/project/profile/{$id}/";
58 $item = $this->newItemView()
59 ->setURI($uri)
60 ->setName($name)
61 ->setIcon($icon);
63 return array(
64 $item,