3 final class ConpherenceParticipantView
extends AphrontView
{
8 public function setConpherence(ConpherenceThread
$conpherence) {
9 $this->conpherence
= $conpherence;
13 public function setUpdateURI($uri) {
14 $this->updateURI
= $uri;
18 public function render() {
19 $conpherence = $this->conpherence
;
20 $viewer = $this->getViewer();
22 $participants = $conpherence->getParticipants();
23 $count = new PhutilNumber(count($participants));
24 $handles = $conpherence->getHandles();
25 $handles = array_intersect_key($handles, $participants);
26 $head_handles = array_select_keys($handles, array($viewer->getPHID()));
27 $handle_list = mpull($handles, 'getName');
28 natcasesort($handle_list);
29 $handles = mpull($handles, null, 'getName');
30 $handles = array_select_keys($handles, $handle_list);
32 $head_handles = mpull($head_handles, null, 'getName');
33 $handles = $head_handles +
$handles;
35 $can_edit = PhabricatorPolicyFilter
::hasCapability(
38 PhabricatorPolicyCapability
::CAN_EDIT
);
41 foreach ($handles as $handle) {
42 $user_phid = $handle->getPHID();
44 if (($user_phid == $viewer->getPHID()) ||
$can_edit) {
45 $icon = id(new PHUIIconView())
47 ->addClass('lightbluetext');
48 $remove_html = javelin_tag(
52 'sigil' => 'remove-person',
54 'remove_person' => $user_phid,
55 'action' => 'remove_person',
66 'class' => 'person-entry grouped',
73 'href' => $handle->getURI(),
78 'src' => $handle->getImageURI(),
81 $handle->renderLink(),
86 $new_icon = id(new PHUIIconView())
87 ->setIcon('fa-plus-square')
88 ->setHref($this->updateURI
)
89 ->setMetadata(array('widget' => null))
90 ->addSigil('conpherence-widget-adder');
92 $header = id(new PHUIHeaderView())
93 ->setHeader(pht('Participants (%d)', $count))
94 ->addClass('widgets-header')
95 ->addActionItem($new_icon);
97 $content = javelin_tag(
100 'class' => 'widgets-body',
101 'id' => 'widgets-people',
102 'sigil' => 'widgets-people',