@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhamePostHistoryController extends PhamePostController {
4
5 public function shouldAllowPublic() {
6 return true;
7 }
8
9 public function handleRequest(AphrontRequest $request) {
10 $viewer = $request->getViewer();
11
12 $post = id(new PhamePostQuery())
13 ->setViewer($viewer)
14 ->withIDs(array($request->getURIData('id')))
15 ->executeOne();
16
17 if (!$post) {
18 return new Aphront404Response();
19 }
20
21 $blog = $post->getBlog();
22
23 $crumbs = $this->buildApplicationCrumbs();
24 if ($blog) {
25 $crumbs->addTextCrumb(
26 $blog->getName(),
27 $this->getApplicationURI('blog/view/'.$blog->getID().'/'));
28 } else {
29 $crumbs->addTextCrumb(
30 pht('[No Blog]'),
31 null);
32 }
33 $crumbs->addTextCrumb(
34 $post->getTitle(),
35 $this->getApplicationURI('post/view/'.$post->getID().'/'));
36 $crumbs->addTextCrumb(pht('Post History'));
37 $crumbs->setBorder(true);
38
39 $timeline = $this->buildTransactionTimeline(
40 $post,
41 new PhamePostTransactionQuery());
42 $timeline->setShouldTerminate(true);
43
44 return $this->newPage()
45 ->setTitle($post->getTitle())
46 ->setPageObjectPHIDs(array($post->getPHID()))
47 ->setCrumbs($crumbs)
48 ->appendChild(
49 array(
50 $timeline,
51 ));
52 }
53
54
55}