Skip to content

Commit 42896f9

Browse files
author
epriestley
committed
Rename all ProfilePanels into ProfileMenuItems
Summary: Ref T11957. Test Plan: - Viewed an existing project profile. - Viewed a user profile. - Created a new project. - Edited a profile menu. - Added new profile items. - Grepped for renamed symbols. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11957 Differential Revision: https://secure.phabricator.com/D17028
1 parent 8480776 commit 42896f9

File tree

40 files changed

+389
-388
lines changed

40 files changed

+389
-388
lines changed

src/__phutil_library_map__.php

Lines changed: 30 additions & 30 deletions
Large diffs are not rendered by default.

src/applications/base/PhabricatorApplication.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -627,18 +627,18 @@ protected function getQueryRoutePattern($base = null) {
627627
return $base.'(?:query/(?P<queryKey>[^/]+)/)?';
628628
}
629629

630-
protected function getPanelRouting($controller) {
630+
protected function getProfileMenuRouting($controller) {
631631
$edit_route = $this->getEditRoutePattern();
632632

633633
return array(
634-
'(?P<panelAction>view)/(?P<panelID>[^/]+)/' => $controller,
635-
'(?P<panelAction>hide)/(?P<panelID>[^/]+)/' => $controller,
636-
'(?P<panelAction>default)/(?P<panelID>[^/]+)/' => $controller,
637-
'(?P<panelAction>configure)/' => $controller,
638-
'(?P<panelAction>reorder)/' => $controller,
639-
'(?P<panelAction>edit)/'.$edit_route => $controller,
640-
'(?P<panelAction>new)/(?<panelKey>[^/]+)/'.$edit_route => $controller,
641-
'(?P<panelAction>builtin)/(?<panelID>[^/]+)/'.$edit_route
634+
'(?P<itemAction>view)/(?P<itemID>[^/]+)/' => $controller,
635+
'(?P<itemAction>hide)/(?P<itemID>[^/]+)/' => $controller,
636+
'(?P<itemAction>default)/(?P<itemID>[^/]+)/' => $controller,
637+
'(?P<itemAction>configure)/' => $controller,
638+
'(?P<itemAction>reorder)/' => $controller,
639+
'(?P<itemAction>edit)/'.$edit_route => $controller,
640+
'(?P<itemAction>new)/(?<itemKey>[^/]+)/'.$edit_route => $controller,
641+
'(?P<itemAction>builtin)/(?<itemID>[^/]+)/'.$edit_route
642642
=> $controller,
643643
);
644644
}

src/applications/people/application/PhabricatorPeopleApplication.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function getRoutes() {
7171
),
7272
'/p/(?P<username>[\w._-]+)/' => array(
7373
'' => 'PhabricatorPeopleProfileViewController',
74-
'panel/'
75-
=> $this->getPanelRouting('PhabricatorPeopleProfilePanelController'),
74+
'item/' => $this->getProfileMenuRouting(
75+
'PhabricatorPeopleProfileMenuController'),
7676
),
7777
);
7878
}

src/applications/people/controller/PhabricatorPeopleProfileEditController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function handleRequest(AphrontRequest $request) {
8585
$crumbs->setBorder(true);
8686

8787
$nav = $this->getProfileMenu();
88-
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_MANAGE);
88+
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_MANAGE);
8989

9090
$header = id(new PHUIHeaderView())
9191
->setHeader(pht('Edit Profile: %s', $user->getFullName()))

src/applications/people/controller/PhabricatorPeopleProfileManageController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function handleRequest(AphrontRequest $request) {
4343
$name = $user->getUsername();
4444

4545
$nav = $this->getProfileMenu();
46-
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_MANAGE);
46+
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_MANAGE);
4747

4848
$timeline = $this->buildTransactionTimeline(
4949
$user,

src/applications/people/controller/PhabricatorPeopleProfilePictureController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function handleRequest(AphrontRequest $request) {
256256
$crumbs->setBorder(true);
257257

258258
$nav = $this->getProfileMenu();
259-
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_MANAGE);
259+
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_MANAGE);
260260

261261
$header = id(new PHUIHeaderView())
262262
->setHeader(pht('Edit Profile Picture'))

src/applications/people/controller/PhabricatorPeopleProfileViewController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function handleRequest(AphrontRequest $request) {
7878
));
7979

8080
$nav = $this->getProfileMenu();
81-
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_PROFILE);
81+
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_PROFILE);
8282

8383
$crumbs = $this->buildApplicationCrumbs();
8484
$crumbs->setBorder(true);

