Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F29935090
PHUIButtonBarView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
PHUIButtonBarView.php
View Options
<?php
final
class
PHUIButtonBarView
extends
AphrontTagView
{
private
$buttons
=
array
();
private
$borderless
;
public
function
addButton
(
$button
)
{
$this
->
buttons
[]
=
$button
;
return
$this
;
}
public
function
setBorderless
(
$borderless
)
{
$this
->
borderless
=
$borderless
;
return
$this
;
}
protected
function
getTagAttributes
()
{
$classes
=
array
();
$classes
[]
=
'phui-button-bar'
;
if
(
$this
->
borderless
)
{
$classes
[]
=
'phui-button-bar-borderless'
;
}
return
array
(
'class'
=>
implode
(
' '
,
$classes
));
}
protected
function
getTagName
()
{
return
'span'
;
}
protected
function
getTagContent
()
{
require_celerity_resource
(
'phui-button-css'
);
$i
=
1
;
$j
=
count
(
$this
->
buttons
);
foreach
(
$this
->
buttons
as
$button
)
{
// LeeLoo Dallas Multi-Pass
if
(
$j
>
1
)
{
if
(
$i
==
1
)
{
$button
->
addClass
(
'phui-button-bar-first'
);
}
else
if
(
$i
==
$j
)
{
$button
->
addClass
(
'phui-button-bar-last'
);
}
else
if
(
$j
>
1
)
{
$button
->
addClass
(
'phui-button-bar-middle'
);
}
}
$this
->
appendChild
(
$button
);
$i
++;
}
return
$this
->
renderChildren
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Oct 17, 7:58 AM (1 d, 17 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
29/ae/9a7bc89d31fdce70671d6f5f3e8c
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment