[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhamePostFramedController extends PhameController { 4 5 private $id; 6 7 public function willProcessRequest(array $data) { 8 $this->id = $data['id']; 9 } 10 11 public function processRequest() { 12 $request = $this->getRequest(); 13 $user = $request->getUser(); 14 15 $post = id(new PhamePostQuery()) 16 ->setViewer($user) 17 ->withIDs(array($this->id)) 18 ->requireCapabilities( 19 array( 20 PhabricatorPolicyCapability::CAN_EDIT, 21 )) 22 ->executeOne(); 23 if (!$post) { 24 return new Aphront404Response(); 25 } 26 27 $blog = $post->getBlog(); 28 29 $phame_request = $request->setPath('/post/'.$post->getPhameTitle()); 30 $skin = $post->getBlog()->getSkinRenderer($phame_request); 31 32 $uri = clone $request->getRequestURI(); 33 $uri->setPath('/phame/live/'.$blog->getID().'/'); 34 35 $skin 36 ->setPreview(true) 37 ->setBlog($post->getBlog()) 38 ->setBaseURI((string)$uri); 39 40 $response = $skin->processRequest(); 41 $response->setFrameable(true); 42 return $response; 43 } 44 45 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |