Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109927311
PhamePostView.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
Thu, Apr 24, 00:30
Size
2 KB
Mime Type
text/x-php
Expires
Sat, Apr 26, 00:30 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25770481
Attached To
rPH Phabricator
PhamePostView.php
View Options
<?php
final
class
PhamePostView
extends
AphrontView
{
private
$post
;
private
$author
;
private
$body
;
private
$skin
;
private
$summary
;
public
function
setSkin
(
PhameBlogSkin
$skin
)
{
$this
->
skin
=
$skin
;
return
$this
;
}
public
function
getSkin
()
{
return
$this
->
skin
;
}
public
function
setAuthor
(
PhabricatorObjectHandle
$author
)
{
$this
->
author
=
$author
;
return
$this
;
}
public
function
getAuthor
()
{
return
$this
->
author
;
}
public
function
setPost
(
PhamePost
$post
)
{
$this
->
post
=
$post
;
return
$this
;
}
public
function
getPost
()
{
return
$this
->
post
;
}
public
function
setBody
(
$body
)
{
$this
->
body
=
$body
;
return
$this
;
}
public
function
getBody
()
{
return
$this
->
body
;
}
public
function
setSummary
(
$summary
)
{
$this
->
summary
=
$summary
;
return
$this
;
}
public
function
getSummary
()
{
return
$this
->
summary
;
}
public
function
renderTitle
()
{
$href
=
$this
->
getSkin
()->
getURI
(
'post/'
.
$this
->
getPost
()->
getPhameTitle
());
return
phutil_tag
(
'h2'
,
array
(
'class'
=>
'phame-post-title'
,
),
phutil_tag
(
'a'
,
array
(
'href'
=>
$href
,
),
$this
->
getPost
()->
getTitle
()));
}
public
function
renderDatePublished
()
{
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'phame-post-date'
,
),
pht
(
'Published on %s by %s'
,
phabricator_datetime
(
$this
->
getPost
()->
getDatePublished
(),
$this
->
getUser
()),
$this
->
getAuthor
()->
getName
()));
}
public
function
renderBody
()
{
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'phame-post-body phabricator-remarkup'
,
),
$this
->
getBody
());
}
public
function
renderSummary
()
{
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'phame-post-body phabricator-remarkup'
,
),
$this
->
getSummary
());
}
public
function
render
()
{
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'phame-post'
,
),
array
(
$this
->
renderTitle
(),
$this
->
renderDatePublished
(),
$this
->
renderBody
(),
));
}
public
function
renderWithSummary
()
{
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'phame-post'
,
),
array
(
$this
->
renderTitle
(),
$this
->
renderDatePublished
(),
$this
->
renderSummary
(),
));
}
}
Event Timeline
Log In to Comment