Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98214451
PHUIBadgeMiniView.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
Sat, Jan 11, 03:16
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 13, 03:16 (2 d)
Engine
blob
Format
Raw Data
Handle
23533039
Attached To
rPH Phabricator
PHUIBadgeMiniView.php
View Options
<?php
final
class
PHUIBadgeMiniView
extends
AphrontTagView
{
private
$href
;
private
$icon
;
private
$quality
;
private
$header
;
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
;
}
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
)
{
$classes
[]
=
'phui-badge-mini-'
.
$this
->
quality
;
}
return
array
(
'class'
=>
implode
(
' '
,
$classes
),
'sigil'
=>
'has-tooltip'
,
'href'
=>
$this
->
href
,
'meta'
=>
array
(
'tip'
=>
$this
->
header
,
),
);
}
protected
function
getTagContent
()
{
return
id
(
new
PHUIIconView
())
->
setIconFont
(
$this
->
icon
);
}
}
Event Timeline
Log In to Comment