Move "Mailing Lists" to a separate application
Summary: There's currently no way to get here from the UI since nav tabs don't exist anymore. It's also always been hard to find this feature even when we had the tabs, since it's surprising that it's inside "MetaMTA". - Move mailing lists to a separate application. - Add `buildApplicationPage()`, since we don't really need `buildStandardPageResponse()` any more -- we can infer all the information from `PhabricatorApplication`. This will let us get rid of a lot of the `PhabricatorXXXController` classes which just define application information. - Add `getApplicationURI()` to reduce code duplication, and in case we want to let you move applications around some day. Test Plan: Looked/edited/saved mailing lists. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran Maniphest Tasks: T631 Differential Revision: https://secure.phabricator.com/D3248
This commit is contained in:
@@ -128,6 +128,44 @@ abstract class PhabricatorController extends AphrontController {
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function getApplicationURI($path = '') {
|
||||
if (!$this->getCurrentApplication()) {
|
||||
throw new Exception("No application!");
|
||||
}
|
||||
return $this->getCurrentApplication()->getBaseURI().ltrim($path, '/');
|
||||
}
|
||||
|
||||
public function buildApplicationPage($view, array $options) {
|
||||
$page = $this->buildStandardPageView();
|
||||
|
||||
$application = $this->getCurrentApplication();
|
||||
if ($application) {
|
||||
$page->setApplicationName($application->getName());
|
||||
$page->setTitle(idx($options, 'title'));
|
||||
if ($application->getTitleGlyph()) {
|
||||
$page->setGlyph($application->getTitleGlyph());
|
||||
}
|
||||
}
|
||||
|
||||
if (!($view instanceof AphrontSideNavFilterView)) {
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
if ($application) {
|
||||
$nav->setCurrentApplication($application);
|
||||
}
|
||||
$nav->setUser($this->getRequest()->getUser());
|
||||
$nav->setFlexNav(true);
|
||||
$nav->setShowApplicationMenu(true);
|
||||
$nav->appendChild($view);
|
||||
|
||||
$view = $nav;
|
||||
}
|
||||
|
||||
$page->appendChild($view);
|
||||
|
||||
$response = new AphrontWebpageResponse();
|
||||
return $response->setContent($page->render());
|
||||
}
|
||||
|
||||
public function didProcessRequest($response) {
|
||||
$request = $this->getRequest();
|
||||
$response->setRequest($request);
|
||||
|
||||
Reference in New Issue
Block a user