Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100527637
PHUIRemarkupImageView.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
Fri, Jan 31, 11:42
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 2, 11:42 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
23983491
Attached To
rPH Phabricator
PHUIRemarkupImageView.php
View Options
<?php
final
class
PHUIRemarkupImageView
extends
AphrontView
{
private
$uri
;
private
$width
;
private
$height
;
private
$alt
;
private
$classes
=
array
();
public
function
setURI
(
$uri
)
{
$this
->
uri
=
$uri
;
return
$this
;
}
public
function
getURI
()
{
return
$this
->
uri
;
}
public
function
setWidth
(
$width
)
{
$this
->
width
=
$width
;
return
$this
;
}
public
function
getWidth
()
{
return
$this
->
width
;
}
public
function
setHeight
(
$height
)
{
$this
->
height
=
$height
;
return
$this
;
}
public
function
getHeight
()
{
return
$this
->
height
;
}
public
function
setAlt
(
$alt
)
{
$this
->
alt
=
$alt
;
return
$this
;
}
public
function
getAlt
()
{
return
$this
->
alt
;
}
public
function
addClass
(
$class
)
{
$this
->
classes
[]
=
$class
;
return
$this
;
}
public
function
render
()
{
$id
=
celerity_generate_unique_node_id
();
Javelin
::
initBehavior
(
'remarkup-load-image'
,
array
(
'uri'
=>
(
string
)
$this
->
uri
,
'imageID'
=>
$id
,
));
$classes
=
null
;
if
(
$this
->
classes
)
{
$classes
=
implode
(
' '
,
$this
->
classes
);
}
return
phutil_tag
(
'img'
,
array
(
'id'
=>
$id
,
'width'
=>
$this
->
getWidth
(),
'height'
=>
$this
->
getHeight
(),
'alt'
=>
$this
->
getAlt
(),
'class'
=>
$classes
,
));
}
}
Event Timeline
Log In to Comment