@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 some low-hanging buildStandardPageResponse() methods

Summary: Ref T9690. I wanted to do an example of how to do these but it looks like most of them are trivial (no callsites) and the rest are a little tricky (weird interaction with frames, or in Releeph).

Test Plan:
- Used `grep` to look for callsites.
- Hit all applications locally, everything worked.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9690

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

+5 -110
-12
src/applications/auth/controller/PhabricatorAuthController.php
··· 2 2 3 3 abstract class PhabricatorAuthController extends PhabricatorController { 4 4 5 - public function buildStandardPageResponse($view, array $data) { 6 - $page = $this->buildStandardPageView(); 7 - 8 - $page->setApplicationName(pht('Login')); 9 - $page->setBaseURI('/login/'); 10 - $page->setTitle(idx($data, 'title')); 11 - $page->appendChild($view); 12 - 13 - $response = new AphrontWebpageResponse(); 14 - return $response->setContent($page->render()); 15 - } 16 - 17 5 protected function renderErrorPage($title, array $messages) { 18 6 $view = new PHUIInfoView(); 19 7 $view->setTitle($title);
-20
src/applications/feed/controller/PhabricatorFeedController.php
··· 2 2 3 3 abstract class PhabricatorFeedController extends PhabricatorController { 4 4 5 - public function buildStandardPageResponse($view, array $data) { 6 - $page = $this->buildStandardPageView(); 7 - 8 - $page->setApplicationName(pht('Feed')); 9 - $page->setBaseURI('/feed/'); 10 - $page->setTitle(idx($data, 'title')); 11 - $page->setGlyph("\xE2\x88\x9E"); 12 - $page->appendChild($view); 13 - 14 - $response = new AphrontWebpageResponse(); 15 - 16 - if (!empty($data['public'])) { 17 - $page->setFrameable(true); 18 - $page->setShowChrome(false); 19 - $response->setFrameable(true); 20 - } 21 - 22 - return $response->setContent($page->render()); 23 - } 24 - 25 5 protected function buildSideNavView() { 26 6 $user = $this->getRequest()->getUser(); 27 7
+1 -16
src/applications/help/controller/PhabricatorHelpController.php
··· 1 1 <?php 2 2 3 - abstract class PhabricatorHelpController extends PhabricatorController { 4 - 5 - public function buildStandardPageResponse($view, array $data) { 6 - $page = $this->buildStandardPageView(); 7 - 8 - $page->setApplicationName(pht('Help')); 9 - $page->setBaseURI('/help/'); 10 - $page->setTitle(idx($data, 'title')); 11 - $page->setGlyph('?'); 12 - $page->appendChild($view); 13 - 14 - $response = new AphrontWebpageResponse(); 15 - return $response->setContent($page->render()); 16 - } 17 - 18 - } 3 + abstract class PhabricatorHelpController extends PhabricatorController {}
-14
src/applications/herald/controller/HeraldController.php
··· 2 2 3 3 abstract class HeraldController extends PhabricatorController { 4 4 5 - public function buildStandardPageResponse($view, array $data) { 6 - $page = $this->buildStandardPageView(); 7 - 8 - $page->setApplicationName(pht('Herald')); 9 - $page->setBaseURI('/herald/'); 10 - $page->setTitle(idx($data, 'title')); 11 - $page->setGlyph("\xE2\x98\xBF"); 12 - 13 - $page->appendChild($view); 14 - 15 - $response = new AphrontWebpageResponse(); 16 - return $response->setContent($page->render()); 17 - } 18 - 19 5 public function buildApplicationMenu() { 20 6 return $this->buildSideNavView(true)->getMenu(); 21 7 }
-13
src/applications/home/controller/PhabricatorHomeController.php
··· 2 2 3 3 abstract class PhabricatorHomeController extends PhabricatorController { 4 4 5 - public function buildStandardPageResponse($view, array $data) { 6 - $page = $this->buildStandardPageView(); 7 - 8 - $page->setBaseURI('/'); 9 - $page->setTitle(idx($data, 'title')); 10 - 11 - $page->setGlyph("\xE2\x9A\x92"); 12 - $page->appendChild($view); 13 - 14 - $response = new AphrontWebpageResponse(); 15 - return $response->setContent($page->render()); 16 - } 17 - 18 5 public function buildNav() { 19 6 $user = $this->getRequest()->getUser(); 20 7
+1 -18
src/applications/notification/controller/PhabricatorNotificationController.php
··· 1 1 <?php 2 2 3 3 abstract class PhabricatorNotificationController 4 - extends PhabricatorController { 5 - 6 - public function buildStandardPageResponse($view, array $data) { 7 - 8 - $page = $this->buildStandardPageView(); 9 - 10 - $page->setApplicationName(pht('Notification')); 11 - $page->setBaseURI('/notification/'); 12 - $page->setTitle(idx($data, 'title')); 13 - $page->setGlyph('!'); 14 - $page->appendChild($view); 15 - 16 - $response = new AphrontWebpageResponse(); 17 - return $response->setContent($page->render()); 18 - 19 - } 20 - 21 - } 4 + extends PhabricatorController {}
-13
src/applications/search/controller/PhabricatorSearchBaseController.php
··· 8 8 const ACTION_BLOCKS = 'blocks'; 9 9 const ACTION_EDGE = 'edge'; 10 10 11 - public function buildStandardPageResponse($view, array $data) { 12 - $page = $this->buildStandardPageView(); 13 - 14 - $page->setApplicationName('Search'); 15 - $page->setBaseURI('/search/'); 16 - $page->setTitle(idx($data, 'title')); 17 - $page->setGlyph("\xC2\xBF"); 18 - $page->appendChild($view); 19 - 20 - $response = new AphrontWebpageResponse(); 21 - return $response->setContent($page->render()); 22 - } 23 - 24 11 }
+3 -4
src/docs/contributor/phabricator_code_layout.diviner
··· 85 85 containing one class, each directory has several classes. A typical example 86 86 happens around the CRUD of an object: 87 87 88 - - **DerpBaseController**: typically extends @{class:PhabricatorController}, 89 - implements `buildStandardPageResponse` with the `Derp` application name 90 - and other `Derp`-specific meta-data, and contains any controller-specific 91 - functionality used throughout the `Derp` application. 88 + - **DerpBaseController**: typically extends @{class:PhabricatorController} 89 + and contains any controller-specific functionality used throughout the 90 + `Derp` application. 92 91 - **DerpDeleteController**: typically extends `DerpBaseController` and 93 92 presents a confirmation dialogue to the user about deleting a `Derp`. 94 93 - **DerpEditController**: typically extends `DerpBaseController` and