Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106057253
PHUIButtonBarView.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, Mar 21, 22:32
Size
931 B
Mime Type
text/x-php
Expires
Sun, Mar 23, 22:32 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25049855
Attached To
rPH Phabricator
PHUIButtonBarView.php
View Options
<?php
final
class
PHUIButtonBarView
extends
AphrontTagView
{
private
$buttons
=
array
();
public
function
addButton
(
$button
)
{
$this
->
buttons
[]
=
$button
;
return
$this
;
}
protected
function
getTagAttributes
()
{
return
array
(
'class'
=>
'phui-button-bar'
);
}
protected
function
getTagName
()
{
return
'div'
;
}
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
();
}
}
Event Timeline
Log In to Comment