3 final class PeopleHovercardEngineExtension
4 extends PhabricatorHovercardEngineExtension
{
6 const EXTENSIONKEY
= 'people';
8 public function isExtensionEnabled() {
12 public function getExtensionName() {
13 return pht('User Accounts');
16 public function canRenderObjectHovercard($object) {
17 return ($object instanceof PhabricatorUser
);
20 public function willRenderHovercards(array $objects) {
21 $viewer = $this->getViewer();
22 $phids = mpull($objects, 'getPHID');
24 $users = id(new PhabricatorPeopleQuery())
27 ->needAvailability(true)
28 ->needProfileImage(true)
31 $users = mpull($users, null, 'getPHID');
38 public function renderHovercard(
39 PHUIHovercardView
$hovercard,
40 PhabricatorObjectHandle
$handle,
43 $viewer = $this->getViewer();
45 $user = idx($data['users'], $object->getPHID());
50 $is_exiled = $hovercard->getIsExiled();
52 $user_card = id(new PhabricatorUserCardView())
55 ->setIsExiled($is_exiled);
57 $hovercard->appendChild($user_card);