1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 19:02:41 +01:00
phorge-phorge/src/applications/conpherence/view/ConpherencePeopleWidgetView.php
Bob Trahan 38e6961cbd Conpherence - make adding participants be a little dialogue.
Summary: and now you can add more than one at a time! Also adds the 'add participants' and 'new calendar event' options to mobile view. Fixes T3251. Ref T3253.

Test Plan: loaded up these "adders" on both desktop and device-ish views and it went well!

Reviewers: epriestley, chad

Reviewed By: chad

CC: chad, aran, Korvin

Maniphest Tasks: T3251, T3253

Differential Revision: https://secure.phabricator.com/D6075
2013-05-29 17:21:07 -07:00

62 lines
1.6 KiB
PHP

<?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',
)
),
phutil_tag(
'span',
array(
'class' => 'icon'
),
'x'));
}
$body[] = phutil_tag(
'div',
array(
'class' => 'person-entry'
),
array(
phutil_tag(
'a',
array(
'class' => 'pic',
),
phutil_tag(
'img',
array(
'src' => $handle->getImageURI()
),
'')),
$handle->renderLink(),
$remove_html));
}
return $body;
}
}