1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

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
This commit is contained in:
epriestley 2015-11-02 12:43:05 -08:00
parent 300c74c49d
commit 1b00ef08a0
8 changed files with 5 additions and 110 deletions

View file

@ -2,18 +2,6 @@
abstract class PhabricatorAuthController extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setApplicationName(pht('Login'));
$page->setBaseURI('/login/');
$page->setTitle(idx($data, 'title'));
$page->appendChild($view);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
protected function renderErrorPage($title, array $messages) {
$view = new PHUIInfoView();
$view->setTitle($title);

View file

@ -2,26 +2,6 @@
abstract class PhabricatorFeedController extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setApplicationName(pht('Feed'));
$page->setBaseURI('/feed/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x88\x9E");
$page->appendChild($view);
$response = new AphrontWebpageResponse();
if (!empty($data['public'])) {
$page->setFrameable(true);
$page->setShowChrome(false);
$response->setFrameable(true);
}
return $response->setContent($page->render());
}
protected function buildSideNavView() {
$user = $this->getRequest()->getUser();

View file

@ -1,18 +1,3 @@
<?php
abstract class PhabricatorHelpController extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setApplicationName(pht('Help'));
$page->setBaseURI('/help/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph('?');
$page->appendChild($view);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
}
abstract class PhabricatorHelpController extends PhabricatorController {}

View file

@ -2,20 +2,6 @@
abstract class HeraldController extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setApplicationName(pht('Herald'));
$page->setBaseURI('/herald/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x98\xBF");
$page->appendChild($view);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
public function buildApplicationMenu() {
return $this->buildSideNavView(true)->getMenu();
}

View file

@ -2,19 +2,6 @@
abstract class PhabricatorHomeController extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setBaseURI('/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x9A\x92");
$page->appendChild($view);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
public function buildNav() {
$user = $this->getRequest()->getUser();

View file

@ -1,21 +1,4 @@
<?php
abstract class PhabricatorNotificationController
extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setApplicationName(pht('Notification'));
$page->setBaseURI('/notification/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph('!');
$page->appendChild($view);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
}
extends PhabricatorController {}

View file

@ -8,17 +8,4 @@ abstract class PhabricatorSearchBaseController extends PhabricatorController {
const ACTION_BLOCKS = 'blocks';
const ACTION_EDGE = 'edge';
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
$page->setApplicationName('Search');
$page->setBaseURI('/search/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("\xC2\xBF");
$page->appendChild($view);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());
}
}

View file

@ -85,10 +85,9 @@ However, it is likely that `Derp` is even more complex, and rather than
containing one class, each directory has several classes. A typical example
happens around the CRUD of an object:
- **DerpBaseController**: typically extends @{class:PhabricatorController},
implements `buildStandardPageResponse` with the `Derp` application name
and other `Derp`-specific meta-data, and contains any controller-specific
functionality used throughout the `Derp` application.
- **DerpBaseController**: typically extends @{class:PhabricatorController}
and contains any controller-specific functionality used throughout the
`Derp` application.
- **DerpDeleteController**: typically extends `DerpBaseController` and
presents a confirmation dialogue to the user about deleting a `Derp`.
- **DerpEditController**: typically extends `DerpBaseController` and