Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / project / menuitem / PhabricatorProjectDetailsProfileMenuItem.php
bloba3021e023973119292b85e2cc6952d28f7cc9993
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 getMenuItemTypeIcon() {
17 return 'fa-file-text-o';
20 public function canHideMenuItem(
21 PhabricatorProfileMenuItemConfiguration $config) {
22 return false;
25 public function canMakeDefault(
26 PhabricatorProfileMenuItemConfiguration $config) {
27 return true;
30 public function getDisplayName(
31 PhabricatorProfileMenuItemConfiguration $config) {
32 $name = $config->getMenuItemProperty('name');
34 if (strlen($name)) {
35 return $name;
38 return $this->getDefaultName();
41 public function buildEditEngineFields(
42 PhabricatorProfileMenuItemConfiguration $config) {
43 return array(
44 id(new PhabricatorTextEditField())
45 ->setKey('name')
46 ->setLabel(pht('Name'))
47 ->setPlaceholder($this->getDefaultName())
48 ->setValue($config->getMenuItemProperty('name')),
52 protected function newMenuItemViewList(
53 PhabricatorProfileMenuItemConfiguration $config) {
55 $project = $config->getProfileObject();
57 $id = $project->getID();
58 $name = $project->getName();
59 $icon = $project->getDisplayIconIcon();
61 $uri = "/project/profile/{$id}/";
63 $item = $this->newItemView()
64 ->setURI($uri)
65 ->setName($name)
66 ->setIcon($icon);
68 return array(
69 $item,