diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index dca347a3e1..f064ab8255 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -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', diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index 89a3c6cb7a..23a759d2aa 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -627,18 +627,18 @@ abstract class PhabricatorApplication return $base.'(?:query/(?P[^/]+)/)?'; } - protected function getPanelRouting($controller) { + protected function getProfileMenuRouting($controller) { $edit_route = $this->getEditRoutePattern(); return array( - '(?Pview)/(?P[^/]+)/' => $controller, - '(?Phide)/(?P[^/]+)/' => $controller, - '(?Pdefault)/(?P[^/]+)/' => $controller, - '(?Pconfigure)/' => $controller, - '(?Preorder)/' => $controller, - '(?Pedit)/'.$edit_route => $controller, - '(?Pnew)/(?[^/]+)/'.$edit_route => $controller, - '(?Pbuiltin)/(?[^/]+)/'.$edit_route + '(?Pview)/(?P[^/]+)/' => $controller, + '(?Phide)/(?P[^/]+)/' => $controller, + '(?Pdefault)/(?P[^/]+)/' => $controller, + '(?Pconfigure)/' => $controller, + '(?Preorder)/' => $controller, + '(?Pedit)/'.$edit_route => $controller, + '(?Pnew)/(?[^/]+)/'.$edit_route => $controller, + '(?Pbuiltin)/(?[^/]+)/'.$edit_route => $controller, ); } diff --git a/src/applications/people/application/PhabricatorPeopleApplication.php b/src/applications/people/application/PhabricatorPeopleApplication.php index 44672edd3c..a4666c5a21 100644 --- a/src/applications/people/application/PhabricatorPeopleApplication.php +++ b/src/applications/people/application/PhabricatorPeopleApplication.php @@ -71,8 +71,8 @@ final class PhabricatorPeopleApplication extends PhabricatorApplication { ), '/p/(?P[\w._-]+)/' => array( '' => 'PhabricatorPeopleProfileViewController', - 'panel/' - => $this->getPanelRouting('PhabricatorPeopleProfilePanelController'), + 'item/' => $this->getProfileMenuRouting( + 'PhabricatorPeopleProfileMenuController'), ), ); } diff --git a/src/applications/people/controller/PhabricatorPeopleProfileEditController.php b/src/applications/people/controller/PhabricatorPeopleProfileEditController.php index 50fb0c29b5..3eda8a968b 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileEditController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileEditController.php @@ -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())) diff --git a/src/applications/people/controller/PhabricatorPeopleProfileManageController.php b/src/applications/people/controller/PhabricatorPeopleProfileManageController.php index 6b087891be..c5a3ceabd4 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileManageController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileManageController.php @@ -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, diff --git a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php index 8a65a9b179..226646bc70 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php @@ -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')) diff --git a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php index a83a1f93ef..17fc67e2f3 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php @@ -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); diff --git a/src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php b/src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php index 5d26d25cbb..aab3896721 100644 --- a/src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php +++ b/src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php @@ -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; } } diff --git a/src/applications/people/profilepanel/PhabricatorPeopleDetailsProfilePanel.php b/src/applications/people/menuitem/PhabricatorPeopleDetailsProfileMenuItem.php similarity index 86% rename from src/applications/people/profilepanel/PhabricatorPeopleDetailsProfilePanel.php rename to src/applications/people/menuitem/PhabricatorPeopleDetailsProfileMenuItem.php index 969d42f73c..0f5cb6c1fa 100644 --- a/src/applications/people/profilepanel/PhabricatorPeopleDetailsProfilePanel.php +++ b/src/applications/people/menuitem/PhabricatorPeopleDetailsProfileMenuItem.php @@ -1,11 +1,11 @@ 'PhabricatorProjectEditPictureController', $this->getEditRoutePattern('edit/') => 'PhabricatorProjectEditController', - '(?P[1-9]\d*)/panel/' - => $this->getPanelRouting('PhabricatorProjectPanelController'), + '(?P[1-9]\d*)/item/' => $this->getProfileMenuRouting( + 'PhabricatorProjectMenuItemController'), 'subprojects/(?P[1-9]\d*)/' => 'PhabricatorProjectSubprojectsController', 'board/(?P[1-9]\d*)/'. diff --git a/src/applications/project/controller/PhabricatorProjectBoardController.php b/src/applications/project/controller/PhabricatorProjectBoardController.php index 04ab714eb0..d0c6abf882 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardController.php @@ -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; diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php index 8960781d89..fa2a423b09 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php @@ -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()) { diff --git a/src/applications/project/controller/PhabricatorProjectEditPictureController.php b/src/applications/project/controller/PhabricatorProjectEditPictureController.php index 34a2c1b00e..4352ec6ad8 100644 --- a/src/applications/project/controller/PhabricatorProjectEditPictureController.php +++ b/src/applications/project/controller/PhabricatorProjectEditPictureController.php @@ -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) diff --git a/src/applications/project/controller/PhabricatorProjectManageController.php b/src/applications/project/controller/PhabricatorProjectManageController.php index c827f5abab..6ecdf6f62c 100644 --- a/src/applications/project/controller/PhabricatorProjectManageController.php +++ b/src/applications/project/controller/PhabricatorProjectManageController.php @@ -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)); diff --git a/src/applications/project/controller/PhabricatorProjectMembersViewController.php b/src/applications/project/controller/PhabricatorProjectMembersViewController.php index e98412ff31..959927c9f3 100644 --- a/src/applications/project/controller/PhabricatorProjectMembersViewController.php +++ b/src/applications/project/controller/PhabricatorProjectMembersViewController.php @@ -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')); diff --git a/src/applications/project/controller/PhabricatorProjectPanelController.php b/src/applications/project/controller/PhabricatorProjectMenuItemController.php similarity index 90% rename from src/applications/project/controller/PhabricatorProjectPanelController.php rename to src/applications/project/controller/PhabricatorProjectMenuItemController.php index 940553368c..bd615c3f8e 100644 --- a/src/applications/project/controller/PhabricatorProjectPanelController.php +++ b/src/applications/project/controller/PhabricatorProjectMenuItemController.php @@ -1,6 +1,6 @@ setUserPHIDs($project->getWatcherPHIDs()); $nav = $this->getProfileMenu(); - $nav->selectFilter(PhabricatorProject::PANEL_PROFILE); + $nav->selectFilter(PhabricatorProject::ITEM_PROFILE); $stories = id(new PhabricatorFeedQuery()) ->setViewer($viewer) diff --git a/src/applications/project/controller/PhabricatorProjectSubprojectsController.php b/src/applications/project/controller/PhabricatorProjectSubprojectsController.php index 1232d4010e..4a89bb4cde 100644 --- a/src/applications/project/controller/PhabricatorProjectSubprojectsController.php +++ b/src/applications/project/controller/PhabricatorProjectSubprojectsController.php @@ -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')); diff --git a/src/applications/project/controller/PhabricatorProjectViewController.php b/src/applications/project/controller/PhabricatorProjectViewController.php index 7a12d2c89c..d2f8d4f58d 100644 --- a/src/applications/project/controller/PhabricatorProjectViewController.php +++ b/src/applications/project/controller/PhabricatorProjectViewController.php @@ -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; diff --git a/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php b/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php index 5b6133b3a1..d3ea39e1e2 100644 --- a/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php +++ b/src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php @@ -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; } } diff --git a/src/applications/project/profilepanel/PhabricatorProjectDetailsProfilePanel.php b/src/applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php similarity index 87% rename from src/applications/project/profilepanel/PhabricatorProjectDetailsProfilePanel.php rename to src/applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php index 9e8c508bb7..becdd36c16 100644 --- a/src/applications/project/profilepanel/PhabricatorProjectDetailsProfilePanel.php +++ b/src/applications/project/menuitem/PhabricatorProjectDetailsProfileMenuItem.php @@ -1,11 +1,11 @@ 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; diff --git a/src/applications/search/editor/PhabricatorProfileMenuEditor.php b/src/applications/search/editor/PhabricatorProfileMenuEditor.php index 673e8728a9..d91bba272b 100644 --- a/src/applications/search/editor/PhabricatorProfileMenuEditor.php +++ b/src/applications/search/editor/PhabricatorProfileMenuEditor.php @@ -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()); diff --git a/src/applications/search/engine/PhabricatorProfileMenuEngine.php b/src/applications/search/engine/PhabricatorProfileMenuEngine.php index 2f9f17ae32..6e16e15b9a 100644 --- a/src/applications/search/engine/PhabricatorProfileMenuEngine.php +++ b/src/applications/search/engine/PhabricatorProfileMenuEngine.php @@ -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); } } diff --git a/src/applications/search/profilepanel/PhabricatorApplicationProfilePanel.php b/src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php similarity index 89% rename from src/applications/search/profilepanel/PhabricatorApplicationProfilePanel.php rename to src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php index 1486f5309e..214819100e 100644 --- a/src/applications/search/profilepanel/PhabricatorApplicationProfilePanel.php +++ b/src/applications/search/menuitem/PhabricatorApplicationProfileMenuItem.php @@ -1,15 +1,15 @@ 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(); diff --git a/src/applications/search/profilepanel/PhabricatorMotivatorProfilePanel.php b/src/applications/search/menuitem/PhabricatorMotivatorProfileMenuItem.php similarity index 94% rename from src/applications/search/profilepanel/PhabricatorMotivatorProfilePanel.php rename to src/applications/search/menuitem/PhabricatorMotivatorProfileMenuItem.php index cbdeb4fe0e..f53bc2b0eb 100644 --- a/src/applications/search/profilepanel/PhabricatorMotivatorProfilePanel.php +++ b/src/applications/search/menuitem/PhabricatorMotivatorProfileMenuItem.php @@ -1,15 +1,15 @@ 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')) diff --git a/src/applications/search/profilepanel/PhabricatorProfilePanel.php b/src/applications/search/menuitem/PhabricatorProfileMenuItem.php similarity index 76% rename from src/applications/search/profilepanel/PhabricatorProfilePanel.php rename to src/applications/search/menuitem/PhabricatorProfileMenuItem.php index 48b42808f8..f37cab236c 100644 --- a/src/applications/search/profilepanel/PhabricatorProfilePanel.php +++ b/src/applications/search/menuitem/PhabricatorProfileMenuItem.php @@ -1,6 +1,6 @@ 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(); } diff --git a/src/applications/search/profilepanel/PhabricatorProfilePanelIconSet.php b/src/applications/search/menuitem/PhabricatorProfileMenuItemIconSet.php similarity index 94% rename from src/applications/search/profilepanel/PhabricatorProfilePanelIconSet.php rename to src/applications/search/menuitem/PhabricatorProfileMenuItemIconSet.php index bc3b15a7cf..74333cc087 100644 --- a/src/applications/search/profilepanel/PhabricatorProfilePanelIconSet.php +++ b/src/applications/search/menuitem/PhabricatorProfileMenuItemIconSet.php @@ -1,9 +1,9 @@ $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; diff --git a/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php b/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php index 95dc09e945..46aa03e25d 100644 --- a/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php +++ b/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php @@ -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() { diff --git a/src/docs/user/userguide/profile_menu.diviner b/src/docs/user/userguide/profile_menu.diviner index bd278b2702..2b4ffc4be8 100644 --- a/src/docs/user/userguide/profile_menu.diviner +++ b/src/docs/user/userguide/profile_menu.diviner @@ -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}.