2013-04-02 18:32:40 +02:00
|
|
|
<?php
|
2014-07-10 00:12:48 +02:00
|
|
|
|
2013-04-02 18:32:40 +02:00
|
|
|
final class ConpherencePeopleWidgetView extends ConpherenceWidgetView {
|
|
|
|
|
|
|
|
public function render() {
|
|
|
|
$conpherence = $this->getConpherence();
|
|
|
|
$widget_data = $conpherence->getWidgetData();
|
|
|
|
$user = $this->getUser();
|
|
|
|
$conpherence = $this->getConpherence();
|
|
|
|
$participants = $conpherence->getParticipants();
|
|
|
|
$handles = $conpherence->getHandles();
|
2015-04-06 18:55:03 +02:00
|
|
|
$head_handles = array_select_keys($handles, array($user->getPHID()));
|
2015-04-22 21:19:24 +02:00
|
|
|
$handle_list = mpull($handles, 'getName');
|
|
|
|
natcasesort($handle_list);
|
|
|
|
$handles = mpull($handles, null, 'getName');
|
|
|
|
$handles = array_select_keys($handles, $handle_list);
|
|
|
|
$head_handles = mpull($head_handles, null, 'getName');
|
2015-04-06 18:55:03 +02:00
|
|
|
$handles = $head_handles + $handles;
|
2013-04-02 18:32:40 +02:00
|
|
|
|
|
|
|
$body = array();
|
2015-04-22 21:19:24 +02:00
|
|
|
foreach ($handles as $handle) {
|
|
|
|
$user_phid = $handle->getPHID();
|
2013-04-02 18:32:40 +02:00
|
|
|
$remove_html = '';
|
|
|
|
if ($user_phid == $user->getPHID()) {
|
2015-04-02 00:49:25 +02:00
|
|
|
$icon = id(new PHUIIconView())
|
|
|
|
->setIconFont('fa-times lightbluetext');
|
2013-04-02 18:32:40 +02:00
|
|
|
$remove_html = javelin_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'class' => 'remove',
|
|
|
|
'sigil' => 'remove-person',
|
|
|
|
'meta' => array(
|
2015-04-22 21:19:24 +02:00
|
|
|
'remove_person' => $user_phid,
|
2013-04-02 18:32:40 +02:00
|
|
|
'action' => 'remove_person',
|
2014-10-07 15:01:04 +02:00
|
|
|
),
|
2013-04-02 18:32:40 +02:00
|
|
|
),
|
2015-04-02 00:49:25 +02:00
|
|
|
$icon);
|
2013-04-02 18:32:40 +02:00
|
|
|
}
|
|
|
|
$body[] = phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(
|
2014-10-07 15:01:04 +02:00
|
|
|
'class' => 'person-entry grouped',
|
2013-04-02 18:32:40 +02:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
phutil_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'class' => 'pic',
|
2015-04-02 00:49:25 +02:00
|
|
|
'href' => $handle->getURI(),
|
2013-04-02 18:32:40 +02:00
|
|
|
),
|
|
|
|
phutil_tag(
|
|
|
|
'img',
|
|
|
|
array(
|
2014-10-07 15:01:04 +02:00
|
|
|
'src' => $handle->getImageURI(),
|
2013-04-02 18:32:40 +02:00
|
|
|
),
|
|
|
|
'')),
|
|
|
|
$handle->renderLink(),
|
2014-10-07 15:01:04 +02:00
|
|
|
$remove_html,
|
|
|
|
));
|
2013-04-02 18:32:40 +02:00
|
|
|
}
|
|
|
|
|
2013-05-30 02:21:07 +02:00
|
|
|
return $body;
|
2013-04-02 18:32:40 +02:00
|
|
|
}
|
2014-07-10 00:12:48 +02:00
|
|
|
|
2013-04-02 18:32:40 +02:00
|
|
|
}
|