@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorProjectPictureProfileMenuItem
4 extends PhabricatorProfileMenuItem {
5
6 const MENUITEMKEY = 'project.picture';
7
8 public function getMenuItemTypeName() {
9 return pht('Project Picture');
10 }
11
12 private function getDefaultName() {
13 return pht('Project Picture');
14 }
15
16 public function getMenuItemTypeIcon() {
17 return 'fa-picture-o';
18 }
19
20 public function canHideMenuItem(
21 PhabricatorProfileMenuItemConfiguration $config) {
22 return false;
23 }
24
25 public function getDisplayName(
26 PhabricatorProfileMenuItemConfiguration $config) {
27 return $this->getDefaultName();
28 }
29
30 public function buildEditEngineFields(
31 PhabricatorProfileMenuItemConfiguration $config) {
32 return array();
33 }
34
35 protected function newMenuItemViewList(
36 PhabricatorProfileMenuItemConfiguration $config) {
37
38 $project = $config->getProfileObject();
39 $picture = $project->getProfileImageURI();
40
41 $item = $this->newItemView()
42 ->setDisabled($project->isArchived());
43
44 $item->newProfileImage($picture);
45
46 return array(
47 $item,
48 );
49 }
50
51}