Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110293557
PHUIHandleView.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, Apr 25, 14:09
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Apr 27, 14:09 (2 d)
Engine
blob
Format
Raw Data
Handle
25790871
Attached To
rPH Phabricator
PHUIHandleView.php
View Options
<?php
/**
* Convenience class for rendering a single handle.
*
* This class simplifies rendering a single handle, and improves loading and
* caching semantics in the rendering pipeline by loading data at the last
* moment.
*/
final
class
PHUIHandleView
extends
AphrontView
{
private
$handleList
;
private
$handlePHID
;
private
$asTag
;
private
$asText
;
private
$useShortName
;
private
$showHovercard
;
private
$showStateIcon
;
public
function
setHandleList
(
PhabricatorHandleList
$list
)
{
$this
->
handleList
=
$list
;
return
$this
;
}
public
function
setHandlePHID
(
$phid
)
{
$this
->
handlePHID
=
$phid
;
return
$this
;
}
public
function
setAsTag
(
$tag
)
{
$this
->
asTag
=
$tag
;
return
$this
;
}
public
function
setAsText
(
$as_text
)
{
$this
->
asText
=
$as_text
;
return
$this
;
}
public
function
setUseShortName
(
$short
)
{
$this
->
useShortName
=
$short
;
return
$this
;
}
public
function
setShowHovercard
(
$hovercard
)
{
$this
->
showHovercard
=
$hovercard
;
return
$this
;
}
public
function
setShowStateIcon
(
$show_state_icon
)
{
$this
->
showStateIcon
=
$show_state_icon
;
return
$this
;
}
public
function
getShowStateIcon
()
{
return
$this
->
showStateIcon
;
}
public
function
render
()
{
$handle
=
$this
->
handleList
[
$this
->
handlePHID
];
if
(
$this
->
asTag
)
{
$tag
=
$handle
->
renderTag
();
if
(
$this
->
showHovercard
)
{
$tag
->
setPHID
(
$handle
->
getPHID
());
}
return
$tag
;
}
if
(
$this
->
asText
)
{
return
$handle
->
getLinkName
();
}
if
(
$this
->
useShortName
)
{
$name
=
$handle
->
getName
();
}
else
{
$name
=
null
;
}
if
(
$this
->
showHovercard
)
{
$link
=
$handle
->
renderHovercardLink
(
$name
);
}
else
{
$link
=
$handle
->
renderLink
(
$name
);
}
if
(
$this
->
showStateIcon
)
{
$icon
=
$handle
->
renderStateIcon
();
$link
=
array
(
$icon
,
' '
,
$link
);
}
return
$link
;
}
}
Event Timeline
Log In to Comment