Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F959635
PHUIHeadThingView.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
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
->
image
)
{
$classes
[]
=
'phui-head-has-image'
;
}
if
(
$this
->
size
)
{
$classes
[]
=
$this
->
size
;
}
else
{
$classes
[]
=
self
::
SMALL
;
}
return
array
(
'class'
=>
$classes
,
);
}
protected
function
getTagContent
()
{
$image
=
javelin_tag
(
'a'
,
array
(
'class'
=>
'phui-head-thing-image'
,
'style'
=>
'background-image: url('
.
$this
->
image
.
');'
,
'href'
=>
$this
->
imageHref
,
'aural'
=>
false
,
));
if
(
$this
->
image
)
{
return
array
(
$image
,
$this
->
content
);
}
else
{
return
$this
->
content
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 10:24 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
224401
Default Alt Text
PHUIHeadThingView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment