Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1532330
AphrontProgressBarView.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
AphrontProgressBarView.php
View Options
<?php
final
class
AphrontProgressBarView
extends
AphrontBarView
{
const
WIDTH
=
100
;
private
$value
;
private
$max
=
100
;
private
$alt
=
''
;
public
function
getDefaultColor
()
{
return
AphrontBarView
::
COLOR_AUTO_BADNESS
;
}
public
function
setValue
(
$value
)
{
$this
->
value
=
$value
;
return
$this
;
}
public
function
setMax
(
$max
)
{
$this
->
max
=
$max
;
return
$this
;
}
public
function
setAlt
(
$text
)
{
$this
->
alt
=
$text
;
return
$this
;
}
protected
function
getRatio
()
{
return
min
(
$this
->
value
,
$this
->
max
)
/
$this
->
max
;
}
public
function
render
()
{
require_celerity_resource
(
'aphront-bars'
);
$ratio
=
$this
->
getRatio
();
$width
=
self
::
WIDTH
*
$ratio
;
$color
=
$this
->
getColor
();
return
phutil_tag_div
(
"aphront-bar progress color-{$color}"
,
array
(
phutil_tag
(
'div'
,
array
(
'title'
=>
$this
->
alt
),
phutil_tag
(
'div'
,
array
(
'style'
=>
"width: {$width}px;"
),
''
)),
phutil_tag
(
'span'
,
array
(),
$this
->
getCaption
()),
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 14, 6:19 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
354547
Default Alt Text
AphrontProgressBarView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment