Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3295528
PHUIBadgeMiniView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PHUIBadgeMiniView.php
View Options
<?php
final
class
PHUIBadgeMiniView
extends
AphrontTagView
{
private
$href
;
private
$icon
;
private
$quality
;
private
$header
;
private
$tipDirection
;
public
function
setIcon
(
$icon
)
{
$this
->
icon
=
$icon
;
return
$this
;
}
public
function
setHref
(
$href
)
{
$this
->
href
=
$href
;
return
$this
;
}
public
function
setQuality
(
$quality
)
{
$this
->
quality
=
$quality
;
return
$this
;
}
public
function
setHeader
(
$header
)
{
$this
->
header
=
$header
;
return
$this
;
}
public
function
setTipDirection
(
$direction
)
{
$this
->
tipDirection
=
$direction
;
return
$this
;
}
protected
function
getTagName
(
)
{
if
(
$this
->
href
)
{
return
'a'
;
}
else
{
return
'span'
;
}
}
protected
function
getTagAttributes
(
)
{
require_celerity_resource
(
'phui-badge-view-css'
)
;
Javelin
::
initBehavior
(
'phabricator-tooltips'
)
;
$classes
=
array
(
)
;
$classes
[
]
=
'phui-badge-mini'
;
if
(
$this
->
quality
)
{
$quality_color
=
PhabricatorBadgesQuality
::
getQualityColor
(
$this
->
quality
)
;
$classes
[
]
=
'phui-badge-mini-'
.
$quality_color
;
}
return
array
(
'class'
=>
implode
(
' '
,
$classes
)
,
'sigil'
=>
'has-tooltip'
,
'href'
=>
$this
->
href
,
'meta'
=>
array
(
'tip'
=>
$this
->
header
,
'align'
=>
$this
->
tipDirection
,
'size'
=>
300
,
)
,
)
;
}
protected
function
getTagContent
(
)
{
return
id
(
new
PHUIIconView
(
)
)
->
setIcon
(
$this
->
icon
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 27, 02:20 (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1109715
Default Alt Text
PHUIBadgeMiniView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment