mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 10:42:41 +01:00
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:
parent
df3162584e
commit
74b438db13
13 changed files with 132 additions and 41 deletions
|
@ -2564,7 +2564,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'phabricator-nav-view-css' =>
|
'phabricator-nav-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/82636b80/rsrc/css/aphront/phabricator-nav-view.css',
|
'uri' => '/res/051b6ab6/rsrc/css/aphront/phabricator-nav-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -551,6 +551,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorApplicationFact' => 'applications/fact/application/PhabricatorApplicationFact.php',
|
'PhabricatorApplicationFact' => 'applications/fact/application/PhabricatorApplicationFact.php',
|
||||||
'PhabricatorApplicationFlags' => 'applications/flag/application/PhabricatorApplicationFlags.php',
|
'PhabricatorApplicationFlags' => 'applications/flag/application/PhabricatorApplicationFlags.php',
|
||||||
'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php',
|
'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php',
|
||||||
|
'PhabricatorApplicationMailingLists' => 'applications/mailinglists/application/PhabricatorApplicationMailingLists.php',
|
||||||
'PhabricatorApplicationManiphest' => 'applications/maniphest/application/PhabricatorApplicationManiphest.php',
|
'PhabricatorApplicationManiphest' => 'applications/maniphest/application/PhabricatorApplicationManiphest.php',
|
||||||
'PhabricatorApplicationPeople' => 'applications/people/application/PhabricatorApplicationPeople.php',
|
'PhabricatorApplicationPeople' => 'applications/people/application/PhabricatorApplicationPeople.php',
|
||||||
'PhabricatorApplicationPhriction' => 'applications/phriction/application/PhabricatorApplicationPhriction.php',
|
'PhabricatorApplicationPhriction' => 'applications/phriction/application/PhabricatorApplicationPhriction.php',
|
||||||
|
@ -777,6 +778,8 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorMailImplementationSendGridAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php',
|
'PhabricatorMailImplementationSendGridAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php',
|
||||||
'PhabricatorMailImplementationTestAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php',
|
'PhabricatorMailImplementationTestAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php',
|
||||||
'PhabricatorMailReplyHandler' => 'applications/metamta/replyhandler/PhabricatorMailReplyHandler.php',
|
'PhabricatorMailReplyHandler' => 'applications/metamta/replyhandler/PhabricatorMailReplyHandler.php',
|
||||||
|
'PhabricatorMailingListsEditController' => 'applications/mailinglists/controller/PhabricatorMailingListsEditController.php',
|
||||||
|
'PhabricatorMailingListsListController' => 'applications/mailinglists/controller/PhabricatorMailingListsListController.php',
|
||||||
'PhabricatorMainMenuGroupView' => 'view/page/menu/PhabricatorMainMenuGroupView.php',
|
'PhabricatorMainMenuGroupView' => 'view/page/menu/PhabricatorMainMenuGroupView.php',
|
||||||
'PhabricatorMainMenuIconView' => 'view/page/menu/PhabricatorMainMenuIconView.php',
|
'PhabricatorMainMenuIconView' => 'view/page/menu/PhabricatorMainMenuIconView.php',
|
||||||
'PhabricatorMainMenuSearchView' => 'view/page/menu/PhabricatorMainMenuSearchView.php',
|
'PhabricatorMainMenuSearchView' => 'view/page/menu/PhabricatorMainMenuSearchView.php',
|
||||||
|
@ -795,9 +798,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorMetaMTAMailBody' => 'applications/metamta/view/PhabricatorMetaMTAMailBody.php',
|
'PhabricatorMetaMTAMailBody' => 'applications/metamta/view/PhabricatorMetaMTAMailBody.php',
|
||||||
'PhabricatorMetaMTAMailBodyTestCase' => 'applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php',
|
'PhabricatorMetaMTAMailBodyTestCase' => 'applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php',
|
||||||
'PhabricatorMetaMTAMailTestCase' => 'applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php',
|
'PhabricatorMetaMTAMailTestCase' => 'applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php',
|
||||||
'PhabricatorMetaMTAMailingList' => 'applications/metamta/storage/PhabricatorMetaMTAMailingList.php',
|
'PhabricatorMetaMTAMailingList' => 'applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php',
|
||||||
'PhabricatorMetaMTAMailingListEditController' => 'applications/metamta/controller/PhabricatorMetaMTAMailingListEditController.php',
|
|
||||||
'PhabricatorMetaMTAMailingListsController' => 'applications/metamta/controller/PhabricatorMetaMTAMailingListsController.php',
|
|
||||||
'PhabricatorMetaMTAReceiveController' => 'applications/metamta/controller/PhabricatorMetaMTAReceiveController.php',
|
'PhabricatorMetaMTAReceiveController' => 'applications/metamta/controller/PhabricatorMetaMTAReceiveController.php',
|
||||||
'PhabricatorMetaMTAReceivedListController' => 'applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php',
|
'PhabricatorMetaMTAReceivedListController' => 'applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php',
|
||||||
'PhabricatorMetaMTAReceivedMail' => 'applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php',
|
'PhabricatorMetaMTAReceivedMail' => 'applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php',
|
||||||
|
@ -1670,6 +1671,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorApplicationFact' => 'PhabricatorApplication',
|
'PhabricatorApplicationFact' => 'PhabricatorApplication',
|
||||||
'PhabricatorApplicationFlags' => 'PhabricatorApplication',
|
'PhabricatorApplicationFlags' => 'PhabricatorApplication',
|
||||||
'PhabricatorApplicationLaunchView' => 'AphrontView',
|
'PhabricatorApplicationLaunchView' => 'AphrontView',
|
||||||
|
'PhabricatorApplicationMailingLists' => 'PhabricatorApplication',
|
||||||
'PhabricatorApplicationManiphest' => 'PhabricatorApplication',
|
'PhabricatorApplicationManiphest' => 'PhabricatorApplication',
|
||||||
'PhabricatorApplicationPeople' => 'PhabricatorApplication',
|
'PhabricatorApplicationPeople' => 'PhabricatorApplication',
|
||||||
'PhabricatorApplicationPhriction' => 'PhabricatorApplication',
|
'PhabricatorApplicationPhriction' => 'PhabricatorApplication',
|
||||||
|
@ -1678,7 +1680,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorApplicationSettings' => 'PhabricatorApplication',
|
'PhabricatorApplicationSettings' => 'PhabricatorApplication',
|
||||||
'PhabricatorApplicationStatusView' => 'AphrontView',
|
'PhabricatorApplicationStatusView' => 'AphrontView',
|
||||||
'PhabricatorApplicationsController' => 'PhabricatorController',
|
'PhabricatorApplicationsController' => 'PhabricatorController',
|
||||||
'PhabricatorApplicationsListController' => 'PhabricatorApplicationsController',
|
'PhabricatorApplicationsListController' => 'PhabricatorController',
|
||||||
'PhabricatorAuditAddCommentController' => 'PhabricatorAuditController',
|
'PhabricatorAuditAddCommentController' => 'PhabricatorAuditController',
|
||||||
'PhabricatorAuditComment' => 'PhabricatorAuditDAO',
|
'PhabricatorAuditComment' => 'PhabricatorAuditDAO',
|
||||||
'PhabricatorAuditCommitListView' => 'AphrontView',
|
'PhabricatorAuditCommitListView' => 'AphrontView',
|
||||||
|
@ -1869,6 +1871,8 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorMailImplementationPHPMailerLiteAdapter' => 'PhabricatorMailImplementationAdapter',
|
'PhabricatorMailImplementationPHPMailerLiteAdapter' => 'PhabricatorMailImplementationAdapter',
|
||||||
'PhabricatorMailImplementationSendGridAdapter' => 'PhabricatorMailImplementationAdapter',
|
'PhabricatorMailImplementationSendGridAdapter' => 'PhabricatorMailImplementationAdapter',
|
||||||
'PhabricatorMailImplementationTestAdapter' => 'PhabricatorMailImplementationAdapter',
|
'PhabricatorMailImplementationTestAdapter' => 'PhabricatorMailImplementationAdapter',
|
||||||
|
'PhabricatorMailingListsEditController' => 'PhabricatorController',
|
||||||
|
'PhabricatorMailingListsListController' => 'PhabricatorController',
|
||||||
'PhabricatorMainMenuGroupView' => 'AphrontView',
|
'PhabricatorMainMenuGroupView' => 'AphrontView',
|
||||||
'PhabricatorMainMenuIconView' => 'AphrontView',
|
'PhabricatorMainMenuIconView' => 'AphrontView',
|
||||||
'PhabricatorMainMenuSearchView' => 'AphrontView',
|
'PhabricatorMainMenuSearchView' => 'AphrontView',
|
||||||
|
@ -1882,8 +1886,6 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorMetaMTAMailBodyTestCase' => 'PhabricatorTestCase',
|
'PhabricatorMetaMTAMailBodyTestCase' => 'PhabricatorTestCase',
|
||||||
'PhabricatorMetaMTAMailTestCase' => 'PhabricatorTestCase',
|
'PhabricatorMetaMTAMailTestCase' => 'PhabricatorTestCase',
|
||||||
'PhabricatorMetaMTAMailingList' => 'PhabricatorMetaMTADAO',
|
'PhabricatorMetaMTAMailingList' => 'PhabricatorMetaMTADAO',
|
||||||
'PhabricatorMetaMTAMailingListEditController' => 'PhabricatorMetaMTAController',
|
|
||||||
'PhabricatorMetaMTAMailingListsController' => 'PhabricatorMetaMTAController',
|
|
||||||
'PhabricatorMetaMTAReceiveController' => 'PhabricatorMetaMTAController',
|
'PhabricatorMetaMTAReceiveController' => 'PhabricatorMetaMTAController',
|
||||||
'PhabricatorMetaMTAReceivedListController' => 'PhabricatorMetaMTAController',
|
'PhabricatorMetaMTAReceivedListController' => 'PhabricatorMetaMTAController',
|
||||||
'PhabricatorMetaMTAReceivedMail' => 'PhabricatorMetaMTADAO',
|
'PhabricatorMetaMTAReceivedMail' => 'PhabricatorMetaMTADAO',
|
||||||
|
|
|
@ -85,9 +85,6 @@ class AphrontDefaultApplicationConfiguration
|
||||||
'' => 'PhabricatorMetaMTAListController',
|
'' => 'PhabricatorMetaMTAListController',
|
||||||
'send/' => 'PhabricatorMetaMTASendController',
|
'send/' => 'PhabricatorMetaMTASendController',
|
||||||
'view/(?P<id>\d+)/' => 'PhabricatorMetaMTAViewController',
|
'view/(?P<id>\d+)/' => 'PhabricatorMetaMTAViewController',
|
||||||
'lists/' => 'PhabricatorMetaMTAMailingListsController',
|
|
||||||
'lists/edit/(?:(?P<id>\d+)/)?'
|
|
||||||
=> 'PhabricatorMetaMTAMailingListEditController',
|
|
||||||
'receive/' => 'PhabricatorMetaMTAReceiveController',
|
'receive/' => 'PhabricatorMetaMTAReceiveController',
|
||||||
'received/' => 'PhabricatorMetaMTAReceivedListController',
|
'received/' => 'PhabricatorMetaMTAReceivedListController',
|
||||||
'sendgrid/' => 'PhabricatorMetaMTASendGridReceiveController',
|
'sendgrid/' => 'PhabricatorMetaMTASendGridReceiveController',
|
||||||
|
|
|
@ -66,6 +66,10 @@ abstract class PhabricatorApplication {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTitleGlyph() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -( URI Routing )-------------------------------------------------------- */
|
/* -( URI Routing )-------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,44 @@ abstract class PhabricatorController extends AphrontController {
|
||||||
return $response;
|
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) {
|
public function didProcessRequest($response) {
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$response->setRequest($request);
|
$response->setRequest($request);
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2012 Facebook, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
final class PhabricatorApplicationMailingLists extends PhabricatorApplication {
|
||||||
|
|
||||||
|
public function getName() {
|
||||||
|
return 'Mailing Lists';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseURI() {
|
||||||
|
return '/mailinglists/';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getShortDescription() {
|
||||||
|
return 'Manage External Lists';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRoutes() {
|
||||||
|
return array(
|
||||||
|
'/mailinglists/' => array(
|
||||||
|
'' => 'PhabricatorMailingListsListController',
|
||||||
|
'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorMailingListsEditController',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitleGlyph() {
|
||||||
|
return '@';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -16,8 +16,8 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class PhabricatorMetaMTAMailingListEditController
|
final class PhabricatorMailingListsEditController
|
||||||
extends PhabricatorMetaMTAController {
|
extends PhabricatorController {
|
||||||
|
|
||||||
private $id;
|
private $id;
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ final class PhabricatorMetaMTAMailingListEditController
|
||||||
try {
|
try {
|
||||||
$list->save();
|
$list->save();
|
||||||
return id(new AphrontRedirectResponse())
|
return id(new AphrontRedirectResponse())
|
||||||
->setURI('/mail/lists/');
|
->setURI($this->getApplicationURI());
|
||||||
} catch (AphrontQueryDuplicateKeyException $ex) {
|
} catch (AphrontQueryDuplicateKeyException $ex) {
|
||||||
$e_email = 'Duplicate';
|
$e_email = 'Duplicate';
|
||||||
$errors[] = 'Another mailing list already uses that address.';
|
$errors[] = 'Another mailing list already uses that address.';
|
||||||
|
@ -92,9 +92,9 @@ final class PhabricatorMetaMTAMailingListEditController
|
||||||
$form = new AphrontFormView();
|
$form = new AphrontFormView();
|
||||||
$form->setUser($request->getUser());
|
$form->setUser($request->getUser());
|
||||||
if ($list->getID()) {
|
if ($list->getID()) {
|
||||||
$form->setAction('/mail/lists/edit/'.$list->getID().'/');
|
$form->setAction($this->getApplicationURI('/edit/'.$list->getID().'/'));
|
||||||
} else {
|
} else {
|
||||||
$form->setAction('/mail/lists/edit/');
|
$form->setAction($this->getApplicationURI('/edit/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$form
|
$form
|
||||||
|
@ -119,10 +119,6 @@ final class PhabricatorMetaMTAMailingListEditController
|
||||||
->setError($e_uri)
|
->setError($e_uri)
|
||||||
->setCaption('Optional link to mailing list archives or info.')
|
->setCaption('Optional link to mailing list archives or info.')
|
||||||
->setValue($list->getURI()))
|
->setValue($list->getURI()))
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormStaticControl())
|
|
||||||
->setLabel('ID')
|
|
||||||
->setValue(nonempty($list->getID(), '-')))
|
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormStaticControl())
|
id(new AphrontFormStaticControl())
|
||||||
->setLabel('PHID')
|
->setLabel('PHID')
|
||||||
|
@ -130,7 +126,7 @@ final class PhabricatorMetaMTAMailingListEditController
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSubmitControl())
|
id(new AphrontFormSubmitControl())
|
||||||
->setValue('Save')
|
->setValue('Save')
|
||||||
->addCancelButton('/mail/lists/'));
|
->addCancelButton($this->getApplicationURI()));
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
$panel = new AphrontPanelView();
|
||||||
if ($list->getID()) {
|
if ($list->getID()) {
|
||||||
|
@ -142,8 +138,11 @@ final class PhabricatorMetaMTAMailingListEditController
|
||||||
$panel->appendChild($form);
|
$panel->appendChild($form);
|
||||||
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
|
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
return $this->buildApplicationPage(
|
||||||
array($error_view, $panel),
|
array(
|
||||||
|
$error_view,
|
||||||
|
$panel,
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'title' => 'Edit Mailing List',
|
'title' => 'Edit Mailing List',
|
||||||
));
|
));
|
|
@ -16,8 +16,8 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class PhabricatorMetaMTAMailingListsController
|
final class PhabricatorMailingListsListController
|
||||||
extends PhabricatorMetaMTAController {
|
extends PhabricatorController {
|
||||||
|
|
||||||
public function processRequest() {
|
public function processRequest() {
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
@ -25,7 +25,7 @@ final class PhabricatorMetaMTAMailingListsController
|
||||||
$offset = $request->getInt('offset', 0);
|
$offset = $request->getInt('offset', 0);
|
||||||
|
|
||||||
$pager = new AphrontPagerView();
|
$pager = new AphrontPagerView();
|
||||||
$pager->setPageSize(1000);
|
$pager->setPageSize(250);
|
||||||
$pager->setOffset($offset);
|
$pager->setOffset($offset);
|
||||||
$pager->setURI($request->getRequestURI(), 'offset');
|
$pager->setURI($request->getRequestURI(), 'offset');
|
||||||
|
|
||||||
|
@ -45,14 +45,13 @@ final class PhabricatorMetaMTAMailingListsController
|
||||||
$rows = array();
|
$rows = array();
|
||||||
foreach ($lists as $list) {
|
foreach ($lists as $list) {
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
phutil_escape_html($list->getPHID()),
|
|
||||||
phutil_escape_html($list->getEmail()),
|
|
||||||
phutil_escape_html($list->getName()),
|
phutil_escape_html($list->getName()),
|
||||||
|
phutil_escape_html($list->getEmail()),
|
||||||
phutil_render_tag(
|
phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'class' => 'button grey small',
|
'class' => 'button grey small',
|
||||||
'href' => '/mail/lists/edit/'.$list->getID().'/',
|
'href' => $this->getApplicationURI('/edit/'.$list->getID().'/'),
|
||||||
),
|
),
|
||||||
'Edit'),
|
'Edit'),
|
||||||
);
|
);
|
||||||
|
@ -61,14 +60,12 @@ final class PhabricatorMetaMTAMailingListsController
|
||||||
$table = new AphrontTableView($rows);
|
$table = new AphrontTableView($rows);
|
||||||
$table->setHeaders(
|
$table->setHeaders(
|
||||||
array(
|
array(
|
||||||
'PHID',
|
|
||||||
'Email',
|
|
||||||
'Name',
|
'Name',
|
||||||
|
'Email',
|
||||||
'',
|
'',
|
||||||
));
|
));
|
||||||
$table->setColumnClasses(
|
$table->setColumnClasses(
|
||||||
array(
|
array(
|
||||||
null,
|
|
||||||
null,
|
null,
|
||||||
'wide',
|
'wide',
|
||||||
'action',
|
'action',
|
||||||
|
@ -77,10 +74,10 @@ final class PhabricatorMetaMTAMailingListsController
|
||||||
$panel = new AphrontPanelView();
|
$panel = new AphrontPanelView();
|
||||||
$panel->appendChild($table);
|
$panel->appendChild($table);
|
||||||
$panel->setHeader('Mailing Lists');
|
$panel->setHeader('Mailing Lists');
|
||||||
$panel->setCreateButton('Add New List', '/mail/lists/edit/');
|
$panel->setCreateButton('Add New List', $this->getApplicationURI('/edit/'));
|
||||||
$panel->appendChild($pager);
|
$panel->appendChild($pager);
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
return $this->buildApplicationPage(
|
||||||
$panel,
|
$panel,
|
||||||
array(
|
array(
|
||||||
'title' => 'Mailing Lists',
|
'title' => 'Mailing Lists',
|
|
@ -38,6 +38,10 @@ final class PhabricatorApplicationApplications extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTitleGlyph() {
|
||||||
|
return "\xE0\xBC\x84";
|
||||||
|
}
|
||||||
|
|
||||||
public function shouldAppearInLaunchView() {
|
public function shouldAppearInLaunchView() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class PhabricatorApplicationsListController
|
final class PhabricatorApplicationsListController
|
||||||
extends PhabricatorApplicationsController {
|
extends PhabricatorController {
|
||||||
|
|
||||||
public function processRequest() {
|
public function processRequest() {
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
@ -52,7 +52,7 @@ final class PhabricatorApplicationsListController
|
||||||
),
|
),
|
||||||
id(new AphrontNullView())->appendChild($views)->render());
|
id(new AphrontNullView())->appendChild($views)->render());
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
return $this->buildApplicationPage(
|
||||||
$view,
|
$view,
|
||||||
array(
|
array(
|
||||||
'title' => 'Applications',
|
'title' => 'Applications',
|
||||||
|
|
|
@ -137,12 +137,14 @@ final class AphrontSideNavFilterView extends AphrontView {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render() {
|
public function render() {
|
||||||
|
if ($this->items) {
|
||||||
if (!$this->baseURI) {
|
if (!$this->baseURI) {
|
||||||
throw new Exception("Call setBaseURI() before render()!");
|
throw new Exception("Call setBaseURI() before render()!");
|
||||||
}
|
}
|
||||||
if ($this->selectedFilter === false) {
|
if ($this->selectedFilter === false) {
|
||||||
throw new Exception("Call selectFilter() before render()!");
|
throw new Exception("Call selectFilter() before render()!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$view = new AphrontSideNavView();
|
$view = new AphrontSideNavView();
|
||||||
$view->setFlexNav($this->flexNav);
|
$view->setFlexNav($this->flexNav);
|
||||||
|
|
|
@ -73,6 +73,8 @@ final class AphrontSideNavView extends AphrontView {
|
||||||
$content_id = celerity_generate_unique_node_id();
|
$content_id = celerity_generate_unique_node_id();
|
||||||
$collapse_id = null;
|
$collapse_id = null;
|
||||||
$expand_id = null;
|
$expand_id = null;
|
||||||
|
$local_id = null;
|
||||||
|
$local_menu = null;
|
||||||
$main_id = celerity_generate_unique_node_id();
|
$main_id = celerity_generate_unique_node_id();
|
||||||
|
|
||||||
$apps = $this->renderApplications();
|
$apps = $this->renderApplications();
|
||||||
|
@ -227,7 +229,7 @@ final class AphrontSideNavView extends AphrontView {
|
||||||
$core = mpull($core, null, 'getPHID');
|
$core = mpull($core, null, 'getPHID');
|
||||||
|
|
||||||
if ($current && empty($core[$current->getPHID()])) {
|
if ($current && empty($core[$current->getPHID()])) {
|
||||||
array_unshift($core, $this->current);
|
array_unshift($core, $current);
|
||||||
}
|
}
|
||||||
|
|
||||||
$apps = array();
|
$apps = array();
|
||||||
|
|
Loading…
Reference in a new issue