1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

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
This commit is contained in:
epriestley 2016-12-11 10:08:26 -08:00
parent 8480776ccd
commit 42896f9f90
40 changed files with 389 additions and 388 deletions

View file

@ -1787,7 +1787,7 @@ phutil_register_library_map(array(
'PhabricatorApplicationEmailCommandsController' => 'applications/meta/controller/PhabricatorApplicationEmailCommandsController.php', 'PhabricatorApplicationEmailCommandsController' => 'applications/meta/controller/PhabricatorApplicationEmailCommandsController.php',
'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php', 'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php',
'PhabricatorApplicationPanelController' => 'applications/meta/controller/PhabricatorApplicationPanelController.php', 'PhabricatorApplicationPanelController' => 'applications/meta/controller/PhabricatorApplicationPanelController.php',
'PhabricatorApplicationProfilePanel' => 'applications/search/profilepanel/PhabricatorApplicationProfilePanel.php', 'PhabricatorApplicationProfileMenuItem' => 'applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php',
'PhabricatorApplicationQuery' => 'applications/meta/query/PhabricatorApplicationQuery.php', 'PhabricatorApplicationQuery' => 'applications/meta/query/PhabricatorApplicationQuery.php',
'PhabricatorApplicationSearchController' => 'applications/search/controller/PhabricatorApplicationSearchController.php', 'PhabricatorApplicationSearchController' => 'applications/search/controller/PhabricatorApplicationSearchController.php',
'PhabricatorApplicationSearchEngine' => 'applications/search/engine/PhabricatorApplicationSearchEngine.php', 'PhabricatorApplicationSearchEngine' => 'applications/search/engine/PhabricatorApplicationSearchEngine.php',
@ -2505,7 +2505,7 @@ phutil_register_library_map(array(
'PhabricatorDisabledUserController' => 'applications/auth/controller/PhabricatorDisabledUserController.php', 'PhabricatorDisabledUserController' => 'applications/auth/controller/PhabricatorDisabledUserController.php',
'PhabricatorDisplayPreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php', 'PhabricatorDisplayPreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php',
'PhabricatorDisqusAuthProvider' => 'applications/auth/provider/PhabricatorDisqusAuthProvider.php', 'PhabricatorDisqusAuthProvider' => 'applications/auth/provider/PhabricatorDisqusAuthProvider.php',
'PhabricatorDividerProfilePanel' => 'applications/search/profilepanel/PhabricatorDividerProfilePanel.php', 'PhabricatorDividerProfileMenuItem' => 'applications/search/menuitem/PhabricatorDividerProfileMenuItem.php',
'PhabricatorDivinerApplication' => 'applications/diviner/application/PhabricatorDivinerApplication.php', 'PhabricatorDivinerApplication' => 'applications/diviner/application/PhabricatorDivinerApplication.php',
'PhabricatorDoorkeeperApplication' => 'applications/doorkeeper/application/PhabricatorDoorkeeperApplication.php', 'PhabricatorDoorkeeperApplication' => 'applications/doorkeeper/application/PhabricatorDoorkeeperApplication.php',
'PhabricatorDraft' => 'applications/draft/storage/PhabricatorDraft.php', 'PhabricatorDraft' => 'applications/draft/storage/PhabricatorDraft.php',
@ -2828,7 +2828,7 @@ phutil_register_library_map(array(
'PhabricatorLegalpadDocumentPHIDType' => 'applications/legalpad/phid/PhabricatorLegalpadDocumentPHIDType.php', 'PhabricatorLegalpadDocumentPHIDType' => 'applications/legalpad/phid/PhabricatorLegalpadDocumentPHIDType.php',
'PhabricatorLegalpadSignaturePolicyRule' => 'applications/legalpad/policyrule/PhabricatorLegalpadSignaturePolicyRule.php', 'PhabricatorLegalpadSignaturePolicyRule' => 'applications/legalpad/policyrule/PhabricatorLegalpadSignaturePolicyRule.php',
'PhabricatorLibraryTestCase' => '__tests__/PhabricatorLibraryTestCase.php', 'PhabricatorLibraryTestCase' => '__tests__/PhabricatorLibraryTestCase.php',
'PhabricatorLinkProfilePanel' => 'applications/search/profilepanel/PhabricatorLinkProfilePanel.php', 'PhabricatorLinkProfileMenuItem' => 'applications/search/menuitem/PhabricatorLinkProfileMenuItem.php',
'PhabricatorLipsumArtist' => 'applications/lipsum/image/PhabricatorLipsumArtist.php', 'PhabricatorLipsumArtist' => 'applications/lipsum/image/PhabricatorLipsumArtist.php',
'PhabricatorLipsumContentSource' => 'infrastructure/contentsource/PhabricatorLipsumContentSource.php', 'PhabricatorLipsumContentSource' => 'infrastructure/contentsource/PhabricatorLipsumContentSource.php',
'PhabricatorLipsumGenerateWorkflow' => 'applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php', 'PhabricatorLipsumGenerateWorkflow' => 'applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php',
@ -2966,7 +2966,7 @@ phutil_register_library_map(array(
'PhabricatorModularTransactionType' => 'applications/transactions/storage/PhabricatorModularTransactionType.php', 'PhabricatorModularTransactionType' => 'applications/transactions/storage/PhabricatorModularTransactionType.php',
'PhabricatorMonospacedFontSetting' => 'applications/settings/setting/PhabricatorMonospacedFontSetting.php', 'PhabricatorMonospacedFontSetting' => 'applications/settings/setting/PhabricatorMonospacedFontSetting.php',
'PhabricatorMonospacedTextareasSetting' => 'applications/settings/setting/PhabricatorMonospacedTextareasSetting.php', 'PhabricatorMonospacedTextareasSetting' => 'applications/settings/setting/PhabricatorMonospacedTextareasSetting.php',
'PhabricatorMotivatorProfilePanel' => 'applications/search/profilepanel/PhabricatorMotivatorProfilePanel.php', 'PhabricatorMotivatorProfileMenuItem' => 'applications/search/menuitem/PhabricatorMotivatorProfileMenuItem.php',
'PhabricatorMultiColumnUIExample' => 'applications/uiexample/examples/PhabricatorMultiColumnUIExample.php', 'PhabricatorMultiColumnUIExample' => 'applications/uiexample/examples/PhabricatorMultiColumnUIExample.php',
'PhabricatorMultiFactorSettingsPanel' => 'applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php', 'PhabricatorMultiFactorSettingsPanel' => 'applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php',
'PhabricatorMultimeterApplication' => 'applications/multimeter/application/PhabricatorMultimeterApplication.php', 'PhabricatorMultimeterApplication' => 'applications/multimeter/application/PhabricatorMultimeterApplication.php',
@ -3244,7 +3244,7 @@ phutil_register_library_map(array(
'PhabricatorPeopleCreateGuidanceContext' => 'applications/people/guidance/PhabricatorPeopleCreateGuidanceContext.php', 'PhabricatorPeopleCreateGuidanceContext' => 'applications/people/guidance/PhabricatorPeopleCreateGuidanceContext.php',
'PhabricatorPeopleDatasource' => 'applications/people/typeahead/PhabricatorPeopleDatasource.php', 'PhabricatorPeopleDatasource' => 'applications/people/typeahead/PhabricatorPeopleDatasource.php',
'PhabricatorPeopleDeleteController' => 'applications/people/controller/PhabricatorPeopleDeleteController.php', 'PhabricatorPeopleDeleteController' => 'applications/people/controller/PhabricatorPeopleDeleteController.php',
'PhabricatorPeopleDetailsProfilePanel' => 'applications/people/profilepanel/PhabricatorPeopleDetailsProfilePanel.php', 'PhabricatorPeopleDetailsProfileMenuItem' => 'applications/people/menuitem/PhabricatorPeopleDetailsProfileMenuItem.php',
'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php', 'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php',
'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php', 'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php',
'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php', 'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php',
@ -3258,7 +3258,7 @@ phutil_register_library_map(array(
'PhabricatorPeopleLogSearchEngine' => 'applications/people/query/PhabricatorPeopleLogSearchEngine.php', 'PhabricatorPeopleLogSearchEngine' => 'applications/people/query/PhabricatorPeopleLogSearchEngine.php',
'PhabricatorPeopleLogsController' => 'applications/people/controller/PhabricatorPeopleLogsController.php', 'PhabricatorPeopleLogsController' => 'applications/people/controller/PhabricatorPeopleLogsController.php',
'PhabricatorPeopleMainMenuBarExtension' => 'applications/people/extension/PhabricatorPeopleMainMenuBarExtension.php', 'PhabricatorPeopleMainMenuBarExtension' => 'applications/people/extension/PhabricatorPeopleMainMenuBarExtension.php',
'PhabricatorPeopleManageProfilePanel' => 'applications/people/profilepanel/PhabricatorPeopleManageProfilePanel.php', 'PhabricatorPeopleManageProfileMenuItem' => 'applications/people/menuitem/PhabricatorPeopleManageProfileMenuItem.php',
'PhabricatorPeopleNewController' => 'applications/people/controller/PhabricatorPeopleNewController.php', 'PhabricatorPeopleNewController' => 'applications/people/controller/PhabricatorPeopleNewController.php',
'PhabricatorPeopleNoOwnerDatasource' => 'applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php', 'PhabricatorPeopleNoOwnerDatasource' => 'applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php',
'PhabricatorPeopleOwnerDatasource' => 'applications/people/typeahead/PhabricatorPeopleOwnerDatasource.php', 'PhabricatorPeopleOwnerDatasource' => 'applications/people/typeahead/PhabricatorPeopleOwnerDatasource.php',
@ -3367,13 +3367,13 @@ phutil_register_library_map(array(
'PhabricatorProfileMenuEditEngine' => 'applications/search/editor/PhabricatorProfileMenuEditEngine.php', 'PhabricatorProfileMenuEditEngine' => 'applications/search/editor/PhabricatorProfileMenuEditEngine.php',
'PhabricatorProfileMenuEditor' => 'applications/search/editor/PhabricatorProfileMenuEditor.php', 'PhabricatorProfileMenuEditor' => 'applications/search/editor/PhabricatorProfileMenuEditor.php',
'PhabricatorProfileMenuEngine' => 'applications/search/engine/PhabricatorProfileMenuEngine.php', 'PhabricatorProfileMenuEngine' => 'applications/search/engine/PhabricatorProfileMenuEngine.php',
'PhabricatorProfileMenuItem' => 'applications/search/menuitem/PhabricatorProfileMenuItem.php',
'PhabricatorProfileMenuItemConfiguration' => 'applications/search/storage/PhabricatorProfileMenuItemConfiguration.php', 'PhabricatorProfileMenuItemConfiguration' => 'applications/search/storage/PhabricatorProfileMenuItemConfiguration.php',
'PhabricatorProfileMenuItemConfigurationQuery' => 'applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php', 'PhabricatorProfileMenuItemConfigurationQuery' => 'applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php',
'PhabricatorProfileMenuItemConfigurationTransaction' => 'applications/search/storage/PhabricatorProfileMenuItemConfigurationTransaction.php', 'PhabricatorProfileMenuItemConfigurationTransaction' => 'applications/search/storage/PhabricatorProfileMenuItemConfigurationTransaction.php',
'PhabricatorProfileMenuItemConfigurationTransactionQuery' => 'applications/search/query/PhabricatorProfileMenuItemConfigurationTransactionQuery.php', 'PhabricatorProfileMenuItemConfigurationTransactionQuery' => 'applications/search/query/PhabricatorProfileMenuItemConfigurationTransactionQuery.php',
'PhabricatorProfileMenuItemIconSet' => 'applications/search/menuitem/PhabricatorProfileMenuItemIconSet.php',
'PhabricatorProfileMenuItemPHIDType' => 'applications/search/phidtype/PhabricatorProfileMenuItemPHIDType.php', 'PhabricatorProfileMenuItemPHIDType' => 'applications/search/phidtype/PhabricatorProfileMenuItemPHIDType.php',
'PhabricatorProfilePanel' => 'applications/search/profilepanel/PhabricatorProfilePanel.php',
'PhabricatorProfilePanelIconSet' => 'applications/search/profilepanel/PhabricatorProfilePanelIconSet.php',
'PhabricatorProject' => 'applications/project/storage/PhabricatorProject.php', 'PhabricatorProject' => 'applications/project/storage/PhabricatorProject.php',
'PhabricatorProjectAddHeraldAction' => 'applications/project/herald/PhabricatorProjectAddHeraldAction.php', 'PhabricatorProjectAddHeraldAction' => 'applications/project/herald/PhabricatorProjectAddHeraldAction.php',
'PhabricatorProjectApplication' => 'applications/project/application/PhabricatorProjectApplication.php', 'PhabricatorProjectApplication' => 'applications/project/application/PhabricatorProjectApplication.php',
@ -3411,7 +3411,7 @@ phutil_register_library_map(array(
'PhabricatorProjectDatasource' => 'applications/project/typeahead/PhabricatorProjectDatasource.php', 'PhabricatorProjectDatasource' => 'applications/project/typeahead/PhabricatorProjectDatasource.php',
'PhabricatorProjectDefaultController' => 'applications/project/controller/PhabricatorProjectDefaultController.php', 'PhabricatorProjectDefaultController' => 'applications/project/controller/PhabricatorProjectDefaultController.php',
'PhabricatorProjectDescriptionField' => 'applications/project/customfield/PhabricatorProjectDescriptionField.php', 'PhabricatorProjectDescriptionField' => 'applications/project/customfield/PhabricatorProjectDescriptionField.php',
'PhabricatorProjectDetailsProfilePanel' => 'applications/project/profilepanel/PhabricatorProjectDetailsProfilePanel.php', 'PhabricatorProjectDetailsProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php',
'PhabricatorProjectEditController' => 'applications/project/controller/PhabricatorProjectEditController.php', 'PhabricatorProjectEditController' => 'applications/project/controller/PhabricatorProjectEditController.php',
'PhabricatorProjectEditEngine' => 'applications/project/engine/PhabricatorProjectEditEngine.php', 'PhabricatorProjectEditEngine' => 'applications/project/engine/PhabricatorProjectEditEngine.php',
'PhabricatorProjectEditPictureController' => 'applications/project/controller/PhabricatorProjectEditPictureController.php', 'PhabricatorProjectEditPictureController' => 'applications/project/controller/PhabricatorProjectEditPictureController.php',
@ -3432,16 +3432,17 @@ phutil_register_library_map(array(
'PhabricatorProjectLogicalUserDatasource' => 'applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php', 'PhabricatorProjectLogicalUserDatasource' => 'applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php',
'PhabricatorProjectLogicalViewerDatasource' => 'applications/project/typeahead/PhabricatorProjectLogicalViewerDatasource.php', 'PhabricatorProjectLogicalViewerDatasource' => 'applications/project/typeahead/PhabricatorProjectLogicalViewerDatasource.php',
'PhabricatorProjectManageController' => 'applications/project/controller/PhabricatorProjectManageController.php', 'PhabricatorProjectManageController' => 'applications/project/controller/PhabricatorProjectManageController.php',
'PhabricatorProjectManageProfilePanel' => 'applications/project/profilepanel/PhabricatorProjectManageProfilePanel.php', 'PhabricatorProjectManageProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectManageProfileMenuItem.php',
'PhabricatorProjectMaterializedMemberEdgeType' => 'applications/project/edge/PhabricatorProjectMaterializedMemberEdgeType.php', 'PhabricatorProjectMaterializedMemberEdgeType' => 'applications/project/edge/PhabricatorProjectMaterializedMemberEdgeType.php',
'PhabricatorProjectMemberListView' => 'applications/project/view/PhabricatorProjectMemberListView.php', 'PhabricatorProjectMemberListView' => 'applications/project/view/PhabricatorProjectMemberListView.php',
'PhabricatorProjectMemberOfProjectEdgeType' => 'applications/project/edge/PhabricatorProjectMemberOfProjectEdgeType.php', 'PhabricatorProjectMemberOfProjectEdgeType' => 'applications/project/edge/PhabricatorProjectMemberOfProjectEdgeType.php',
'PhabricatorProjectMembersAddController' => 'applications/project/controller/PhabricatorProjectMembersAddController.php', 'PhabricatorProjectMembersAddController' => 'applications/project/controller/PhabricatorProjectMembersAddController.php',
'PhabricatorProjectMembersDatasource' => 'applications/project/typeahead/PhabricatorProjectMembersDatasource.php', 'PhabricatorProjectMembersDatasource' => 'applications/project/typeahead/PhabricatorProjectMembersDatasource.php',
'PhabricatorProjectMembersPolicyRule' => 'applications/project/policyrule/PhabricatorProjectMembersPolicyRule.php', 'PhabricatorProjectMembersPolicyRule' => 'applications/project/policyrule/PhabricatorProjectMembersPolicyRule.php',
'PhabricatorProjectMembersProfilePanel' => 'applications/project/profilepanel/PhabricatorProjectMembersProfilePanel.php', 'PhabricatorProjectMembersProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectMembersProfileMenuItem.php',
'PhabricatorProjectMembersRemoveController' => 'applications/project/controller/PhabricatorProjectMembersRemoveController.php', 'PhabricatorProjectMembersRemoveController' => 'applications/project/controller/PhabricatorProjectMembersRemoveController.php',
'PhabricatorProjectMembersViewController' => 'applications/project/controller/PhabricatorProjectMembersViewController.php', 'PhabricatorProjectMembersViewController' => 'applications/project/controller/PhabricatorProjectMembersViewController.php',
'PhabricatorProjectMenuItemController' => 'applications/project/controller/PhabricatorProjectMenuItemController.php',
'PhabricatorProjectMoveController' => 'applications/project/controller/PhabricatorProjectMoveController.php', 'PhabricatorProjectMoveController' => 'applications/project/controller/PhabricatorProjectMoveController.php',
'PhabricatorProjectNameContextFreeGrammar' => 'applications/project/lipsum/PhabricatorProjectNameContextFreeGrammar.php', 'PhabricatorProjectNameContextFreeGrammar' => 'applications/project/lipsum/PhabricatorProjectNameContextFreeGrammar.php',
'PhabricatorProjectNoProjectsDatasource' => 'applications/project/typeahead/PhabricatorProjectNoProjectsDatasource.php', 'PhabricatorProjectNoProjectsDatasource' => 'applications/project/typeahead/PhabricatorProjectNoProjectsDatasource.php',
@ -3449,8 +3450,7 @@ phutil_register_library_map(array(
'PhabricatorProjectOrUserDatasource' => 'applications/project/typeahead/PhabricatorProjectOrUserDatasource.php', 'PhabricatorProjectOrUserDatasource' => 'applications/project/typeahead/PhabricatorProjectOrUserDatasource.php',
'PhabricatorProjectOrUserFunctionDatasource' => 'applications/project/typeahead/PhabricatorProjectOrUserFunctionDatasource.php', 'PhabricatorProjectOrUserFunctionDatasource' => 'applications/project/typeahead/PhabricatorProjectOrUserFunctionDatasource.php',
'PhabricatorProjectPHIDResolver' => 'applications/phid/resolver/PhabricatorProjectPHIDResolver.php', 'PhabricatorProjectPHIDResolver' => 'applications/phid/resolver/PhabricatorProjectPHIDResolver.php',
'PhabricatorProjectPanelController' => 'applications/project/controller/PhabricatorProjectPanelController.php', 'PhabricatorProjectPointsProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectPointsProfileMenuItem.php',
'PhabricatorProjectPointsProfilePanel' => 'applications/project/profilepanel/PhabricatorProjectPointsProfilePanel.php',
'PhabricatorProjectProfileController' => 'applications/project/controller/PhabricatorProjectProfileController.php', 'PhabricatorProjectProfileController' => 'applications/project/controller/PhabricatorProjectProfileController.php',
'PhabricatorProjectProfileMenuEngine' => 'applications/project/engine/PhabricatorProjectProfileMenuEngine.php', 'PhabricatorProjectProfileMenuEngine' => 'applications/project/engine/PhabricatorProjectProfileMenuEngine.php',
'PhabricatorProjectProjectHasMemberEdgeType' => 'applications/project/edge/PhabricatorProjectProjectHasMemberEdgeType.php', 'PhabricatorProjectProjectHasMemberEdgeType' => 'applications/project/edge/PhabricatorProjectProjectHasMemberEdgeType.php',
@ -3468,7 +3468,7 @@ phutil_register_library_map(array(
'PhabricatorProjectStatus' => 'applications/project/constants/PhabricatorProjectStatus.php', 'PhabricatorProjectStatus' => 'applications/project/constants/PhabricatorProjectStatus.php',
'PhabricatorProjectSubprojectWarningController' => 'applications/project/controller/PhabricatorProjectSubprojectWarningController.php', 'PhabricatorProjectSubprojectWarningController' => 'applications/project/controller/PhabricatorProjectSubprojectWarningController.php',
'PhabricatorProjectSubprojectsController' => 'applications/project/controller/PhabricatorProjectSubprojectsController.php', 'PhabricatorProjectSubprojectsController' => 'applications/project/controller/PhabricatorProjectSubprojectsController.php',
'PhabricatorProjectSubprojectsProfilePanel' => 'applications/project/profilepanel/PhabricatorProjectSubprojectsProfilePanel.php', 'PhabricatorProjectSubprojectsProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php',
'PhabricatorProjectTestDataGenerator' => 'applications/project/lipsum/PhabricatorProjectTestDataGenerator.php', 'PhabricatorProjectTestDataGenerator' => 'applications/project/lipsum/PhabricatorProjectTestDataGenerator.php',
'PhabricatorProjectTransaction' => 'applications/project/storage/PhabricatorProjectTransaction.php', 'PhabricatorProjectTransaction' => 'applications/project/storage/PhabricatorProjectTransaction.php',
'PhabricatorProjectTransactionEditor' => 'applications/project/editor/PhabricatorProjectTransactionEditor.php', 'PhabricatorProjectTransactionEditor' => 'applications/project/editor/PhabricatorProjectTransactionEditor.php',
@ -3481,7 +3481,7 @@ phutil_register_library_map(array(
'PhabricatorProjectWatchController' => 'applications/project/controller/PhabricatorProjectWatchController.php', 'PhabricatorProjectWatchController' => 'applications/project/controller/PhabricatorProjectWatchController.php',
'PhabricatorProjectWatcherListView' => 'applications/project/view/PhabricatorProjectWatcherListView.php', 'PhabricatorProjectWatcherListView' => 'applications/project/view/PhabricatorProjectWatcherListView.php',
'PhabricatorProjectWorkboardBackgroundColor' => 'applications/project/constants/PhabricatorProjectWorkboardBackgroundColor.php', 'PhabricatorProjectWorkboardBackgroundColor' => 'applications/project/constants/PhabricatorProjectWorkboardBackgroundColor.php',
'PhabricatorProjectWorkboardProfilePanel' => 'applications/project/profilepanel/PhabricatorProjectWorkboardProfilePanel.php', 'PhabricatorProjectWorkboardProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php',
'PhabricatorProjectsCurtainExtension' => 'applications/project/engineextension/PhabricatorProjectsCurtainExtension.php', 'PhabricatorProjectsCurtainExtension' => 'applications/project/engineextension/PhabricatorProjectsCurtainExtension.php',
'PhabricatorProjectsEditEngineExtension' => 'applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php', 'PhabricatorProjectsEditEngineExtension' => 'applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php',
'PhabricatorProjectsEditField' => 'applications/transactions/editfield/PhabricatorProjectsEditField.php', 'PhabricatorProjectsEditField' => 'applications/transactions/editfield/PhabricatorProjectsEditField.php',
@ -6610,7 +6610,7 @@ phutil_register_library_map(array(
'PhabricatorApplicationEmailCommandsController' => 'PhabricatorApplicationsController', 'PhabricatorApplicationEmailCommandsController' => 'PhabricatorApplicationsController',
'PhabricatorApplicationLaunchView' => 'AphrontTagView', 'PhabricatorApplicationLaunchView' => 'AphrontTagView',
'PhabricatorApplicationPanelController' => 'PhabricatorApplicationsController', 'PhabricatorApplicationPanelController' => 'PhabricatorApplicationsController',
'PhabricatorApplicationProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorApplicationProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorApplicationQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorApplicationQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorApplicationSearchController' => 'PhabricatorSearchBaseController', 'PhabricatorApplicationSearchController' => 'PhabricatorSearchBaseController',
'PhabricatorApplicationSearchEngine' => 'Phobject', 'PhabricatorApplicationSearchEngine' => 'Phobject',
@ -7452,7 +7452,7 @@ phutil_register_library_map(array(
'PhabricatorDisabledUserController' => 'PhabricatorAuthController', 'PhabricatorDisabledUserController' => 'PhabricatorAuthController',
'PhabricatorDisplayPreferencesSettingsPanel' => 'PhabricatorEditEngineSettingsPanel', 'PhabricatorDisplayPreferencesSettingsPanel' => 'PhabricatorEditEngineSettingsPanel',
'PhabricatorDisqusAuthProvider' => 'PhabricatorOAuth2AuthProvider', 'PhabricatorDisqusAuthProvider' => 'PhabricatorOAuth2AuthProvider',
'PhabricatorDividerProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorDividerProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorDivinerApplication' => 'PhabricatorApplication', 'PhabricatorDivinerApplication' => 'PhabricatorApplication',
'PhabricatorDoorkeeperApplication' => 'PhabricatorApplication', 'PhabricatorDoorkeeperApplication' => 'PhabricatorApplication',
'PhabricatorDraft' => 'PhabricatorDraftDAO', 'PhabricatorDraft' => 'PhabricatorDraftDAO',
@ -7820,7 +7820,7 @@ phutil_register_library_map(array(
'PhabricatorLegalpadDocumentPHIDType' => 'PhabricatorPHIDType', 'PhabricatorLegalpadDocumentPHIDType' => 'PhabricatorPHIDType',
'PhabricatorLegalpadSignaturePolicyRule' => 'PhabricatorPolicyRule', 'PhabricatorLegalpadSignaturePolicyRule' => 'PhabricatorPolicyRule',
'PhabricatorLibraryTestCase' => 'PhutilLibraryTestCase', 'PhabricatorLibraryTestCase' => 'PhutilLibraryTestCase',
'PhabricatorLinkProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorLinkProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorLipsumArtist' => 'Phobject', 'PhabricatorLipsumArtist' => 'Phobject',
'PhabricatorLipsumContentSource' => 'PhabricatorContentSource', 'PhabricatorLipsumContentSource' => 'PhabricatorContentSource',
'PhabricatorLipsumGenerateWorkflow' => 'PhabricatorLipsumManagementWorkflow', 'PhabricatorLipsumGenerateWorkflow' => 'PhabricatorLipsumManagementWorkflow',
@ -7968,7 +7968,7 @@ phutil_register_library_map(array(
'PhabricatorModularTransactionType' => 'Phobject', 'PhabricatorModularTransactionType' => 'Phobject',
'PhabricatorMonospacedFontSetting' => 'PhabricatorStringSetting', 'PhabricatorMonospacedFontSetting' => 'PhabricatorStringSetting',
'PhabricatorMonospacedTextareasSetting' => 'PhabricatorSelectSetting', 'PhabricatorMonospacedTextareasSetting' => 'PhabricatorSelectSetting',
'PhabricatorMotivatorProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorMotivatorProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorMultiColumnUIExample' => 'PhabricatorUIExample', 'PhabricatorMultiColumnUIExample' => 'PhabricatorUIExample',
'PhabricatorMultiFactorSettingsPanel' => 'PhabricatorSettingsPanel', 'PhabricatorMultiFactorSettingsPanel' => 'PhabricatorSettingsPanel',
'PhabricatorMultimeterApplication' => 'PhabricatorApplication', 'PhabricatorMultimeterApplication' => 'PhabricatorApplication',
@ -8310,7 +8310,7 @@ phutil_register_library_map(array(
'PhabricatorPeopleCreateGuidanceContext' => 'PhabricatorGuidanceContext', 'PhabricatorPeopleCreateGuidanceContext' => 'PhabricatorGuidanceContext',
'PhabricatorPeopleDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorPeopleDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorPeopleDeleteController' => 'PhabricatorPeopleController', 'PhabricatorPeopleDeleteController' => 'PhabricatorPeopleController',
'PhabricatorPeopleDetailsProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorPeopleDetailsProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController', 'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController',
'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController', 'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController',
'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType', 'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType',
@ -8324,7 +8324,7 @@ phutil_register_library_map(array(
'PhabricatorPeopleLogSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorPeopleLogSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorPeopleLogsController' => 'PhabricatorPeopleController', 'PhabricatorPeopleLogsController' => 'PhabricatorPeopleController',
'PhabricatorPeopleMainMenuBarExtension' => 'PhabricatorMainMenuBarExtension', 'PhabricatorPeopleMainMenuBarExtension' => 'PhabricatorMainMenuBarExtension',
'PhabricatorPeopleManageProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorPeopleManageProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorPeopleNewController' => 'PhabricatorPeopleController', 'PhabricatorPeopleNewController' => 'PhabricatorPeopleController',
'PhabricatorPeopleNoOwnerDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorPeopleNoOwnerDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorPeopleOwnerDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'PhabricatorPeopleOwnerDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
@ -8453,6 +8453,7 @@ phutil_register_library_map(array(
'PhabricatorProfileMenuEditEngine' => 'PhabricatorEditEngine', 'PhabricatorProfileMenuEditEngine' => 'PhabricatorEditEngine',
'PhabricatorProfileMenuEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorProfileMenuEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorProfileMenuEngine' => 'Phobject', 'PhabricatorProfileMenuEngine' => 'Phobject',
'PhabricatorProfileMenuItem' => 'Phobject',
'PhabricatorProfileMenuItemConfiguration' => array( 'PhabricatorProfileMenuItemConfiguration' => array(
'PhabricatorSearchDAO', 'PhabricatorSearchDAO',
'PhabricatorPolicyInterface', 'PhabricatorPolicyInterface',
@ -8462,9 +8463,8 @@ phutil_register_library_map(array(
'PhabricatorProfileMenuItemConfigurationQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorProfileMenuItemConfigurationQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorProfileMenuItemConfigurationTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorProfileMenuItemConfigurationTransaction' => 'PhabricatorApplicationTransaction',
'PhabricatorProfileMenuItemConfigurationTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhabricatorProfileMenuItemConfigurationTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhabricatorProfileMenuItemIconSet' => 'PhabricatorIconSet',
'PhabricatorProfileMenuItemPHIDType' => 'PhabricatorPHIDType', 'PhabricatorProfileMenuItemPHIDType' => 'PhabricatorPHIDType',
'PhabricatorProfilePanel' => 'Phobject',
'PhabricatorProfilePanelIconSet' => 'PhabricatorIconSet',
'PhabricatorProject' => array( 'PhabricatorProject' => array(
'PhabricatorProjectDAO', 'PhabricatorProjectDAO',
'PhabricatorApplicationTransactionInterface', 'PhabricatorApplicationTransactionInterface',
@ -8525,7 +8525,7 @@ phutil_register_library_map(array(
'PhabricatorProjectDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorProjectDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorProjectDefaultController' => 'PhabricatorProjectBoardController', 'PhabricatorProjectDefaultController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectDescriptionField' => 'PhabricatorProjectStandardCustomField', 'PhabricatorProjectDescriptionField' => 'PhabricatorProjectStandardCustomField',
'PhabricatorProjectDetailsProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorProjectDetailsProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectEditController' => 'PhabricatorProjectController', 'PhabricatorProjectEditController' => 'PhabricatorProjectController',
'PhabricatorProjectEditEngine' => 'PhabricatorEditEngine', 'PhabricatorProjectEditEngine' => 'PhabricatorEditEngine',
'PhabricatorProjectEditPictureController' => 'PhabricatorProjectController', 'PhabricatorProjectEditPictureController' => 'PhabricatorProjectController',
@ -8545,16 +8545,17 @@ phutil_register_library_map(array(
'PhabricatorProjectLogicalUserDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'PhabricatorProjectLogicalUserDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorProjectLogicalViewerDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorProjectLogicalViewerDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorProjectManageController' => 'PhabricatorProjectController', 'PhabricatorProjectManageController' => 'PhabricatorProjectController',
'PhabricatorProjectManageProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorProjectManageProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectMaterializedMemberEdgeType' => 'PhabricatorEdgeType', 'PhabricatorProjectMaterializedMemberEdgeType' => 'PhabricatorEdgeType',
'PhabricatorProjectMemberListView' => 'PhabricatorProjectUserListView', 'PhabricatorProjectMemberListView' => 'PhabricatorProjectUserListView',
'PhabricatorProjectMemberOfProjectEdgeType' => 'PhabricatorEdgeType', 'PhabricatorProjectMemberOfProjectEdgeType' => 'PhabricatorEdgeType',
'PhabricatorProjectMembersAddController' => 'PhabricatorProjectController', 'PhabricatorProjectMembersAddController' => 'PhabricatorProjectController',
'PhabricatorProjectMembersDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'PhabricatorProjectMembersDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorProjectMembersPolicyRule' => 'PhabricatorPolicyRule', 'PhabricatorProjectMembersPolicyRule' => 'PhabricatorPolicyRule',
'PhabricatorProjectMembersProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorProjectMembersProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectMembersRemoveController' => 'PhabricatorProjectController', 'PhabricatorProjectMembersRemoveController' => 'PhabricatorProjectController',
'PhabricatorProjectMembersViewController' => 'PhabricatorProjectController', 'PhabricatorProjectMembersViewController' => 'PhabricatorProjectController',
'PhabricatorProjectMenuItemController' => 'PhabricatorProjectController',
'PhabricatorProjectMoveController' => 'PhabricatorProjectController', 'PhabricatorProjectMoveController' => 'PhabricatorProjectController',
'PhabricatorProjectNameContextFreeGrammar' => 'PhutilContextFreeGrammar', 'PhabricatorProjectNameContextFreeGrammar' => 'PhutilContextFreeGrammar',
'PhabricatorProjectNoProjectsDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorProjectNoProjectsDatasource' => 'PhabricatorTypeaheadDatasource',
@ -8562,8 +8563,7 @@ phutil_register_library_map(array(
'PhabricatorProjectOrUserDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'PhabricatorProjectOrUserDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorProjectOrUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'PhabricatorProjectOrUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorProjectPHIDResolver' => 'PhabricatorPHIDResolver', 'PhabricatorProjectPHIDResolver' => 'PhabricatorPHIDResolver',
'PhabricatorProjectPanelController' => 'PhabricatorProjectController', 'PhabricatorProjectPointsProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectPointsProfilePanel' => 'PhabricatorProfilePanel',
'PhabricatorProjectProfileController' => 'PhabricatorProjectController', 'PhabricatorProjectProfileController' => 'PhabricatorProjectController',
'PhabricatorProjectProfileMenuEngine' => 'PhabricatorProfileMenuEngine', 'PhabricatorProjectProfileMenuEngine' => 'PhabricatorProfileMenuEngine',
'PhabricatorProjectProjectHasMemberEdgeType' => 'PhabricatorEdgeType', 'PhabricatorProjectProjectHasMemberEdgeType' => 'PhabricatorEdgeType',
@ -8584,7 +8584,7 @@ phutil_register_library_map(array(
'PhabricatorProjectStatus' => 'Phobject', 'PhabricatorProjectStatus' => 'Phobject',
'PhabricatorProjectSubprojectWarningController' => 'PhabricatorProjectController', 'PhabricatorProjectSubprojectWarningController' => 'PhabricatorProjectController',
'PhabricatorProjectSubprojectsController' => 'PhabricatorProjectController', 'PhabricatorProjectSubprojectsController' => 'PhabricatorProjectController',
'PhabricatorProjectSubprojectsProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorProjectSubprojectsProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectTestDataGenerator' => 'PhabricatorTestDataGenerator', 'PhabricatorProjectTestDataGenerator' => 'PhabricatorTestDataGenerator',
'PhabricatorProjectTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorProjectTransaction' => 'PhabricatorApplicationTransaction',
'PhabricatorProjectTransactionEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorProjectTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
@ -8597,7 +8597,7 @@ phutil_register_library_map(array(
'PhabricatorProjectWatchController' => 'PhabricatorProjectController', 'PhabricatorProjectWatchController' => 'PhabricatorProjectController',
'PhabricatorProjectWatcherListView' => 'PhabricatorProjectUserListView', 'PhabricatorProjectWatcherListView' => 'PhabricatorProjectUserListView',
'PhabricatorProjectWorkboardBackgroundColor' => 'Phobject', 'PhabricatorProjectWorkboardBackgroundColor' => 'Phobject',
'PhabricatorProjectWorkboardProfilePanel' => 'PhabricatorProfilePanel', 'PhabricatorProjectWorkboardProfileMenuItem' => 'PhabricatorProfileMenuItem',
'PhabricatorProjectsCurtainExtension' => 'PHUICurtainExtension', 'PhabricatorProjectsCurtainExtension' => 'PHUICurtainExtension',
'PhabricatorProjectsEditEngineExtension' => 'PhabricatorEditEngineExtension', 'PhabricatorProjectsEditEngineExtension' => 'PhabricatorEditEngineExtension',
'PhabricatorProjectsEditField' => 'PhabricatorTokenizerEditField', 'PhabricatorProjectsEditField' => 'PhabricatorTokenizerEditField',

View file

@ -627,18 +627,18 @@ abstract class PhabricatorApplication
return $base.'(?:query/(?P<queryKey>[^/]+)/)?'; return $base.'(?:query/(?P<queryKey>[^/]+)/)?';
} }
protected function getPanelRouting($controller) { protected function getProfileMenuRouting($controller) {
$edit_route = $this->getEditRoutePattern(); $edit_route = $this->getEditRoutePattern();
return array( return array(
'(?P<panelAction>view)/(?P<panelID>[^/]+)/' => $controller, '(?P<itemAction>view)/(?P<itemID>[^/]+)/' => $controller,
'(?P<panelAction>hide)/(?P<panelID>[^/]+)/' => $controller, '(?P<itemAction>hide)/(?P<itemID>[^/]+)/' => $controller,
'(?P<panelAction>default)/(?P<panelID>[^/]+)/' => $controller, '(?P<itemAction>default)/(?P<itemID>[^/]+)/' => $controller,
'(?P<panelAction>configure)/' => $controller, '(?P<itemAction>configure)/' => $controller,
'(?P<panelAction>reorder)/' => $controller, '(?P<itemAction>reorder)/' => $controller,
'(?P<panelAction>edit)/'.$edit_route => $controller, '(?P<itemAction>edit)/'.$edit_route => $controller,
'(?P<panelAction>new)/(?<panelKey>[^/]+)/'.$edit_route => $controller, '(?P<itemAction>new)/(?<itemKey>[^/]+)/'.$edit_route => $controller,
'(?P<panelAction>builtin)/(?<panelID>[^/]+)/'.$edit_route '(?P<itemAction>builtin)/(?<itemID>[^/]+)/'.$edit_route
=> $controller, => $controller,
); );
} }

View file

@ -71,8 +71,8 @@ final class PhabricatorPeopleApplication extends PhabricatorApplication {
), ),
'/p/(?P<username>[\w._-]+)/' => array( '/p/(?P<username>[\w._-]+)/' => array(
'' => 'PhabricatorPeopleProfileViewController', '' => 'PhabricatorPeopleProfileViewController',
'panel/' 'item/' => $this->getProfileMenuRouting(
=> $this->getPanelRouting('PhabricatorPeopleProfilePanelController'), 'PhabricatorPeopleProfileMenuController'),
), ),
); );
} }

View file

@ -85,7 +85,7 @@ final class PhabricatorPeopleProfileEditController
$crumbs->setBorder(true); $crumbs->setBorder(true);
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_MANAGE); $nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_MANAGE);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Edit Profile: %s', $user->getFullName())) ->setHeader(pht('Edit Profile: %s', $user->getFullName()))

View file

@ -43,7 +43,7 @@ final class PhabricatorPeopleProfileManageController
$name = $user->getUsername(); $name = $user->getUsername();
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_MANAGE); $nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_MANAGE);
$timeline = $this->buildTransactionTimeline( $timeline = $this->buildTransactionTimeline(
$user, $user,

View file

@ -256,7 +256,7 @@ final class PhabricatorPeopleProfilePictureController
$crumbs->setBorder(true); $crumbs->setBorder(true);
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_MANAGE); $nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_MANAGE);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Edit Profile Picture')) ->setHeader(pht('Edit Profile Picture'))

View file

@ -78,7 +78,7 @@ final class PhabricatorPeopleProfileViewController
)); ));
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::PANEL_PROFILE); $nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_PROFILE);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->setBorder(true); $crumbs->setBorder(true);

View file

@ -3,28 +3,28 @@
final class PhabricatorPeopleProfileMenuEngine final class PhabricatorPeopleProfileMenuEngine
extends PhabricatorProfileMenuEngine { extends PhabricatorProfileMenuEngine {
const PANEL_PROFILE = 'people.profile'; const ITEM_PROFILE = 'people.profile';
const PANEL_MANAGE = 'people.manage'; const ITEM_MANAGE = 'people.manage';
protected function isMenuEngineConfigurable() { protected function isMenuEngineConfigurable() {
return false; return false;
} }
protected function getPanelURI($path) { protected function getItemURI($path) {
$user = $this->getProfileObject(); $user = $this->getProfileObject();
$username = $user->getUsername(); $username = $user->getUsername();
$username = phutil_escape_uri($username); $username = phutil_escape_uri($username);
return "/p/{$username}/panel/{$path}"; return "/p/{$username}/item/{$path}";
} }
protected function getBuiltinProfilePanels($object) { protected function getBuiltinProfileItems($object) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$panels = array(); $items = array();
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(self::PANEL_PROFILE) ->setBuiltinKey(self::ITEM_PROFILE)
->setMenuItemKey(PhabricatorPeopleDetailsProfilePanel::PANELKEY); ->setMenuItemKey(PhabricatorPeopleDetailsProfileMenuItem::MENUITEMKEY);
$have_maniphest = PhabricatorApplication::isClassInstalledForViewer( $have_maniphest = PhabricatorApplication::isClassInstalledForViewer(
'PhabricatorManiphestApplication', 'PhabricatorManiphestApplication',
@ -34,9 +34,9 @@ final class PhabricatorPeopleProfileMenuEngine
'/maniphest/?statuses=open()&assigned=%s#R', '/maniphest/?statuses=open()&assigned=%s#R',
$object->getPHID()); $object->getPHID());
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey('tasks') ->setBuiltinKey('tasks')
->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY) ->setMenuItemKey(PhabricatorLinkProfileMenuItem::MENUITEMKEY)
->setMenuItemProperty('icon', 'maniphest') ->setMenuItemProperty('icon', 'maniphest')
->setMenuItemProperty('name', pht('Open Tasks')) ->setMenuItemProperty('name', pht('Open Tasks'))
->setMenuItemProperty('uri', $uri); ->setMenuItemProperty('uri', $uri);
@ -50,9 +50,9 @@ final class PhabricatorPeopleProfileMenuEngine
'/differential/?authors=%s#R', '/differential/?authors=%s#R',
$object->getPHID()); $object->getPHID());
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey('revisions') ->setBuiltinKey('revisions')
->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY) ->setMenuItemKey(PhabricatorLinkProfileMenuItem::MENUITEMKEY)
->setMenuItemProperty('icon', 'differential') ->setMenuItemProperty('icon', 'differential')
->setMenuItemProperty('name', pht('Revisions')) ->setMenuItemProperty('name', pht('Revisions'))
->setMenuItemProperty('uri', $uri); ->setMenuItemProperty('uri', $uri);
@ -66,19 +66,19 @@ final class PhabricatorPeopleProfileMenuEngine
'/audit/?authors=%s#R', '/audit/?authors=%s#R',
$object->getPHID()); $object->getPHID());
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey('commits') ->setBuiltinKey('commits')
->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY) ->setMenuItemKey(PhabricatorLinkProfileMenuItem::MENUITEMKEY)
->setMenuItemProperty('icon', 'diffusion') ->setMenuItemProperty('icon', 'diffusion')
->setMenuItemProperty('name', pht('Commits')) ->setMenuItemProperty('name', pht('Commits'))
->setMenuItemProperty('uri', $uri); ->setMenuItemProperty('uri', $uri);
} }
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(self::PANEL_MANAGE) ->setBuiltinKey(self::ITEM_MANAGE)
->setMenuItemKey(PhabricatorPeopleManageProfilePanel::PANELKEY); ->setMenuItemKey(PhabricatorPeopleManageProfileMenuItem::MENUITEMKEY);
return $panels; return $items;
} }
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorPeopleDetailsProfilePanel final class PhabricatorPeopleDetailsProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'people.details'; const MENUITEMKEY = 'people.details';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('User Details'); return pht('User Details');
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorPeopleManageProfilePanel final class PhabricatorPeopleManageProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'people.manage'; const MENUITEMKEY = 'people.manage';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Manage User'); return pht('Manage User');
} }
@ -13,7 +13,7 @@ final class PhabricatorPeopleManageProfilePanel
return pht('Manage'); return pht('Manage');
} }
public function canHidePanel( public function canHideMenuItem(
PhabricatorProfileMenuItemConfiguration $config) { PhabricatorProfileMenuItemConfiguration $config) {
return false; return false;
} }

View file

@ -61,8 +61,8 @@ final class PhabricatorProjectApplication extends PhabricatorApplication {
=> 'PhabricatorProjectEditPictureController', => 'PhabricatorProjectEditPictureController',
$this->getEditRoutePattern('edit/') $this->getEditRoutePattern('edit/')
=> 'PhabricatorProjectEditController', => 'PhabricatorProjectEditController',
'(?P<projectID>[1-9]\d*)/panel/' '(?P<projectID>[1-9]\d*)/item/' => $this->getProfileMenuRouting(
=> $this->getPanelRouting('PhabricatorProjectPanelController'), 'PhabricatorProjectMenuItemController'),
'subprojects/(?P<id>[1-9]\d*)/' 'subprojects/(?P<id>[1-9]\d*)/'
=> 'PhabricatorProjectSubprojectsController', => 'PhabricatorProjectSubprojectsController',
'board/(?P<id>[1-9]\d*)/'. 'board/(?P<id>[1-9]\d*)/'.

View file

@ -6,7 +6,7 @@ abstract class PhabricatorProjectBoardController
protected function getProfileMenu() { protected function getProfileMenu() {
$menu = parent::getProfileMenu(); $menu = parent::getProfileMenu();
$menu->selectFilter(PhabricatorProject::PANEL_WORKBOARD); $menu->selectFilter(PhabricatorProject::ITEM_WORKBOARD);
$menu->addClass('project-board-nav'); $menu->addClass('project-board-nav');
return $menu; return $menu;

View file

@ -170,7 +170,7 @@ final class PhabricatorProjectBoardViewController
} }
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorProject::PANEL_WORKBOARD); $nav->selectFilter(PhabricatorProject::ITEM_WORKBOARD);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Workboard')); $crumbs->addTextCrumb(pht('Workboard'));
@ -936,7 +936,7 @@ final class PhabricatorProjectBoardViewController
if ($set_default) { if ($set_default) {
$this $this
->getProfileMenuEngine() ->getProfileMenuEngine()
->adjustDefault(PhabricatorProject::PANEL_WORKBOARD); ->adjustDefault(PhabricatorProject::ITEM_WORKBOARD);
} }
if ($request->isFormPost()) { if ($request->isFormPost()) {

View file

@ -255,7 +255,7 @@ final class PhabricatorProjectEditPictureController
->setForm($upload_form); ->setForm($upload_form);
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorProject::PANEL_MANAGE); $nav->selectFilter(PhabricatorProject::ITEM_MANAGE);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)

View file

@ -39,7 +39,7 @@ final class PhabricatorProjectManageController
$timeline->setShouldTerminate(true); $timeline->setShouldTerminate(true);
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorProject::PANEL_MANAGE); $nav->selectFilter(PhabricatorProject::ITEM_MANAGE);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Manage')); $crumbs->addTextCrumb(pht('Manage'));
@ -91,7 +91,7 @@ final class PhabricatorProjectManageController
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Edit Menu')) ->setName(pht('Edit Menu'))
->setIcon('fa-th-list') ->setIcon('fa-th-list')
->setHref($this->getApplicationURI("{$id}/panel/configure/")) ->setHref($this->getApplicationURI("{$id}/item/configure/"))
->setDisabled(!$can_edit) ->setDisabled(!$can_edit)
->setWorkflow(!$can_edit)); ->setWorkflow(!$can_edit));

View file

@ -42,7 +42,7 @@ final class PhabricatorProjectMembersViewController
->setUserPHIDs($project->getWatcherPHIDs()); ->setUserPHIDs($project->getWatcherPHIDs());
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorProject::PANEL_MEMBERS); $nav->selectFilter(PhabricatorProject::ITEM_MEMBERS);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Members')); $crumbs->addTextCrumb(pht('Members'));

View file

@ -1,6 +1,6 @@
<?php <?php
final class PhabricatorProjectPanelController final class PhabricatorProjectMenuItemController
extends PhabricatorProjectController { extends PhabricatorProjectController {
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {

View file

@ -70,7 +70,7 @@ final class PhabricatorProjectProfileController
->setUserPHIDs($project->getWatcherPHIDs()); ->setUserPHIDs($project->getWatcherPHIDs());
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorProject::PANEL_PROFILE); $nav->selectFilter(PhabricatorProject::ITEM_PROFILE);
$stories = id(new PhabricatorFeedQuery()) $stories = id(new PhabricatorFeedQuery())
->setViewer($viewer) ->setViewer($viewer)

View file

@ -92,7 +92,7 @@ final class PhabricatorProjectSubprojectsController
->addPropertyList($property_list); ->addPropertyList($property_list);
$nav = $this->getProfileMenu(); $nav = $this->getProfileMenu();
$nav->selectFilter(PhabricatorProject::PANEL_SUBPROJECTS); $nav->selectFilter(PhabricatorProject::ITEM_SUBPROJECTS);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Subprojects')); $crumbs->addTextCrumb(pht('Subprojects'));

View file

@ -18,13 +18,13 @@ final class PhabricatorProjectViewController
$project = $this->getProject(); $project = $this->getProject();
$engine = $this->getProfileMenuEngine(); $engine = $this->getProfileMenuEngine();
$default = $engine->getDefaultPanel(); $default = $engine->getDefaultItem();
switch ($default->getBuiltinKey()) { switch ($default->getBuiltinKey()) {
case PhabricatorProject::PANEL_WORKBOARD: case PhabricatorProject::ITEM_WORKBOARD:
$controller_object = new PhabricatorProjectBoardViewController(); $controller_object = new PhabricatorProjectBoardViewController();
break; break;
case PhabricatorProject::PANEL_PROFILE: case PhabricatorProject::ITEM_PROFILE:
default: default:
$controller_object = new PhabricatorProjectProfileController(); $controller_object = new PhabricatorProjectProfileController();
break; break;

View file

@ -7,40 +7,41 @@ final class PhabricatorProjectProfileMenuEngine
return true; return true;
} }
protected function getPanelURI($path) { protected function getItemURI($path) {
$project = $this->getProfileObject(); $project = $this->getProfileObject();
$id = $project->getID(); $id = $project->getID();
return "/project/{$id}/panel/{$path}"; return "/project/{$id}/item/{$path}";
} }
protected function getBuiltinProfilePanels($object) { protected function getBuiltinProfileItems($object) {
$panels = array(); $items = array();
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::PANEL_PROFILE) ->setBuiltinKey(PhabricatorProject::ITEM_PROFILE)
->setMenuItemKey(PhabricatorProjectDetailsProfilePanel::PANELKEY); ->setMenuItemKey(PhabricatorProjectDetailsProfileMenuItem::MENUITEMKEY);
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::PANEL_POINTS) ->setBuiltinKey(PhabricatorProject::ITEM_POINTS)
->setMenuItemKey(PhabricatorProjectPointsProfilePanel::PANELKEY); ->setMenuItemKey(PhabricatorProjectPointsProfileMenuItem::MENUITEMKEY);
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::PANEL_WORKBOARD) ->setBuiltinKey(PhabricatorProject::ITEM_WORKBOARD)
->setMenuItemKey(PhabricatorProjectWorkboardProfilePanel::PANELKEY); ->setMenuItemKey(PhabricatorProjectWorkboardProfileMenuItem::MENUITEMKEY);
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::PANEL_MEMBERS) ->setBuiltinKey(PhabricatorProject::ITEM_MEMBERS)
->setMenuItemKey(PhabricatorProjectMembersProfilePanel::PANELKEY); ->setMenuItemKey(PhabricatorProjectMembersProfileMenuItem::MENUITEMKEY);
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::PANEL_SUBPROJECTS) ->setBuiltinKey(PhabricatorProject::ITEM_SUBPROJECTS)
->setMenuItemKey(PhabricatorProjectSubprojectsProfilePanel::PANELKEY); ->setMenuItemKey(
PhabricatorProjectSubprojectsProfileMenuItem::MENUITEMKEY);
$panels[] = $this->newPanel() $items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::PANEL_MANAGE) ->setBuiltinKey(PhabricatorProject::ITEM_MANAGE)
->setMenuItemKey(PhabricatorProjectManageProfilePanel::PANELKEY); ->setMenuItemKey(PhabricatorProjectManageProfileMenuItem::MENUITEMKEY);
return $panels; return $items;
} }
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorProjectDetailsProfilePanel final class PhabricatorProjectDetailsProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'project.details'; const MENUITEMKEY = 'project.details';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Project Details'); return pht('Project Details');
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorProjectManageProfilePanel final class PhabricatorProjectManageProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'project.manage'; const MENUITEMKEY = 'project.manage';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Manage Project'); return pht('Manage Project');
} }
@ -13,7 +13,7 @@ final class PhabricatorProjectManageProfilePanel
return pht('Manage'); return pht('Manage');
} }
public function canHidePanel( public function canHideMenuItem(
PhabricatorProfileMenuItemConfiguration $config) { PhabricatorProfileMenuItemConfiguration $config) {
return false; return false;
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorProjectMembersProfilePanel final class PhabricatorProjectMembersProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'project.members'; const MENUITEMKEY = 'project.members';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Project Members'); return pht('Project Members');
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorProjectPointsProfilePanel final class PhabricatorProjectPointsProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'project.points'; const MENUITEMKEY = 'project.points';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Project Points'); return pht('Project Points');
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorProjectSubprojectsProfilePanel final class PhabricatorProjectSubprojectsProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'project.subprojects'; const MENUITEMKEY = 'project.subprojects';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Project Subprojects'); return pht('Project Subprojects');
} }

View file

@ -1,11 +1,11 @@
<?php <?php
final class PhabricatorProjectWorkboardProfilePanel final class PhabricatorProjectWorkboardProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'project.workboard'; const MENUITEMKEY = 'project.workboard';
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Project Workboard'); return pht('Project Workboard');
} }

View file

@ -49,13 +49,13 @@ final class PhabricatorProject extends PhabricatorProjectDAO
const TABLE_DATASOURCE_TOKEN = 'project_datasourcetoken'; const TABLE_DATASOURCE_TOKEN = 'project_datasourcetoken';
const PANEL_PROFILE = 'project.profile'; const ITEM_PROFILE = 'project.profile';
const PANEL_POINTS = 'project.points'; const ITEM_POINTS = 'project.points';
const PANEL_WORKBOARD = 'project.workboard'; const ITEM_WORKBOARD = 'project.workboard';
const PANEL_MEMBERS = 'project.members'; const ITEM_MEMBERS = 'project.members';
const PANEL_MANAGE = 'project.manage'; const ITEM_MANAGE = 'project.manage';
const PANEL_MILESTONES = 'project.milestones'; const ITEM_MILESTONES = 'project.milestones';
const PANEL_SUBPROJECTS = 'project.subprojects'; const ITEM_SUBPROJECTS = 'project.subprojects';
public static function initializeNewProject(PhabricatorUser $actor) { public static function initializeNewProject(PhabricatorUser $actor) {
$app = id(new PhabricatorApplicationQuery()) $app = id(new PhabricatorApplicationQuery())

View file

@ -7,7 +7,7 @@ final class PhabricatorProfileMenuEditEngine
private $menuEngine; private $menuEngine;
private $profileObject; private $profileObject;
private $newPanelConfiguration; private $newMenuItemConfiguration;
private $isBuiltin; private $isBuiltin;
public function isEngineConfigurable() { public function isEngineConfigurable() {
@ -32,14 +32,14 @@ final class PhabricatorProfileMenuEditEngine
return $this->profileObject; return $this->profileObject;
} }
public function setNewPanelConfiguration( public function setNewMenuItemConfiguration(
PhabricatorProfileMenuItemConfiguration $configuration) { PhabricatorProfileMenuItemConfiguration $configuration) {
$this->newPanelConfiguration = $configuration; $this->newMenuItemConfiguration = $configuration;
return $this; return $this;
} }
public function getNewPanelConfiguration() { public function getNewMenuItemConfiguration() {
return $this->newPanelConfiguration; return $this->newMenuItemConfiguration;
} }
public function setIsBuiltin($is_builtin) { public function setIsBuiltin($is_builtin) {
@ -52,11 +52,11 @@ final class PhabricatorProfileMenuEditEngine
} }
public function getEngineName() { public function getEngineName() {
return pht('Profile Panels'); return pht('Profile Menu Items');
} }
public function getSummaryHeader() { public function getSummaryHeader() {
return pht('Edit Profile Panel Configurations'); return pht('Edit Profile Menu Item Configurations');
} }
public function getSummaryText() { public function getSummaryText() {
@ -68,12 +68,14 @@ final class PhabricatorProfileMenuEditEngine
} }
protected function newEditableObject() { protected function newEditableObject() {
if (!$this->newPanelConfiguration) { if (!$this->newMenuItemConfiguration) {
throw new Exception( throw new Exception(
pht('Profile panels can not be generated without an object context.')); pht(
'Profile menu items can not be generated without an '.
'object context.'));
} }
return clone $this->newPanelConfiguration; return clone $this->newMenuItemConfiguration;
} }
protected function newObjectQuery() { protected function newObjectQuery() {
@ -121,8 +123,8 @@ final class PhabricatorProfileMenuEditEngine
} }
protected function buildCustomEditFields($object) { protected function buildCustomEditFields($object) {
$panel = $object->getPanel(); $item = $object->getMenuItem();
$fields = $panel->buildEditEngineFields($object); $fields = $item->buildEditEngineFields($object);
$type_property = $type_property =
PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY; PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY;

View file

@ -60,7 +60,7 @@ final class PhabricatorProfileMenuEditor
case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY: case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY:
$key = $xaction->getMetadataValue('property.key'); $key = $xaction->getMetadataValue('property.key');
$value = $xaction->getNewValue(); $value = $xaction->getNewValue();
$object->getMenuItemProperty($key, $value); $object->setMenuItemProperty($key, $value);
return; return;
case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER: case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER:
$object->setMenuItemOrder($xaction->getNewValue()); $object->setMenuItemOrder($xaction->getNewValue());

View file

@ -4,8 +4,8 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
private $viewer; private $viewer;
private $profileObject; private $profileObject;
private $panels; private $items;
private $defaultPanel; private $defaultItem;
private $controller; private $controller;
private $navigation; private $navigation;
@ -36,18 +36,18 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
return $this->controller; return $this->controller;
} }
private function setDefaultPanel( private function setDefaultItem(
PhabricatorProfileMenuItemConfiguration $default_panel) { PhabricatorProfileMenuItemConfiguration $default_item) {
$this->defaultPanel = $default_panel; $this->defaultItem = $default_item;
return $this; return $this;
} }
public function getDefaultPanel() { public function getDefaultItem() {
$this->loadPanels(); $this->loadItems();
return $this->defaultPanel; return $this->defaultItem;
} }
abstract protected function getPanelURI($path); abstract protected function getItemURI($path);
abstract protected function isMenuEngineConfigurable(); abstract protected function isMenuEngineConfigurable();
@ -59,12 +59,12 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$request = $controller->getRequest(); $request = $controller->getRequest();
$panel_action = $request->getURIData('panelAction'); $item_action = $request->getURIData('itemAction');
// If the engine is not configurable, don't respond to any of the editing // If the engine is not configurable, don't respond to any of the editing
// or configuration routes. // or configuration routes.
if (!$this->isMenuEngineConfigurable()) { if (!$this->isMenuEngineConfigurable()) {
switch ($panel_action) { switch ($item_action) {
case 'view': case 'view':
break; break;
default: default:
@ -72,80 +72,79 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
} }
} }
$panel_id = $request->getURIData('panelID'); $item_id = $request->getURIData('itemID');
$item_list = $this->loadItems();
$panel_list = $this->loadPanels(); $selected_item = null;
if (strlen($item_id)) {
$selected_panel = null; $item_id_int = (int)$item_id;
if (strlen($panel_id)) { foreach ($item_list as $item) {
$panel_id_int = (int)$panel_id; if ($item_id_int) {
foreach ($panel_list as $panel) { if ((int)$item->getID() === $item_id_int) {
if ($panel_id_int) { $selected_item = $item;
if ((int)$panel->getID() === $panel_id_int) {
$selected_panel = $panel;
break; break;
} }
} }
$builtin_key = $panel->getBuiltinKey(); $builtin_key = $item->getBuiltinKey();
if ($builtin_key === (string)$panel_id) { if ($builtin_key === (string)$item_id) {
$selected_panel = $panel; $selected_item = $item;
break; break;
} }
} }
} }
switch ($panel_action) { switch ($item_action) {
case 'view': case 'view':
case 'info': case 'info':
case 'hide': case 'hide':
case 'default': case 'default':
case 'builtin': case 'builtin':
if (!$selected_panel) { if (!$selected_item) {
return new Aphront404Response(); return new Aphront404Response();
} }
break; break;
} }
$navigation = $this->buildNavigation(); $navigation = $this->buildNavigation();
$navigation->selectFilter('panel.configure'); $navigation->selectFilter('item.configure');
$crumbs = $controller->buildApplicationCrumbsForEditEngine(); $crumbs = $controller->buildApplicationCrumbsForEditEngine();
switch ($panel_action) { switch ($item_action) {
case 'view': case 'view':
$content = $this->buildPanelViewContent($selected_panel); $content = $this->buildItemViewContent($selected_item);
break; break;
case 'configure': case 'configure':
$content = $this->buildPanelConfigureContent($panel_list); $content = $this->buildItemConfigureContent($item_list);
$crumbs->addTextCrumb(pht('Configure Menu')); $crumbs->addTextCrumb(pht('Configure Menu'));
break; break;
case 'reorder': case 'reorder':
$content = $this->buildPanelReorderContent($panel_list); $content = $this->buildItemReorderContent($item_list);
break; break;
case 'new': case 'new':
$panel_key = $request->getURIData('panelKey'); $item_key = $request->getURIData('itemKey');
$content = $this->buildPanelNewContent($panel_key); $content = $this->buildItemNewContent($item_key);
break; break;
case 'builtin': case 'builtin':
$content = $this->buildPanelBuiltinContent($selected_panel); $content = $this->buildItemBuiltinContent($selected_item);
break; break;
case 'hide': case 'hide':
$content = $this->buildPanelHideContent($selected_panel); $content = $this->buildItemHideContent($selected_item);
break; break;
case 'default': case 'default':
$content = $this->buildPanelDefaultContent( $content = $this->buildItemDefaultContent(
$selected_panel, $selected_item,
$panel_list); $item_list);
break; break;
case 'edit': case 'edit':
$content = $this->buildPanelEditContent(); $content = $this->buildItemEditContent();
break; break;
default: default:
throw new Exception( throw new Exception(
pht( pht(
'Unsupported panel action "%s".', 'Unsupported item action "%s".',
$panel_action)); $item_action));
} }
if ($content instanceof AphrontResponse) { if ($content instanceof AphrontResponse) {
@ -170,33 +169,33 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$nav = id(new AphrontSideNavFilterView()) $nav = id(new AphrontSideNavFilterView())
->setIsProfileMenu(true) ->setIsProfileMenu(true)
->setBaseURI(new PhutilURI($this->getPanelURI(''))); ->setBaseURI(new PhutilURI($this->getItemURI('')));
$panels = $this->getPanels(); $menu_items = $this->getItems();
foreach ($panels as $panel) { foreach ($menu_items as $menu_item) {
if ($panel->isDisabled()) { if ($menu_item->isDisabled()) {
continue; continue;
} }
$items = $panel->buildNavigationMenuItems(); $items = $menu_item->buildNavigationMenuItems();
foreach ($items as $item) { foreach ($items as $item) {
$this->validateNavigationMenuItem($item); $this->validateNavigationMenuItem($item);
} }
// If the panel produced only a single item which does not otherwise // If the item produced only a single item which does not otherwise
// have a key, try to automatically assign it a reasonable key. This // have a key, try to automatically assign it a reasonable key. This
// makes selecting the correct item simpler. // makes selecting the correct item simpler.
if (count($items) == 1) { if (count($items) == 1) {
$item = head($items); $item = head($items);
if ($item->getKey() === null) { if ($item->getKey() === null) {
$builtin_key = $panel->getBuiltinKey(); $builtin_key = $menu_item->getBuiltinKey();
$panel_phid = $panel->getPHID(); $item_phid = $menu_item->getPHID();
if ($builtin_key !== null) { if ($builtin_key !== null) {
$item->setKey($builtin_key); $item->setKey($builtin_key);
} else if ($panel_phid !== null) { } else if ($item_phid !== null) {
$item->setKey($panel_phid); $item->setKey($item_phid);
} }
} }
} }
@ -217,75 +216,75 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
return $this->navigation; return $this->navigation;
} }
private function getPanels() { private function getItems() {
if ($this->panels === null) { if ($this->items === null) {
$this->panels = $this->loadPanels(); $this->items = $this->loadItems();
} }
return $this->panels; return $this->items;
} }
private function loadPanels() { private function loadItems() {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$object = $this->getProfileObject(); $object = $this->getProfileObject();
$panels = $this->loadBuiltinProfilePanels(); $items = $this->loadBuiltinProfileItems();
$stored_panels = id(new PhabricatorProfileMenuItemConfigurationQuery()) $stored_items = id(new PhabricatorProfileMenuItemConfigurationQuery())
->setViewer($viewer) ->setViewer($viewer)
->withProfilePHIDs(array($object->getPHID())) ->withProfilePHIDs(array($object->getPHID()))
->execute(); ->execute();
foreach ($stored_panels as $stored_panel) { foreach ($stored_items as $stored_item) {
$impl = $stored_panel->getPanel(); $impl = $stored_item->getMenuItem();
$impl->setViewer($viewer); $impl->setViewer($viewer);
} }
// Merge the stored panels into the builtin panels. If a builtin panel has // Merge the stored items into the builtin items. If a builtin item has
// a stored version, replace the defaults with the stored changes. // a stored version, replace the defaults with the stored changes.
foreach ($stored_panels as $stored_panel) { foreach ($stored_items as $stored_item) {
if (!$stored_panel->shouldEnableForObject($object)) { if (!$stored_item->shouldEnableForObject($object)) {
continue; continue;
} }
$builtin_key = $stored_panel->getBuiltinKey(); $builtin_key = $stored_item->getBuiltinKey();
if ($builtin_key !== null) { if ($builtin_key !== null) {
// If this builtin actually exists, replace the builtin with the // If this builtin actually exists, replace the builtin with the
// stored configuration. Otherwise, we're just going to drop the // stored configuration. Otherwise, we're just going to drop the
// stored config: it corresponds to an out-of-date or uninstalled // stored config: it corresponds to an out-of-date or uninstalled
// panel. // item.
if (isset($panels[$builtin_key])) { if (isset($items[$builtin_key])) {
$panels[$builtin_key] = $stored_panel; $items[$builtin_key] = $stored_item;
} else { } else {
continue; continue;
} }
} else { } else {
$panels[] = $stored_panel; $items[] = $stored_item;
} }
} }
$panels = msort($panels, 'getSortKey'); $items = msort($items, 'getSortKey');
// Normalize keys since callers shouldn't rely on this array being // Normalize keys since callers shouldn't rely on this array being
// partially keyed. // partially keyed.
$panels = array_values($panels); $items = array_values($items);
// Make sure exactly one valid panel is marked as default. // Make sure exactly one valid item is marked as default.
$default = null; $default = null;
$first = null; $first = null;
foreach ($panels as $panel) { foreach ($items as $item) {
if (!$panel->canMakeDefault()) { if (!$item->canMakeDefault()) {
continue; continue;
} }
if ($panel->isDefault()) { if ($item->isDefault()) {
$default = $panel; $default = $item;
break; break;
} }
if ($first === null) { if ($first === null) {
$first = $panel; $first = $item;
} }
} }
@ -294,17 +293,17 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
} }
if ($default) { if ($default) {
$this->setDefaultPanel($default); $this->setDefaultItem($default);
} }
return $panels; return $items;
} }
private function loadBuiltinProfilePanels() { private function loadBuiltinProfileItems() {
$object = $this->getProfileObject(); $object = $this->getProfileObject();
$builtins = $this->getBuiltinProfilePanels($object); $builtins = $this->getBuiltinProfileItems($object);
$panels = PhabricatorProfilePanel::getAllPanels(); $items = PhabricatorProfileMenuItem::getAllMenuItems();
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$order = 1; $order = 1;
@ -315,36 +314,36 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
if (!$builtin_key) { if (!$builtin_key) {
throw new Exception( throw new Exception(
pht( pht(
'Object produced a builtin panel with no builtin panel key! '. 'Object produced a builtin item with no builtin item key! '.
'Builtin panels must have a unique key.')); 'Builtin items must have a unique key.'));
} }
if (isset($map[$builtin_key])) { if (isset($map[$builtin_key])) {
throw new Exception( throw new Exception(
pht( pht(
'Object produced two panels with the same builtin key ("%s"). '. 'Object produced two items with the same builtin key ("%s"). '.
'Each panel must have a unique builtin key.', 'Each item must have a unique builtin key.',
$builtin_key)); $builtin_key));
} }
$panel_key = $builtin->getMenuItemKey(); $item_key = $builtin->getMenuItemKey();
$panel = idx($panels, $panel_key); $item = idx($items, $item_key);
if (!$panel) { if (!$item) {
throw new Exception( throw new Exception(
pht( pht(
'Builtin panel ("%s") specifies a bad panel key ("%s"); there '. 'Builtin item ("%s") specifies a bad item key ("%s"); there '.
'is no corresponding panel implementation available.', 'is no corresponding item implementation available.',
$builtin_key, $builtin_key,
$panel_key)); $item_key));
} }
$panel = clone $panel; $item = clone $item;
$panel->setViewer($viewer); $item->setViewer($viewer);
$builtin $builtin
->setProfilePHID($object->getPHID()) ->setProfilePHID($object->getPHID())
->attachPanel($panel) ->attachMenuItem($item)
->attachProfileObject($object) ->attachProfileObject($object)
->setMenuItemOrder($order); ->setMenuItemOrder($order);
@ -437,10 +436,10 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
} }
public function getConfigureURI() { public function getConfigureURI() {
return $this->getPanelURI('configure/'); return $this->getItemURI('configure/');
} }
private function buildPanelReorderContent(array $panels) { private function buildItemReorderContent(array $items) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$object = $this->getProfileObject(); $object = $this->getProfileObject();
@ -459,14 +458,14 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$by_builtin = array(); $by_builtin = array();
$by_id = array(); $by_id = array();
foreach ($panels as $key => $panel) { foreach ($items as $key => $item) {
$id = $panel->getID(); $id = $item->getID();
if ($id) { if ($id) {
$by_id[$id] = $key; $by_id[$id] = $key;
continue; continue;
} }
$builtin_key = $panel->getBuiltinKey(); $builtin_key = $item->getBuiltinKey();
if ($builtin_key) { if ($builtin_key) {
$by_builtin[$builtin_key] = $key; $by_builtin[$builtin_key] = $key;
continue; continue;
@ -485,13 +484,13 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
} }
} }
$panels = array_select_keys($panels, $key_order) + $panels; $items = array_select_keys($items, $key_order) + $items;
$type_order = $type_order =
PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER; PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER;
$order = 1; $order = 1;
foreach ($panels as $panel) { foreach ($items as $item) {
$xactions = array(); $xactions = array();
$xactions[] = id(new PhabricatorProfileMenuItemConfigurationTransaction()) $xactions[] = id(new PhabricatorProfileMenuItemConfigurationTransaction())
@ -503,7 +502,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->setActor($viewer) ->setActor($viewer)
->setContinueOnMissingFields(true) ->setContinueOnMissingFields(true)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)
->applyTransactions($panel, $xactions); ->applyTransactions($item, $xactions);
$order++; $order++;
} }
@ -513,7 +512,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
} }
private function buildPanelConfigureContent(array $panels) { private function buildItemConfigureContent(array $items) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$object = $this->getProfileObject(); $object = $this->getProfileObject();
@ -528,34 +527,34 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
'reorder-profile-menu-items', 'reorder-profile-menu-items',
array( array(
'listID' => $list_id, 'listID' => $list_id,
'orderURI' => $this->getPanelURI('reorder/'), 'orderURI' => $this->getItemURI('reorder/'),
)); ));
$list = id(new PHUIObjectItemListView()) $list = id(new PHUIObjectItemListView())
->setID($list_id); ->setID($list_id);
foreach ($panels as $panel) { foreach ($items as $item) {
$id = $panel->getID(); $id = $item->getID();
$builtin_key = $panel->getBuiltinKey(); $builtin_key = $item->getBuiltinKey();
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,
$panel, $item,
PhabricatorPolicyCapability::CAN_EDIT); PhabricatorPolicyCapability::CAN_EDIT);
$item = id(new PHUIObjectItemView()); $view = id(new PHUIObjectItemView());
$name = $panel->getDisplayName(); $name = $item->getDisplayName();
$type = $panel->getPanelTypeName(); $type = $item->getMenuItemTypeName();
if (!strlen(trim($name))) { if (!strlen(trim($name))) {
$name = pht('Untitled "%s" Item', $type); $name = pht('Untitled "%s" Item', $type);
} }
$item->setHeader($name); $view->setHeader($name);
$item->addAttribute($type); $view->addAttribute($type);
if ($can_edit) { if ($can_edit) {
$item $view
->setGrippable(true) ->setGrippable(true)
->addSigil('profile-menu-item') ->addSigil('profile-menu-item')
->setMetadata( ->setMetadata(
@ -564,15 +563,15 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
)); ));
if ($id) { if ($id) {
$default_uri = $this->getPanelURI("default/{$id}/"); $default_uri = $this->getItemURI("default/{$id}/");
} else { } else {
$default_uri = $this->getPanelURI("default/{$builtin_key}/"); $default_uri = $this->getItemURI("default/{$builtin_key}/");
} }
if ($panel->isDefault()) { if ($item->isDefault()) {
$default_icon = 'fa-thumb-tack green'; $default_icon = 'fa-thumb-tack green';
$default_text = pht('Current Default'); $default_text = pht('Current Default');
} else if ($panel->canMakeDefault()) { } else if ($item->canMakeDefault()) {
$default_icon = 'fa-thumb-tack'; $default_icon = 'fa-thumb-tack';
$default_text = pht('Make Default'); $default_text = pht('Make Default');
} else { } else {
@ -580,7 +579,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
} }
if ($default_text !== null) { if ($default_text !== null) {
$item->addAction( $view->addAction(
id(new PHUIListItemView()) id(new PHUIListItemView())
->setHref($default_uri) ->setHref($default_uri)
->setWorkflow(true) ->setWorkflow(true)
@ -589,17 +588,17 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
} }
if ($id) { if ($id) {
$item->setHref($this->getPanelURI("edit/{$id}/")); $view->setHref($this->getItemURI("edit/{$id}/"));
$hide_uri = $this->getPanelURI("hide/{$id}/"); $hide_uri = $this->getItemURI("hide/{$id}/");
} else { } else {
$item->setHref($this->getPanelURI("builtin/{$builtin_key}/")); $view->setHref($this->getItemURI("builtin/{$builtin_key}/"));
$hide_uri = $this->getPanelURI("hide/{$builtin_key}/"); $hide_uri = $this->getItemURI("hide/{$builtin_key}/");
} }
if ($panel->isDisabled()) { if ($item->isDisabled()) {
$hide_icon = 'fa-plus'; $hide_icon = 'fa-plus';
$hide_text = pht('Enable'); $hide_text = pht('Enable');
} else if ($panel->getBuiltinKey() !== null) { } else if ($item->getBuiltinKey() !== null) {
$hide_icon = 'fa-times'; $hide_icon = 'fa-times';
$hide_text = pht('Disable'); $hide_text = pht('Disable');
} else { } else {
@ -607,9 +606,9 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$hide_text = pht('Delete'); $hide_text = pht('Delete');
} }
$can_disable = $panel->canHideMenuItem(); $can_disable = $item->canHideMenuItem();
$item->addAction( $view->addAction(
id(new PHUIListItemView()) id(new PHUIListItemView())
->setHref($hide_uri) ->setHref($hide_uri)
->setWorkflow(true) ->setWorkflow(true)
@ -618,35 +617,35 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->setIcon($hide_icon)); ->setIcon($hide_icon));
} }
if ($panel->isDisabled()) { if ($item->isDisabled()) {
$item->setDisabled(true); $view->setDisabled(true);
} }
$list->addItem($item); $list->addItem($view);
} }
$action_view = id(new PhabricatorActionListView()) $action_view = id(new PhabricatorActionListView())
->setUser($viewer); ->setUser($viewer);
$panel_types = PhabricatorProfilePanel::getAllPanels(); $item_types = PhabricatorProfileMenuItem::getAllMenuItems();
$action_view->addAction( $action_view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setLabel(true) ->setLabel(true)
->setName(pht('Add New Menu Item...'))); ->setName(pht('Add New Menu Item...')));
foreach ($panel_types as $panel_type) { foreach ($item_types as $item_type) {
if (!$panel_type->canAddToObject($object)) { if (!$item_type->canAddToObject($object)) {
continue; continue;
} }
$panel_key = $panel_type->getPanelKey(); $item_key = $item_type->getMenuItemKey();
$action_view->addAction( $action_view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setIcon($panel_type->getPanelTypeIcon()) ->setIcon($item_type->getMenuItemTypeIcon())
->setName($panel_type->getPanelTypeName()) ->setName($item_type->getMenuItemTypeName())
->setHref($this->getPanelURI("new/{$panel_key}/"))); ->setHref($this->getItemURI("new/{$item_key}/")));
} }
$action_view->addAction( $action_view->addAction(
@ -682,22 +681,21 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
return $box; return $box;
} }
private function buildPanelNewContent($panel_key) { private function buildItemNewContent($item_key) {
$panel_types = PhabricatorProfilePanel::getAllPanels(); $item_types = PhabricatorProfileMenuItem::getAllMenuItems();
$panel_type = idx($panel_types, $panel_key); $item_type = idx($item_types, $item_key);
if (!$panel_type) { if (!$item_type) {
return new Aphront404Response(); return new Aphront404Response();
} }
$object = $this->getProfileObject(); $object = $this->getProfileObject();
if (!$panel_type->canAddToObject($object)) { if (!$item_type->canAddToObject($object)) {
return new Aphront404Response(); return new Aphront404Response();
} }
$configuration = $configuration = PhabricatorProfileMenuItemConfiguration::initializeNewItem(
PhabricatorProfileMenuItemConfiguration::initializeNewPanelConfiguration( $object,
$object, $item_type);
$panel_type);
$viewer = $this->getViewer(); $viewer = $this->getViewer();
@ -711,12 +709,12 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
return id(new PhabricatorProfileMenuEditEngine()) return id(new PhabricatorProfileMenuEditEngine())
->setMenuEngine($this) ->setMenuEngine($this)
->setProfileObject($object) ->setProfileObject($object)
->setNewPanelConfiguration($configuration) ->setNewMenuItemConfiguration($configuration)
->setController($controller) ->setController($controller)
->buildResponse(); ->buildResponse();
} }
private function buildPanelEditContent() { private function buildItemEditContent() {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$object = $this->getProfileObject(); $object = $this->getProfileObject();
$controller = $this->getController(); $controller = $this->getController();
@ -728,18 +726,18 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->buildResponse(); ->buildResponse();
} }
private function buildPanelBuiltinContent( private function buildItemBuiltinContent(
PhabricatorProfileMenuItemConfiguration $configuration) { PhabricatorProfileMenuItemConfiguration $configuration) {
// If this builtin panel has already been persisted, redirect to the // If this builtin item has already been persisted, redirect to the
// edit page. // edit page.
$id = $configuration->getID(); $id = $configuration->getID();
if ($id) { if ($id) {
return id(new AphrontRedirectResponse()) return id(new AphrontRedirectResponse())
->setURI($this->getPanelURI("edit/{$id}/")); ->setURI($this->getItemURI("edit/{$id}/"));
} }
// Otherwise, act like we're creating a new panel, we're just starting // Otherwise, act like we're creating a new item, we're just starting
// with the builtin template. // with the builtin template.
$viewer = $this->getViewer(); $viewer = $this->getViewer();
@ -755,12 +753,12 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->setIsBuiltin(true) ->setIsBuiltin(true)
->setMenuEngine($this) ->setMenuEngine($this)
->setProfileObject($object) ->setProfileObject($object)
->setNewPanelConfiguration($configuration) ->setNewMenuItemConfiguration($configuration)
->setController($controller) ->setController($controller)
->buildResponse(); ->buildResponse();
} }
private function buildPanelHideContent( private function buildItemHideContent(
PhabricatorProfileMenuItemConfiguration $configuration) { PhabricatorProfileMenuItemConfiguration $configuration) {
$controller = $this->getController(); $controller = $this->getController();
@ -774,9 +772,9 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
if (!$configuration->canHideMenuItem()) { if (!$configuration->canHideMenuItem()) {
return $controller->newDialog() return $controller->newDialog()
->setTitle(pht('Mandatory Panel')) ->setTitle(pht('Mandatory Item'))
->appendParagraph( ->appendParagraph(
pht('This panel is very important, and can not be disabled.')) pht('This menu item is very important, and can not be disabled.'))
->addCancelButton($this->getConfigureURI()); ->addCancelButton($this->getConfigureURI());
} }
@ -837,9 +835,9 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->addSubmitButton($button); ->addSubmitButton($button);
} }
private function buildPanelDefaultContent( private function buildItemDefaultContent(
PhabricatorProfileMenuItemConfiguration $configuration, PhabricatorProfileMenuItemConfiguration $configuration,
array $panels) { array $items) {
$controller = $this->getController(); $controller = $this->getController();
$request = $controller->getRequest(); $request = $controller->getRequest();
@ -894,7 +892,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->addSubmitButton(pht('Make Default')); ->addSubmitButton(pht('Make Default'));
} }
protected function newPanel() { protected function newItem() {
return PhabricatorProfileMenuItemConfiguration::initializeNewBuiltin(); return PhabricatorProfileMenuItemConfiguration::initializeNewBuiltin();
} }
@ -903,30 +901,30 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$request = $controller->getRequest(); $request = $controller->getRequest();
$viewer = $request->getViewer(); $viewer = $request->getViewer();
$panels = $this->loadPanels(); $items = $this->loadItems();
// To adjust the default panel, we first change any existing panels that // To adjust the default item, we first change any existing items that
// are marked as defaults to "visible", then make the new default panel // are marked as defaults to "visible", then make the new default item
// the default. // the default.
$default = array(); $default = array();
$visible = array(); $visible = array();
foreach ($panels as $panel) { foreach ($items as $item) {
$builtin_key = $panel->getBuiltinKey(); $builtin_key = $item->getBuiltinKey();
$id = $panel->getID(); $id = $item->getID();
$is_target = $is_target =
(($builtin_key !== null) && ($builtin_key === $key)) || (($builtin_key !== null) && ($builtin_key === $key)) ||
(($id !== null) && ((int)$id === (int)$key)); (($id !== null) && ((int)$id === (int)$key));
if ($is_target) { if ($is_target) {
if (!$panel->isDefault()) { if (!$item->isDefault()) {
$default[] = $panel; $default[] = $item;
} }
} else { } else {
if ($panel->isDefault()) { if ($item->isDefault()) {
$visible[] = $panel; $visible[] = $item;
} }
} }
} }
@ -943,8 +941,8 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
); );
foreach ($apply as $group) { foreach ($apply as $group) {
list($value, $panels) = $group; list($value, $items) = $group;
foreach ($panels as $panel) { foreach ($items as $item) {
$xactions = array(); $xactions = array();
$xactions[] = $xactions[] =
@ -957,7 +955,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->setActor($viewer) ->setActor($viewer)
->setContinueOnMissingFields(true) ->setContinueOnMissingFields(true)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)
->applyTransactions($panel, $xactions); ->applyTransactions($item, $xactions);
} }
} }

View file

@ -1,15 +1,15 @@
<?php <?php
final class PhabricatorApplicationProfilePanel final class PhabricatorApplicationProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'application'; const MENUITEMKEY = 'application';
public function getPanelTypeIcon() { public function getMenuItemTypeIcon() {
return 'fa-globe'; return 'fa-globe';
} }
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Application'); return pht('Application');
} }

View file

@ -1,15 +1,15 @@
<?php <?php
final class PhabricatorDividerProfilePanel final class PhabricatorDividerProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'divider'; const MENUITEMKEY = 'divider';
public function getPanelTypeIcon() { public function getMenuItemTypeIcon() {
return 'fa-minus'; return 'fa-minus';
} }
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Divider'); return pht('Divider');
} }

