2013-04-02 18:32:40 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @group conpherence
|
|
|
|
*/
|
|
|
|
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();
|
|
|
|
|
|
|
|
$body = array();
|
|
|
|
// future proof by using participants to iterate through handles;
|
|
|
|
// we may have non-people handles sooner or later
|
|
|
|
foreach ($participants as $user_phid => $participant) {
|
|
|
|
$handle = $handles[$user_phid];
|
|
|
|
$remove_html = '';
|
|
|
|
if ($user_phid == $user->getPHID()) {
|
|
|
|
$remove_html = javelin_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'class' => 'remove',
|
|
|
|
'sigil' => 'remove-person',
|
|
|
|
'meta' => array(
|
|
|
|
'remove_person' => $handle->getPHID(),
|
|
|
|
'action' => 'remove_person',
|
|
|
|
)
|
|
|
|
),
|
2013-05-30 17:30:56 +02:00
|
|
|
hsprintf('<span class="close-icon">×</span>'));
|
2013-04-02 18:32:40 +02:00
|
|
|
}
|
|
|
|
$body[] = phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(
|
2013-05-30 17:30:56 +02:00
|
|
|
'class' => 'person-entry grouped'
|
2013-04-02 18:32:40 +02:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
phutil_tag(
|
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'class' => 'pic',
|
|
|
|
),
|
|
|
|
phutil_tag(
|
|
|
|
'img',
|
|
|
|
array(
|
|
|
|
'src' => $handle->getImageURI()
|
|
|
|
),
|
|
|
|
'')),
|
|
|
|
$handle->renderLink(),
|
|
|
|
$remove_html));
|
|
|
|
}
|
|
|
|
|
2013-05-30 02:21:07 +02:00
|
|
|
return $body;
|
2013-04-02 18:32:40 +02:00
|
|
|
}
|
|
|
|
}
|