Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92702318
PHUIBadgeBoxView.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, 22:38
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 22:38 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22490657
Attached To
rPH Phabricator
PHUIBadgeBoxView.php
View Options
<?php
final
class
PHUIBadgeBoxView
extends
AphrontTagView
{
private
$items
=
array
();
private
$collapsed
;
public
function
addItem
(
$item
)
{
$this
->
items
[]
=
$item
;
return
$this
;
}
public
function
setCollapsed
(
$collapsed
)
{
$this
->
collapsed
=
$collapsed
;
return
$this
;
}
public
function
addItems
(
$items
)
{
foreach
(
$items
as
$item
)
{
$this
->
items
[]
=
$item
;
}
return
$this
;
}
protected
function
getTagName
()
{
return
'ul'
;
}
protected
function
getTagAttributes
()
{
require_celerity_resource
(
'phui-badge-view-css'
);
$classes
=
array
();
$classes
[]
=
'phui-badge-flex-view'
;
$classes
[]
=
'grouped'
;
if
(
$this
->
collapsed
)
{
$classes
[]
=
'flex-view-collapsed'
;
}
return
array
(
'class'
=>
implode
(
' '
,
$classes
),
);
}
protected
function
getTagContent
()
{
$items
=
array
();
foreach
(
$this
->
items
as
$item
)
{
$items
[]
=
phutil_tag
(
'li'
,
array
(
'class'
=>
'phui-badge-flex-item'
,
),
$item
);
}
return
$items
;
}
}
Event Timeline
Log In to Comment