@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove delete function in PhamePost

Summary: Ref T9756, removes the ability to delete a PhamePost

Test Plan: See link removed, unpublish post, publish post, new post.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9756

Differential Revision: https://secure.phabricator.com/D14581

-52
-2
src/__phutil_library_map__.php
··· 3302 3302 'PhamePost' => 'applications/phame/storage/PhamePost.php', 3303 3303 'PhamePostCommentController' => 'applications/phame/controller/post/PhamePostCommentController.php', 3304 3304 'PhamePostController' => 'applications/phame/controller/post/PhamePostController.php', 3305 - 'PhamePostDeleteController' => 'applications/phame/controller/post/PhamePostDeleteController.php', 3306 3305 'PhamePostEditController' => 'applications/phame/controller/post/PhamePostEditController.php', 3307 3306 'PhamePostEditor' => 'applications/phame/editor/PhamePostEditor.php', 3308 3307 'PhamePostFramedController' => 'applications/phame/controller/post/PhamePostFramedController.php', ··· 7618 7617 ), 7619 7618 'PhamePostCommentController' => 'PhamePostController', 7620 7619 'PhamePostController' => 'PhameController', 7621 - 'PhamePostDeleteController' => 'PhamePostController', 7622 7620 'PhamePostEditController' => 'PhamePostController', 7623 7621 'PhamePostEditor' => 'PhabricatorApplicationTransactionEditor', 7624 7622 'PhamePostFramedController' => 'PhamePostController',
-1
src/applications/phame/application/PhabricatorPhameApplication.php
··· 44 44 '(?:(?P<filter>draft|all)/)?' => 'PhamePostListController', 45 45 '(?:query/(?P<queryKey>[^/]+)/)?' => 'PhamePostListController', 46 46 'blogger/(?P<bloggername>[\w\.-_]+)/' => 'PhamePostListController', 47 - 'delete/(?P<id>[^/]+)/' => 'PhamePostDeleteController', 48 47 'edit/(?:(?P<id>[^/]+)/)?' => 'PhamePostEditController', 49 48 'view/(?P<id>\d+)/' => 'PhamePostViewController', 50 49 'publish/(?P<id>\d+)/' => 'PhamePostPublishController',
-41
src/applications/phame/controller/post/PhamePostDeleteController.php
··· 1 - <?php 2 - 3 - final class PhamePostDeleteController extends PhamePostController { 4 - 5 - public function handleRequest(AphrontRequest $request) { 6 - $viewer = $request->getViewer(); 7 - 8 - $post = id(new PhamePostQuery()) 9 - ->setViewer($viewer) 10 - ->withIDs(array($request->getURIData('id'))) 11 - ->requireCapabilities( 12 - array( 13 - PhabricatorPolicyCapability::CAN_EDIT, 14 - )) 15 - ->executeOne(); 16 - if (!$post) { 17 - return new Aphront404Response(); 18 - } 19 - 20 - if ($request->isFormPost()) { 21 - $post->delete(); 22 - return id(new AphrontRedirectResponse()) 23 - ->setURI('/phame/post/'); 24 - } 25 - 26 - $cancel_uri = $this->getApplicationURI('/post/view/'.$post->getID().'/'); 27 - 28 - $dialog = id(new AphrontDialogView()) 29 - ->setUser($viewer) 30 - ->setTitle(pht('Delete Post?')) 31 - ->appendChild( 32 - pht( 33 - 'Really delete the post "%s"? It will be gone forever.', 34 - $post->getTitle())) 35 - ->addSubmitButton(pht('Delete')) 36 - ->addCancelButton($cancel_uri); 37 - 38 - return id(new AphrontDialogResponse())->setDialog($dialog); 39 - } 40 - 41 - }
-8
src/applications/phame/controller/post/PhamePostViewController.php
··· 157 157 ->setWorkflow(true)); 158 158 } 159 159 160 - $actions->addAction( 161 - id(new PhabricatorActionView()) 162 - ->setIcon('fa-times') 163 - ->setHref($this->getApplicationURI('post/delete/'.$id.'/')) 164 - ->setName(pht('Delete Post')) 165 - ->setDisabled(!$can_edit) 166 - ->setWorkflow(true)); 167 - 168 160 $blog = $post->getBlog(); 169 161 $can_view_live = $blog && !$post->isDraft(); 170 162