3 final class PhamePostEditController
extends PhamePostController
{
7 public function setBlog(PhameBlog
$blog) {
12 public function getBlog() {
16 public function handleRequest(AphrontRequest
$request) {
17 $viewer = $request->getViewer();
18 $id = $request->getURIData('id');
21 $post = id(new PhamePostQuery())
26 return new Aphront404Response();
28 $blog = $post->getBlog();
30 $blog_id = head($request->getArr('blog'));
32 $blog_id = $request->getStr('blog');
35 $query = id(new PhameBlogQuery())
37 ->requireCapabilities(
39 PhabricatorPolicyCapability
::CAN_VIEW
,
40 PhabricatorPolicyCapability
::CAN_EDIT
,
43 if (ctype_digit($blog_id)) {
44 $query->withIDs(array($blog_id));
46 $query->withPHIDs(array($blog_id));
49 $blog = $query->executeOne();
51 return new Aphront404Response();
55 $this->setBlog($blog);
57 return id(new PhamePostEditEngine())
58 ->setController($this)
63 protected function buildApplicationCrumbs() {
64 $crumbs = parent
::buildApplicationCrumbs();
66 $blog = $this->getBlog();
68 $crumbs->addTextCrumb(