Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94031747
PHUIHeadThingView.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
Tue, Dec 3, 09:25
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Dec 5, 09:25 (2 d)
Engine
blob
Format
Raw Data
Handle
22717268
Attached To
rPH Phabricator
PHUIHeadThingView.php
View Options
<?php
final
class
PHUIHeadThingView
extends
AphrontTagView
{
private
$image
;
private
$imageHref
;
private
$content
;
private
$size
;
const
SMALL
=
'head-thing-small'
;
const
MEDIUM
=
'head-thing-medium'
;
public
function
setImageHref
(
$href
)
{
$this
->
imageHref
=
$href
;
return
$this
;
}
public
function
setImage
(
$image
)
{
$this
->
image
=
$image
;
return
$this
;
}
public
function
setContent
(
$content
)
{
$this
->
content
=
$content
;
return
$this
;
}
public
function
setSize
(
$size
)
{
$this
->
size
=
$size
;
return
$this
;
}
protected
function
getTagAttributes
()
{
require_celerity_resource
(
'phui-head-thing-view-css'
);
$classes
=
array
();
$classes
[]
=
'phui-head-thing-view'
;
if
(
$this
->
size
)
{
$classes
[]
=
$this
->
size
;
}
else
{
$classes
[]
=
self
::
SMALL
;
}
return
array
(
'class'
=>
$classes
,
);
}
protected
function
getTagContent
()
{
$image
=
phutil_tag
(
'a'
,
array
(
'class'
=>
'phui-head-thing-image'
,
'style'
=>
'background-image: url('
.
$this
->
image
.
');'
,
'href'
=>
$this
->
imageHref
,
));
return
array
(
$image
,
$this
->
content
);
}
}
Event Timeline
Log In to Comment