Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phame / controller / post / PhamePostHistoryController.php
blob616538f4bcd50e80246d8bd2203c75493c40aae0
1 <?php
3 final class PhamePostHistoryController extends PhamePostController {
5 public function shouldAllowPublic() {
6 return true;
9 public function handleRequest(AphrontRequest $request) {
10 $viewer = $request->getViewer();
12 $post = id(new PhamePostQuery())
13 ->setViewer($viewer)
14 ->withIDs(array($request->getURIData('id')))
15 ->executeOne();
17 if (!$post) {
18 return new Aphront404Response();
21 $blog = $post->getBlog();
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);
33 $crumbs->addTextCrumb(
34 $post->getTitle(),
35 $this->getApplicationURI('post/view/'.$post->getID().'/'));
36 $crumbs->addTextCrumb(pht('Post History'));
37 $crumbs->setBorder(true);
39 $timeline = $this->buildTransactionTimeline(
40 $post,
41 new PhamePostTransactionQuery());
42 $timeline->setShouldTerminate(true);
44 return $this->newPage()
45 ->setTitle($post->getTitle())
46 ->setPageObjectPHIDs(array($post->getPHID()))
47 ->setCrumbs($crumbs)
48 ->appendChild(
49 array(
50 $timeline,
51 ));