Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548022
PHUISegmentBarView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PHUISegmentBarView.php
View Options
<?php
final
class
PHUISegmentBarView
extends
AphrontTagView
{
private
$label
;
private
$segments
=
array
();
public
function
setLabel
(
$label
)
{
$this
->
label
=
$label
;
return
$this
;
}
public
function
newSegment
()
{
$segment
=
new
PHUISegmentBarSegmentView
();
$this
->
segments
[]
=
$segment
;
return
$segment
;
}
protected
function
canAppendChild
()
{
return
false
;
}
protected
function
getTagAttributes
()
{
return
array
(
'class'
=>
'phui-segment-bar-view'
,
);
}
protected
function
getTagContent
()
{
require_celerity_resource
(
'phui-segment-bar-view-css'
);
$label
=
$this
->
label
;
if
(
strlen
(
$label
))
{
$label
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'phui-segment-bar-label'
,
),
$label
);
}
$segments
=
$this
->
segments
;
$position
=
0
;
foreach
(
$segments
as
$segment
)
{
$segment
->
setPosition
(
$position
);
$position
+=
$segment
->
getWidth
();
}
$segments
=
array_reverse
(
$segments
);
$segments
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'phui-segment-bar-segments'
,
),
$segments
);
return
array
(
$label
,
$segments
,
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:42 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
122923
Default Alt Text
PHUISegmentBarView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment