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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -7,7 +7,7 @@ final class PhabricatorProfileMenuEditEngine
private $menuEngine;
private $profileObject;
private $newPanelConfiguration;
private $newMenuItemConfiguration;
private $isBuiltin;
public function isEngineConfigurable() {
@ -32,14 +32,14 @@ final class PhabricatorProfileMenuEditEngine
return $this->profileObject;
}
public function setNewPanelConfiguration(
public function setNewMenuItemConfiguration(
PhabricatorProfileMenuItemConfiguration $configuration) {
$this->newPanelConfiguration = $configuration;
$this->newMenuItemConfiguration = $configuration;
return $this;
}
public function getNewPanelConfiguration() {
return $this->newPanelConfiguration;
public function getNewMenuItemConfiguration() {
return $this->newMenuItemConfiguration;
}
public function setIsBuiltin($is_builtin) {
@ -52,11 +52,11 @@ final class PhabricatorProfileMenuEditEngine
}
public function getEngineName() {
return pht('Profile Panels');
return pht('Profile Menu Items');
}
public function getSummaryHeader() {
return pht('Edit Profile Panel Configurations');
return pht('Edit Profile Menu Item Configurations');
}
public function getSummaryText() {
@ -68,12 +68,14 @@ final class PhabricatorProfileMenuEditEngine
}
protected function newEditableObject() {
if (!$this->newPanelConfiguration) {
if (!$this->newMenuItemConfiguration) {
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() {
@ -121,8 +123,8 @@ final class PhabricatorProfileMenuEditEngine
}
protected function buildCustomEditFields($object) {
$panel = $object->getPanel();
$fields = $panel->buildEditEngineFields($object);
$item = $object->getMenuItem();
$fields = $item->buildEditEngineFields($object);
$type_property =
PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,15 +1,15 @@
<?php
final class PhabricatorMotivatorProfilePanel
extends PhabricatorProfilePanel {
final class PhabricatorMotivatorProfileMenuItem
extends PhabricatorProfileMenuItem {
const PANELKEY = 'motivator';
const MENUITEMKEY = 'motivator';
public function getPanelTypeIcon() {
public function getMenuItemTypeIcon() {
return 'fa-coffee';
}
public function getPanelTypeName() {
public function getMenuItemTypeName() {
return pht('Motivator');
}
@ -36,7 +36,7 @@ final class PhabricatorMotivatorProfilePanel
->setValue(
pht(
'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())
->setKey('source')
->setLabel(pht('Source'))

View file

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

View file

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

View file

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

View file

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