Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93602503
ManiphestHovercardEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 30, 02:15
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 02:15 (2 d)
Engine
blob
Format
Raw Data
Handle
22674171
Attached To
rPH Phabricator
ManiphestHovercardEngineExtension.php
View Options
<?php
final
class
ManiphestHovercardEngineExtension
extends
PhabricatorHovercardEngineExtension
{
const
EXTENSIONKEY
=
'maniphest'
;
public
function
isExtensionEnabled
()
{
return
PhabricatorApplication
::
isClassInstalled
(
'PhabricatorManiphestApplication'
);
}
public
function
getExtensionName
()
{
return
pht
(
'Maniphest Tasks'
);
}
public
function
canRenderObjectHovercard
(
$object
)
{
return
(
$object
instanceof
ManiphestTask
);
}
public
function
renderHovercard
(
PHUIHovercardView
$hovercard
,
PhabricatorObjectHandle
$handle
,
$task
,
$data
)
{
$viewer
=
$this
->
getViewer
();
$hovercard
->
setTitle
(
$task
->
getMonogram
())
->
setDetail
(
$task
->
getTitle
());
$owner_phid
=
$task
->
getOwnerPHID
();
if
(
$owner_phid
)
{
$owner
=
$viewer
->
renderHandle
(
$owner_phid
);
}
else
{
$owner
=
phutil_tag
(
'em'
,
array
(),
pht
(
'None'
));
}
$hovercard
->
addField
(
pht
(
'Assigned To'
),
$owner
);
$hovercard
->
addField
(
pht
(
'Priority'
),
ManiphestTaskPriority
::
getTaskPriorityName
(
$task
->
getPriority
()));
$hovercard
->
addTag
(
ManiphestView
::
renderTagForTask
(
$task
));
}
}
Event Timeline
Log In to Comment