src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
final class PhabricatorPeopleProfileMenuEngine
44
extends PhabricatorProfileMenuEngine {
55

6-
const PANEL_PROFILE = 'people.profile';
7-
const PANEL_MANAGE = 'people.manage';
6+
const ITEM_PROFILE = 'people.profile';
7+
const ITEM_MANAGE = 'people.manage';
88

99
protected function isMenuEngineConfigurable() {
1010
return false;
1111
}
1212

13-
protected function getPanelURI($path) {
13+
protected function getItemURI($path) {
1414
$user = $this->getProfileObject();
1515
$username = $user->getUsername();
1616
$username = phutil_escape_uri($username);
17-
return "/p/{$username}/panel/{$path}";
17+
return "/p/{$username}/item/{$path}";
1818
}
1919

20-
protected function getBuiltinProfilePanels($object) {
20+
protected function getBuiltinProfileItems($object) {
2121
$viewer = $this->getViewer();
2222

23-
$panels = array();
23+
$items = array();
2424

25-
$panels[] = $this->newPanel()
26-
->setBuiltinKey(self::PANEL_PROFILE)
27-
->setMenuItemKey(PhabricatorPeopleDetailsProfilePanel::PANELKEY);
25+
$items[] = $this->newItem()
26+
->setBuiltinKey(self::ITEM_PROFILE)
27+
->setMenuItemKey(PhabricatorPeopleDetailsProfileMenuItem::MENUITEMKEY);
2828

2929
$have_maniphest = PhabricatorApplication::isClassInstalledForViewer(
3030
'PhabricatorManiphestApplication',
@@ -34,9 +34,9 @@ protected function getBuiltinProfilePanels($object) {
3434
'/maniphest/?statuses=open()&assigned=%s#R',
3535
$object->getPHID());
3636

37-
$panels[] = $this->newPanel()
37+
$items[] = $this->newItem()
3838
->setBuiltinKey('tasks')
39-
->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY)
39+
->setMenuItemKey(PhabricatorLinkProfileMenuItem::MENUITEMKEY)
4040
->setMenuItemProperty('icon', 'maniphest')
4141
->setMenuItemProperty('name', pht('Open Tasks'))
4242
->setMenuItemProperty('uri', $uri);
@@ -50,9 +50,9 @@ protected function getBuiltinProfilePanels($object) {
5050
'/differential/?authors=%s#R',
5151
$object->getPHID());
5252

53-
$panels[] = $this->newPanel()
53+
$items[] = $this->newItem()
5454
->setBuiltinKey('revisions')
55-
->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY)
55+
->setMenuItemKey(PhabricatorLinkProfileMenuItem::MENUITEMKEY)
5656
->setMenuItemProperty('icon', 'differential')
5757
->setMenuItemProperty('name', pht('Revisions'))
5858
->setMenuItemProperty('uri', $uri);
@@ -66,19 +66,19 @@ protected function getBuiltinProfilePanels($object) {
6666
'/audit/?authors=%s#R',
6767
$object->getPHID());
6868

69-
$panels[] = $this->newPanel()
69+
$items[] = $this->newItem()
7070
->setBuiltinKey('commits')
71-
->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY)
71+
->setMenuItemKey(PhabricatorLinkProfileMenuItem::MENUITEMKEY)
7272
->setMenuItemProperty('icon', 'diffusion')
7373
->setMenuItemProperty('name', pht('Commits'))
7474
->setMenuItemProperty('uri', $uri);
7575
}
7676

77-
$panels[] = $this->newPanel()
78-
->setBuiltinKey(self::PANEL_MANAGE)
79-
->setMenuItemKey(PhabricatorPeopleManageProfilePanel::PANELKEY);
77+
$items[] = $this->newItem()
78+
->setBuiltinKey(self::ITEM_MANAGE)
79+
->setMenuItemKey(PhabricatorPeopleManageProfileMenuItem::MENUITEMKEY);
8080

81-
return $panels;
81+
return $items;
8282
}
8383

8484
}

src/applications/people/profilepanel/PhabricatorPeopleDetailsProfilePanel.php renamed to src/applications/people/menuitem/PhabricatorPeopleDetailsProfileMenuItem.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
final class PhabricatorPeopleDetailsProfilePanel
4-
extends PhabricatorProfilePanel {
3+
final class PhabricatorPeopleDetailsProfileMenuItem
4+
extends PhabricatorProfileMenuItem {
55

6-
const PANELKEY = 'people.details';
6+
const MENUITEMKEY = 'people.details';
77

8-
public function getPanelTypeName() {
8+
public function getMenuItemTypeName() {
99
return pht('User Details');
1010
}
1111

src/applications/people/profilepanel/PhabricatorPeopleManageProfilePanel.php renamed to src/applications/people/menuitem/PhabricatorPeopleManageProfileMenuItem.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php
22

3-
final class PhabricatorPeopleManageProfilePanel
4-
extends PhabricatorProfilePanel {
3+
final class PhabricatorPeopleManageProfileMenuItem
4+
extends PhabricatorProfileMenuItem {
55

6-
const PANELKEY = 'people.manage';
6+
const MENUITEMKEY = 'people.manage';
77

8-
public function getPanelTypeName() {
8+
public function getMenuItemTypeName() {
99
return pht('Manage User');
1010
}
1111

1212
private function getDefaultName() {
1313
return pht('Manage');
1414
}
1515

16-
public function canHidePanel(
16+
public function canHideMenuItem(
1717
PhabricatorProfileMenuItemConfiguration $config) {
1818
return false;
1919
}

0 commit comments

Comments
 (0)