Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77108304
PHUIHandleListView.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
Mon, Aug 12, 11:22
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Aug 14, 11:22 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
19814929
Attached To
rPH Phabricator
PHUIHandleListView.php
View Options
<?php
/**
* Convenience class for rendering a list of handles.
*
* This class simplifies rendering a list of handles and improves loading and
* caching semantics in the rendering pipeline by delaying bulk loads until the
* last possible moment.
*/
final
class
PHUIHandleListView
extends
AphrontTagView
{
private
$handleList
;
private
$asInline
;
public
function
setHandleList
(
PhabricatorHandleList
$list
)
{
$this
->
handleList
=
$list
;
return
$this
;
}
public
function
setAsInline
(
$inline
)
{
$this
->
asInline
=
$inline
;
return
$this
;
}
public
function
getAsInline
()
{
return
$this
->
asInline
;
}
protected
function
getTagName
()
{
// TODO: It would be nice to render this with a proper <ul />, at least in
// block mode, but don't stir the waters up too much for now.
return
'span'
;
}
protected
function
getTagContent
()
{
$list
=
$this
->
handleList
;
$items
=
array
();
foreach
(
$list
as
$handle
)
{
$view
=
$list
->
renderHandle
(
$handle
->
getPHID
());
$view
->
setShowHovercard
(
true
);
$items
[]
=
$view
;
}
if
(
$this
->
getAsInline
())
{
$items
=
phutil_implode_html
(
', '
,
$items
);
}
else
{
$items
=
phutil_implode_html
(
phutil_tag
(
'br'
),
$items
);
}
return
$items
;
}
}
Event Timeline
Log In to Comment