Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92693076
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
Fri, Nov 22, 20:18
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 20:18 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22488683
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