Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120688822
PonderQuestionHistoryController.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
Sun, Jul 6, 08:05
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 8, 08:05 (2 d)
Engine
blob
Format
Raw Data
Handle
27230314
Attached To
rPH Phabricator
PonderQuestionHistoryController.php
View Options
<?php
final
class
PonderQuestionHistoryController
extends
PonderController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$question
=
id
(
new
PonderQuestionQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$this
->
id
))
->
executeOne
();
if
(!
$question
)
{
return
new
Aphront404Response
();
}
$xactions
=
id
(
new
PonderQuestionTransactionQuery
())
->
setViewer
(
$viewer
)
->
withObjectPHIDs
(
array
(
$question
->
getPHID
()))
->
execute
();
$engine
=
id
(
new
PhabricatorMarkupEngine
())
->
setViewer
(
$viewer
);
foreach
(
$xactions
as
$xaction
)
{
if
(
$xaction
->
getComment
())
{
$engine
->
addObject
(
$xaction
->
getComment
(),
PhabricatorApplicationTransactionComment
::
MARKUP_FIELD_COMMENT
);
}
}
$engine
->
process
();
$timeline
=
id
(
new
PhabricatorApplicationTransactionView
())
->
setUser
(
$viewer
)
->
setObjectPHID
(
$question
->
getPHID
())
->
setTransactions
(
$xactions
)
->
setMarkupEngine
(
$engine
);
$qid
=
$question
->
getID
();
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
"Q{$qid}"
)
->
setHref
(
"/Q{$qid}"
));
$crumbs
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
pht
(
'History'
)));
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$timeline
,
),
array
(
'title'
=>
pht
(
'Question History'
),
'device'
=>
true
,
));
}
}
Event Timeline
Log In to Comment