Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / project / view / PhabricatorProjectMemberListView.php
blobcf8a3a1465fe6268437f3449c1220d79a9deb905
1 <?php
3 final class PhabricatorProjectMemberListView
4 extends PhabricatorProjectUserListView {
6 protected function canEditList() {
7 $viewer = $this->getViewer();
8 $project = $this->getProject();
10 if (!$project->supportsEditMembers()) {
11 return false;
14 return PhabricatorPolicyFilter::hasCapability(
15 $viewer,
16 $project,
17 PhabricatorPolicyCapability::CAN_EDIT);
20 protected function getNoDataString() {
21 return pht('This project does not have any members.');
24 protected function getRemoveURI($phid) {
25 $project = $this->getProject();
26 $id = $project->getID();
27 return "/project/members/{$id}/remove/?phid={$phid}";
30 protected function getHeaderText() {
31 return pht('Members');
34 protected function getMembershipNote() {
35 $viewer = $this->getViewer();
36 $viewer_phid = $viewer->getPHID();
37 $project = $this->getProject();
39 if (!$viewer_phid) {
40 return null;
43 $note = null;
44 if ($project->isUserMember($viewer_phid)) {
45 $edge_type = PhabricatorProjectSilencedEdgeType::EDGECONST;
46 $silenced = PhabricatorEdgeQuery::loadDestinationPHIDs(
47 $project->getPHID(),
48 $edge_type);
49 $silenced = array_fuse($silenced);
50 $is_silenced = isset($silenced[$viewer_phid]);
51 if ($is_silenced) {
52 $note = pht(
53 'You have disabled mail. When mail is sent to project members, '.
54 'you will not receive a copy.');
55 } else {
56 $note = pht(
57 'You are a member and you will receive mail that is sent to all '.
58 'project members.');
62 return $note;