View file

@ -1,15 +1,15 @@
<?php <?php
final class PhabricatorLinkProfilePanel final class PhabricatorLinkProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'link'; const MENUITEMKEY = 'link';
public function getPanelTypeIcon() { public function getMenuItemTypeIcon() {
return 'fa-link'; return 'fa-link';
} }
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Link'); return pht('Link');
} }
@ -38,7 +38,7 @@ final class PhabricatorLinkProfilePanel
id(new PhabricatorIconSetEditField()) id(new PhabricatorIconSetEditField())
->setKey('icon') ->setKey('icon')
->setLabel(pht('Icon')) ->setLabel(pht('Icon'))
->setIconSet(new PhabricatorProfilePanelIconSet()) ->setIconSet(new PhabricatorProfileMenuItemIconSet())
->setValue($this->getLinkIcon($config)), ->setValue($this->getLinkIcon($config)),
); );
} }
@ -73,7 +73,7 @@ final class PhabricatorLinkProfilePanel
$href = '#'; $href = '#';
} }
$icon_object = id(new PhabricatorProfilePanelIconSet()) $icon_object = id(new PhabricatorProfileMenuItemIconSet())
->getIcon($icon); ->getIcon($icon);
if ($icon_object) { if ($icon_object) {
$icon_class = $icon_object->getIcon(); $icon_class = $icon_object->getIcon();

View file

@ -1,15 +1,15 @@
<?php <?php
final class PhabricatorMotivatorProfilePanel final class PhabricatorMotivatorProfileMenuItem
extends PhabricatorProfilePanel { extends PhabricatorProfileMenuItem {
const PANELKEY = 'motivator'; const MENUITEMKEY = 'motivator';
public function getPanelTypeIcon() { public function getMenuItemTypeIcon() {
return 'fa-coffee'; return 'fa-coffee';
} }
public function getPanelTypeName() { public function getMenuItemTypeName() {
return pht('Motivator'); return pht('Motivator');
} }
@ -36,7 +36,7 @@ final class PhabricatorMotivatorProfilePanel
->setValue( ->setValue(
pht( pht(
'Motivate your team with inspirational quotes from great minds. '. 'Motivate your team with inspirational quotes from great minds. '.
'This panel shows a new quote every day.')), 'This menu item shows a new quote every day.')),
id(new PhabricatorSelectEditField()) id(new PhabricatorSelectEditField())
->setKey('source') ->setKey('source')
->setLabel(pht('Source')) ->setLabel(pht('Source'))

View file

@ -1,6 +1,6 @@
<?php <?php
abstract class PhabricatorProfilePanel extends Phobject { abstract class PhabricatorProfileMenuItem extends Phobject {
private $viewer; private $viewer;
@ -12,11 +12,11 @@ abstract class PhabricatorProfilePanel extends Phobject {
abstract protected function newNavigationMenuItems( abstract protected function newNavigationMenuItems(
PhabricatorProfileMenuItemConfiguration $config); PhabricatorProfileMenuItemConfiguration $config);
public function getPanelTypeIcon() { public function getMenuItemTypeIcon() {
return null; return null;
} }
abstract public function getPanelTypeName(); abstract public function getMenuItemTypeName();
abstract public function getDisplayName( abstract public function getDisplayName(
PhabricatorProfileMenuItemConfiguration $config); PhabricatorProfileMenuItemConfiguration $config);
@ -34,7 +34,7 @@ abstract class PhabricatorProfilePanel extends Phobject {
return true; return true;
} }
public function canHidePanel( public function canHideMenuItem(
PhabricatorProfileMenuItemConfiguration $config) { PhabricatorProfileMenuItemConfiguration $config) {
return true; return true;
} }
@ -53,14 +53,14 @@ abstract class PhabricatorProfilePanel extends Phobject {
return $this->viewer; return $this->viewer;
} }
final public function getPanelKey() { final public function getMenuItemKey() {
return $this->getPhobjectClassConstant('PANELKEY'); return $this->getPhobjectClassConstant('MENUITEMKEY');
} }
final public static function getAllPanels() { final public static function getAllMenuItems() {
return id(new PhutilClassMapQuery()) return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__) ->setAncestorClass(__CLASS__)
->setUniqueMethod('getPanelKey') ->setUniqueMethod('getMenuItemKey')
->execute(); ->execute();
} }

View file

@ -1,9 +1,9 @@
<?php <?php
final class PhabricatorProfilePanelIconSet final class PhabricatorProfileMenuItemIconSet
extends PhabricatorIconSet { extends PhabricatorIconSet {
const ICONSETKEY = 'profilepanel'; const ICONSETKEY = 'profilemenuitem';
public function getSelectIconTitleText() { public function getSelectIconTitleText() {
return pht('Choose Item Icon'); return pht('Choose Item Icon');

View file

@ -58,15 +58,15 @@ final class PhabricatorProfileMenuItemConfigurationQuery
} }
protected function willFilterPage(array $page) { protected function willFilterPage(array $page) {
$panels = PhabricatorProfilePanel::getAllPanels(); $items = PhabricatorProfileMenuItem::getAllMenuItems();
foreach ($page as $key => $panel) { foreach ($page as $key => $item) {
$panel_type = idx($panels, $panel->getMenuItemKey()); $item_type = idx($items, $item->getMenuItemKey());
if (!$panel_type) { if (!$item_type) {
$this->didRejectResult($panel); $this->didRejectResult($item);
unset($page[$key]); unset($page[$key]);
continue; continue;
} }
$panel->attachPanel($panel_type); $item->attachMenuItem($item_type);
} }
if (!$page) { if (!$page) {
@ -82,14 +82,14 @@ final class PhabricatorProfileMenuItemConfigurationQuery
->execute(); ->execute();
$profiles = mpull($profiles, null, 'getPHID'); $profiles = mpull($profiles, null, 'getPHID');
foreach ($page as $key => $panel) { foreach ($page as $key => $item) {
$profile = idx($profiles, $panel->getProfilePHID()); $profile = idx($profiles, $item->getProfilePHID());
if (!$profile) { if (!$profile) {
$this->didRejectResult($panel); $this->didRejectResult($item);
unset($page[$key]); unset($page[$key]);
continue; continue;
} }
$panel->attachProfileObject($profile); $item->attachProfileObject($profile);
} }
return $page; return $page;

View file

@ -15,7 +15,7 @@ final class PhabricatorProfileMenuItemConfiguration
protected $menuItemProperties = array(); protected $menuItemProperties = array();
private $profileObject = self::ATTACHABLE; private $profileObject = self::ATTACHABLE;
private $panel = self::ATTACHABLE; private $menuItem = self::ATTACHABLE;
const VISIBILITY_DEFAULT = 'default'; const VISIBILITY_DEFAULT = 'default';
const VISIBILITY_VISIBLE = 'visible'; const VISIBILITY_VISIBLE = 'visible';
@ -31,14 +31,14 @@ final class PhabricatorProfileMenuItemConfiguration
->setVisibility(self::VISIBILITY_VISIBLE); ->setVisibility(self::VISIBILITY_VISIBLE);
} }
public static function initializeNewPanelConfiguration( public static function initializeNewItem(
$profile_object, $profile_object,
PhabricatorProfilePanel $panel) { PhabricatorProfileMenuItem $item) {
return self::initializeNewBuiltin() return self::initializeNewBuiltin()
->setProfilePHID($profile_object->getPHID()) ->setProfilePHID($profile_object->getPHID())
->setMenuItemKey($panel->getPanelKey()) ->setMenuItemKey($item->getMenuItemKey())
->attachPanel($panel) ->attachMenuItem($item)
->attachProfileObject($profile_object); ->attachProfileObject($profile_object);
} }
@ -67,13 +67,13 @@ final class PhabricatorProfileMenuItemConfiguration
PhabricatorProfileMenuItemPHIDType::TYPECONST); PhabricatorProfileMenuItemPHIDType::TYPECONST);
} }
public function attachPanel(PhabricatorProfilePanel $panel) { public function attachMenuItem(PhabricatorProfileMenuItem $item) {
$this->panel = $panel; $this->menuItem = $item;
return $this; return $this;
} }
public function getPanel() { public function getMenuItem() {
return $this->assertAttached($this->panel); return $this->assertAttached($this->menuItem);
} }
public function attachProfileObject($profile_object) { public function attachProfileObject($profile_object) {
@ -95,27 +95,27 @@ final class PhabricatorProfileMenuItemConfiguration
} }
public function buildNavigationMenuItems() { public function buildNavigationMenuItems() {
return $this->getPanel()->buildNavigationMenuItems($this); return $this->getMenuItem()->buildNavigationMenuItems($this);
} }
public function getPanelTypeName() { public function getMenuItemTypeName() {
return $this->getPanel()->getPanelTypeName(); return $this->getMenuItem()->getMenuItemTypeName();
} }
public function getDisplayName() { public function getDisplayName() {
return $this->getPanel()->getDisplayName($this); return $this->getMenuItem()->getDisplayName($this);
} }
public function canMakeDefault() { public function canMakeDefault() {
return $this->getPanel()->canMakeDefault($this); return $this->getMenuItem()->canMakeDefault($this);
} }
public function canHideMenuItem() { public function canHideMenuItem() {
return $this->getPanel()->canHidePanel($this); return $this->getMenuItem()->canHideMenuItem($this);
} }
public function shouldEnableForObject($object) { public function shouldEnableForObject($object) {
return $this->getPanel()->shouldEnableForObject($object); return $this->getMenuItem()->shouldEnableForObject($object);
} }
public function getSortKey() { public function getSortKey() {

View file

@ -146,4 +146,4 @@ Writing New Item Types
IMPORTANT: This feature is not stable, and the API is subject to change. IMPORTANT: This feature is not stable, and the API is subject to change.
To add new types of items, subclass @{class:PhabricatorProfilePanel}. To add new types of items, subclass @{class:PhabricatorProfileMenuItem}.