@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rename "ProfilePanelConfiguration" to "ProfileMenuItemConfiguration"

Summary:
Ref T11957. This renames the Configuration storage, transaction, query, and PHID type.

No rename on the actual menu item types yet, that's next (and should be the end of this, I think).

Test Plan:
- Viewed projects.
- Viewed profiles.
- Edited a project menu.
- Grepped for all renamed symbols, I think?

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11957

Differential Revision: https://secure.phabricator.com/D17027

+307 -285
+2
resources/sql/autopatches/20161211.menu.01.itemkey.sql
··· 1 + ALTER TABLE {$NAMESPACE}_search.search_profilepanelconfiguration 2 + CHANGE panelKey menuItemKey VARCHAR(64) NOT NULL COLLATE {$COLLATE_TEXT};
+3
resources/sql/autopatches/20161211.menu.02.itemprops.sql
··· 1 + ALTER TABLE {$NAMESPACE}_search.search_profilepanelconfiguration 2 + CHANGE panelProperties menuItemProperties 3 + LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT};
+2
resources/sql/autopatches/20161211.menu.03.order.sql
··· 1 + ALTER TABLE {$NAMESPACE}_search.search_profilepanelconfiguration 2 + CHANGE panelOrder menuItemOrder INT UNSIGNED;
+13 -13
src/__phutil_library_map__.php
··· 3365 3365 'PhabricatorPonderApplication' => 'applications/ponder/application/PhabricatorPonderApplication.php', 3366 3366 'PhabricatorProfileMenuCollapsedSetting' => 'applications/settings/setting/PhabricatorProfileMenuCollapsedSetting.php', 3367 3367 'PhabricatorProfileMenuEditEngine' => 'applications/search/editor/PhabricatorProfileMenuEditEngine.php', 3368 + 'PhabricatorProfileMenuEditor' => 'applications/search/editor/PhabricatorProfileMenuEditor.php', 3368 3369 'PhabricatorProfileMenuEngine' => 'applications/search/engine/PhabricatorProfileMenuEngine.php', 3370 + 'PhabricatorProfileMenuItemConfiguration' => 'applications/search/storage/PhabricatorProfileMenuItemConfiguration.php', 3371 + 'PhabricatorProfileMenuItemConfigurationQuery' => 'applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php', 3372 + 'PhabricatorProfileMenuItemConfigurationTransaction' => 'applications/search/storage/PhabricatorProfileMenuItemConfigurationTransaction.php', 3373 + 'PhabricatorProfileMenuItemConfigurationTransactionQuery' => 'applications/search/query/PhabricatorProfileMenuItemConfigurationTransactionQuery.php', 3374 + 'PhabricatorProfileMenuItemPHIDType' => 'applications/search/phidtype/PhabricatorProfileMenuItemPHIDType.php', 3369 3375 'PhabricatorProfilePanel' => 'applications/search/profilepanel/PhabricatorProfilePanel.php', 3370 - 'PhabricatorProfilePanelConfiguration' => 'applications/search/storage/PhabricatorProfilePanelConfiguration.php', 3371 - 'PhabricatorProfilePanelConfigurationQuery' => 'applications/search/query/PhabricatorProfilePanelConfigurationQuery.php', 3372 - 'PhabricatorProfilePanelConfigurationTransaction' => 'applications/search/storage/PhabricatorProfilePanelConfigurationTransaction.php', 3373 - 'PhabricatorProfilePanelConfigurationTransactionQuery' => 'applications/search/query/PhabricatorProfilePanelConfigurationTransactionQuery.php', 3374 - 'PhabricatorProfilePanelEditor' => 'applications/search/editor/PhabricatorProfilePanelEditor.php', 3375 3376 'PhabricatorProfilePanelIconSet' => 'applications/search/profilepanel/PhabricatorProfilePanelIconSet.php', 3376 - 'PhabricatorProfilePanelPHIDType' => 'applications/search/phidtype/PhabricatorProfilePanelPHIDType.php', 3377 3377 'PhabricatorProject' => 'applications/project/storage/PhabricatorProject.php', 3378 3378 'PhabricatorProjectAddHeraldAction' => 'applications/project/herald/PhabricatorProjectAddHeraldAction.php', 3379 3379 'PhabricatorProjectApplication' => 'applications/project/application/PhabricatorProjectApplication.php', ··· 8451 8451 'PhabricatorPonderApplication' => 'PhabricatorApplication', 8452 8452 'PhabricatorProfileMenuCollapsedSetting' => 'PhabricatorInternalSetting', 8453 8453 'PhabricatorProfileMenuEditEngine' => 'PhabricatorEditEngine', 8454 + 'PhabricatorProfileMenuEditor' => 'PhabricatorApplicationTransactionEditor', 8454 8455 'PhabricatorProfileMenuEngine' => 'Phobject', 8455 - 'PhabricatorProfilePanel' => 'Phobject', 8456 - 'PhabricatorProfilePanelConfiguration' => array( 8456 + 'PhabricatorProfileMenuItemConfiguration' => array( 8457 8457 'PhabricatorSearchDAO', 8458 8458 'PhabricatorPolicyInterface', 8459 8459 'PhabricatorExtendedPolicyInterface', 8460 8460 'PhabricatorApplicationTransactionInterface', 8461 8461 ), 8462 - 'PhabricatorProfilePanelConfigurationQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 8463 - 'PhabricatorProfilePanelConfigurationTransaction' => 'PhabricatorApplicationTransaction', 8464 - 'PhabricatorProfilePanelConfigurationTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 8465 - 'PhabricatorProfilePanelEditor' => 'PhabricatorApplicationTransactionEditor', 8462 + 'PhabricatorProfileMenuItemConfigurationQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 8463 + 'PhabricatorProfileMenuItemConfigurationTransaction' => 'PhabricatorApplicationTransaction', 8464 + 'PhabricatorProfileMenuItemConfigurationTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 8465 + 'PhabricatorProfileMenuItemPHIDType' => 'PhabricatorPHIDType', 8466 + 'PhabricatorProfilePanel' => 'Phobject', 8466 8467 'PhabricatorProfilePanelIconSet' => 'PhabricatorIconSet', 8467 - 'PhabricatorProfilePanelPHIDType' => 'PhabricatorPHIDType', 8468 8468 'PhabricatorProject' => array( 8469 8469 'PhabricatorProjectDAO', 8470 8470 'PhabricatorApplicationTransactionInterface',
+14 -14
src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php
··· 24 24 25 25 $panels[] = $this->newPanel() 26 26 ->setBuiltinKey(self::PANEL_PROFILE) 27 - ->setPanelKey(PhabricatorPeopleDetailsProfilePanel::PANELKEY); 27 + ->setMenuItemKey(PhabricatorPeopleDetailsProfilePanel::PANELKEY); 28 28 29 29 $have_maniphest = PhabricatorApplication::isClassInstalledForViewer( 30 30 'PhabricatorManiphestApplication', ··· 36 36 37 37 $panels[] = $this->newPanel() 38 38 ->setBuiltinKey('tasks') 39 - ->setPanelKey(PhabricatorLinkProfilePanel::PANELKEY) 40 - ->setPanelProperty('icon', 'maniphest') 41 - ->setPanelProperty('name', pht('Open Tasks')) 42 - ->setPanelProperty('uri', $uri); 39 + ->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY) 40 + ->setMenuItemProperty('icon', 'maniphest') 41 + ->setMenuItemProperty('name', pht('Open Tasks')) 42 + ->setMenuItemProperty('uri', $uri); 43 43 } 44 44 45 45 $have_differential = PhabricatorApplication::isClassInstalledForViewer( ··· 52 52 53 53 $panels[] = $this->newPanel() 54 54 ->setBuiltinKey('revisions') 55 - ->setPanelKey(PhabricatorLinkProfilePanel::PANELKEY) 56 - ->setPanelProperty('icon', 'differential') 57 - ->setPanelProperty('name', pht('Revisions')) 58 - ->setPanelProperty('uri', $uri); 55 + ->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY) 56 + ->setMenuItemProperty('icon', 'differential') 57 + ->setMenuItemProperty('name', pht('Revisions')) 58 + ->setMenuItemProperty('uri', $uri); 59 59 } 60 60 61 61 $have_diffusion = PhabricatorApplication::isClassInstalledForViewer( ··· 68 68 69 69 $panels[] = $this->newPanel() 70 70 ->setBuiltinKey('commits') 71 - ->setPanelKey(PhabricatorLinkProfilePanel::PANELKEY) 72 - ->setPanelProperty('icon', 'diffusion') 73 - ->setPanelProperty('name', pht('Commits')) 74 - ->setPanelProperty('uri', $uri); 71 + ->setMenuItemKey(PhabricatorLinkProfilePanel::PANELKEY) 72 + ->setMenuItemProperty('icon', 'diffusion') 73 + ->setMenuItemProperty('name', pht('Commits')) 74 + ->setMenuItemProperty('uri', $uri); 75 75 } 76 76 77 77 $panels[] = $this->newPanel() 78 78 ->setBuiltinKey(self::PANEL_MANAGE) 79 - ->setPanelKey(PhabricatorPeopleManageProfilePanel::PANELKEY); 79 + ->setMenuItemKey(PhabricatorPeopleManageProfilePanel::PANELKEY); 80 80 81 81 return $panels; 82 82 }
+5 -5
src/applications/people/profilepanel/PhabricatorPeopleDetailsProfilePanel.php
··· 14 14 } 15 15 16 16 public function getDisplayName( 17 - PhabricatorProfilePanelConfiguration $config) { 18 - $name = $config->getPanelProperty('name'); 17 + PhabricatorProfileMenuItemConfiguration $config) { 18 + $name = $config->getMenuItemProperty('name'); 19 19 20 20 if (strlen($name)) { 21 21 return $name; ··· 25 25 } 26 26 27 27 public function buildEditEngineFields( 28 - PhabricatorProfilePanelConfiguration $config) { 28 + PhabricatorProfileMenuItemConfiguration $config) { 29 29 return array( 30 30 id(new PhabricatorTextEditField()) 31 31 ->setKey('name') 32 32 ->setLabel(pht('Name')) 33 33 ->setPlaceholder($this->getDefaultName()) 34 - ->setValue($config->getPanelProperty('name')), 34 + ->setValue($config->getMenuProperty('name')), 35 35 ); 36 36 } 37 37 38 38 protected function newNavigationMenuItems( 39 - PhabricatorProfilePanelConfiguration $config) { 39 + PhabricatorProfileMenuItemConfiguration $config) { 40 40 41 41 $user = $config->getProfileObject(); 42 42
+6 -6
src/applications/people/profilepanel/PhabricatorPeopleManageProfilePanel.php
··· 14 14 } 15 15 16 16 public function canHidePanel( 17 - PhabricatorProfilePanelConfiguration $config) { 17 + PhabricatorProfileMenuItemConfiguration $config) { 18 18 return false; 19 19 } 20 20 21 21 public function getDisplayName( 22 - PhabricatorProfilePanelConfiguration $config) { 23 - $name = $config->getPanelProperty('name'); 22 + PhabricatorProfileMenuItemConfiguration $config) { 23 + $name = $config->getMenuItemProperty('name'); 24 24 25 25 if (strlen($name)) { 26 26 return $name; ··· 30 30 } 31 31 32 32 public function buildEditEngineFields( 33 - PhabricatorProfilePanelConfiguration $config) { 33 + PhabricatorProfileMenuItemConfiguration $config) { 34 34 return array( 35 35 id(new PhabricatorTextEditField()) 36 36 ->setKey('name') 37 37 ->setLabel(pht('Name')) 38 38 ->setPlaceholder($this->getDefaultName()) 39 - ->setValue($config->getPanelProperty('name')), 39 + ->setValue($config->getMenuItemProperty('name')), 40 40 ); 41 41 } 42 42 43 43 protected function newNavigationMenuItems( 44 - PhabricatorProfilePanelConfiguration $config) { 44 + PhabricatorProfileMenuItemConfiguration $config) { 45 45 46 46 $user = $config->getProfileObject(); 47 47 $id = $user->getID();
+6 -6
src/applications/project/engine/PhabricatorProjectProfileMenuEngine.php
··· 18 18 19 19 $panels[] = $this->newPanel() 20 20 ->setBuiltinKey(PhabricatorProject::PANEL_PROFILE) 21 - ->setPanelKey(PhabricatorProjectDetailsProfilePanel::PANELKEY); 21 + ->setMenuItemKey(PhabricatorProjectDetailsProfilePanel::PANELKEY); 22 22 23 23 $panels[] = $this->newPanel() 24 24 ->setBuiltinKey(PhabricatorProject::PANEL_POINTS) 25 - ->setPanelKey(PhabricatorProjectPointsProfilePanel::PANELKEY); 25 + ->setMenuItemKey(PhabricatorProjectPointsProfilePanel::PANELKEY); 26 26 27 27 $panels[] = $this->newPanel() 28 28 ->setBuiltinKey(PhabricatorProject::PANEL_WORKBOARD) 29 - ->setPanelKey(PhabricatorProjectWorkboardProfilePanel::PANELKEY); 29 + ->setMenuItemKey(PhabricatorProjectWorkboardProfilePanel::PANELKEY); 30 30 31 31 $panels[] = $this->newPanel() 32 32 ->setBuiltinKey(PhabricatorProject::PANEL_MEMBERS) 33 - ->setPanelKey(PhabricatorProjectMembersProfilePanel::PANELKEY); 33 + ->setMenuItemKey(PhabricatorProjectMembersProfilePanel::PANELKEY); 34 34 35 35 $panels[] = $this->newPanel() 36 36 ->setBuiltinKey(PhabricatorProject::PANEL_SUBPROJECTS) 37 - ->setPanelKey(PhabricatorProjectSubprojectsProfilePanel::PANELKEY); 37 + ->setMenuItemKey(PhabricatorProjectSubprojectsProfilePanel::PANELKEY); 38 38 39 39 $panels[] = $this->newPanel() 40 40 ->setBuiltinKey(PhabricatorProject::PANEL_MANAGE) 41 - ->setPanelKey(PhabricatorProjectManageProfilePanel::PANELKEY); 41 + ->setMenuItemKey(PhabricatorProjectManageProfilePanel::PANELKEY); 42 42 43 43 return $panels; 44 44 }
+6 -6
src/applications/project/profilepanel/PhabricatorProjectDetailsProfilePanel.php
··· 14 14 } 15 15 16 16 public function canMakeDefault( 17 - PhabricatorProfilePanelConfiguration $config) { 17 + PhabricatorProfileMenuItemConfiguration $config) { 18 18 return true; 19 19 } 20 20 21 21 public function getDisplayName( 22 - PhabricatorProfilePanelConfiguration $config) { 23 - $name = $config->getPanelProperty('name'); 22 + PhabricatorProfileMenuItemConfiguration $config) { 23 + $name = $config->getMenuItemProperty('name'); 24 24 25 25 if (strlen($name)) { 26 26 return $name; ··· 30 30 } 31 31 32 32 public function buildEditEngineFields( 33 - PhabricatorProfilePanelConfiguration $config) { 33 + PhabricatorProfileMenuItemConfiguration $config) { 34 34 return array( 35 35 id(new PhabricatorTextEditField()) 36 36 ->setKey('name') 37 37 ->setLabel(pht('Name')) 38 38 ->setPlaceholder($this->getDefaultName()) 39 - ->setValue($config->getPanelProperty('name')), 39 + ->setValue($config->getMenuItemProperty('name')), 40 40 ); 41 41 } 42 42 43 43 protected function newNavigationMenuItems( 44 - PhabricatorProfilePanelConfiguration $config) { 44 + PhabricatorProfileMenuItemConfiguration $config) { 45 45 46 46 $project = $config->getProfileObject(); 47 47
+7 -7
src/applications/project/profilepanel/PhabricatorProjectManageProfilePanel.php
··· 14 14 } 15 15 16 16 public function canHidePanel( 17 - PhabricatorProfilePanelConfiguration $config) { 17 + PhabricatorProfileMenuItemConfiguration $config) { 18 18 return false; 19 19 } 20 20 21 21 public function canMakeDefault( 22 - PhabricatorProfilePanelConfiguration $config) { 22 + PhabricatorProfileMenuItemConfiguration $config) { 23 23 return true; 24 24 } 25 25 26 26 public function getDisplayName( 27 - PhabricatorProfilePanelConfiguration $config) { 28 - $name = $config->getPanelProperty('name'); 27 + PhabricatorProfileMenuItemConfiguration $config) { 28 + $name = $config->getMenuItemProperty('name'); 29 29 30 30 if (strlen($name)) { 31 31 return $name; ··· 35 35 } 36 36 37 37 public function buildEditEngineFields( 38 - PhabricatorProfilePanelConfiguration $config) { 38 + PhabricatorProfileMenuItemConfiguration $config) { 39 39 return array( 40 40 id(new PhabricatorTextEditField()) 41 41 ->setKey('name') 42 42 ->setLabel(pht('Name')) 43 43 ->setPlaceholder($this->getDefaultName()) 44 - ->setValue($config->getPanelProperty('name')), 44 + ->setValue($config->getMenuItemProperty('name')), 45 45 ); 46 46 } 47 47 48 48 protected function newNavigationMenuItems( 49 - PhabricatorProfilePanelConfiguration $config) { 49 + PhabricatorProfileMenuItemConfiguration $config) { 50 50 51 51 $project = $config->getProfileObject(); 52 52
+5 -5
src/applications/project/profilepanel/PhabricatorProjectMembersProfilePanel.php
··· 14 14 } 15 15 16 16 public function getDisplayName( 17 - PhabricatorProfilePanelConfiguration $config) { 18 - $name = $config->getPanelProperty('name'); 17 + PhabricatorProfileMenuItemConfiguration $config) { 18 + $name = $config->getMenuItemProperty('name'); 19 19 20 20 if (strlen($name)) { 21 21 return $name; ··· 25 25 } 26 26 27 27 public function buildEditEngineFields( 28 - PhabricatorProfilePanelConfiguration $config) { 28 + PhabricatorProfileMenuItemConfiguration $config) { 29 29 return array( 30 30 id(new PhabricatorTextEditField()) 31 31 ->setKey('name') 32 32 ->setLabel(pht('Name')) 33 33 ->setPlaceholder($this->getDefaultName()) 34 - ->setValue($config->getPanelProperty('name')), 34 + ->setValue($config->getMenuItemProperty('name')), 35 35 ); 36 36 } 37 37 38 38 protected function newNavigationMenuItems( 39 - PhabricatorProfilePanelConfiguration $config) { 39 + PhabricatorProfileMenuItemConfiguration $config) { 40 40 41 41 $project = $config->getProfileObject(); 42 42
+3 -3
src/applications/project/profilepanel/PhabricatorProjectPointsProfilePanel.php
··· 36 36 } 37 37 38 38 public function getDisplayName( 39 - PhabricatorProfilePanelConfiguration $config) { 39 + PhabricatorProfileMenuItemConfiguration $config) { 40 40 return $this->getDefaultName(); 41 41 } 42 42 43 43 public function buildEditEngineFields( 44 - PhabricatorProfilePanelConfiguration $config) { 44 + PhabricatorProfileMenuItemConfiguration $config) { 45 45 return array( 46 46 id(new PhabricatorInstructionsEditField()) 47 47 ->setValue( ··· 53 53 } 54 54 55 55 protected function newNavigationMenuItems( 56 - PhabricatorProfilePanelConfiguration $config) { 56 + PhabricatorProfileMenuItemConfiguration $config) { 57 57 $viewer = $this->getViewer(); 58 58 $project = $config->getProfileObject(); 59 59
+5 -5
src/applications/project/profilepanel/PhabricatorProjectSubprojectsProfilePanel.php
··· 22 22 } 23 23 24 24 public function getDisplayName( 25 - PhabricatorProfilePanelConfiguration $config) { 26 - $name = $config->getPanelProperty('name'); 25 + PhabricatorProfileMenuItemConfiguration $config) { 26 + $name = $config->getMenuItemProperty('name'); 27 27 28 28 if (strlen($name)) { 29 29 return $name; ··· 33 33 } 34 34 35 35 public function buildEditEngineFields( 36 - PhabricatorProfilePanelConfiguration $config) { 36 + PhabricatorProfileMenuItemConfiguration $config) { 37 37 return array( 38 38 id(new PhabricatorTextEditField()) 39 39 ->setKey('name') 40 40 ->setLabel(pht('Name')) 41 41 ->setPlaceholder($this->getDefaultName()) 42 - ->setValue($config->getPanelProperty('name')), 42 + ->setValue($config->getMenuItemProperty('name')), 43 43 ); 44 44 } 45 45 46 46 protected function newNavigationMenuItems( 47 - PhabricatorProfilePanelConfiguration $config) { 47 + PhabricatorProfileMenuItemConfiguration $config) { 48 48 49 49 $project = $config->getProfileObject(); 50 50
+6 -6
src/applications/project/profilepanel/PhabricatorProjectWorkboardProfilePanel.php
··· 14 14 } 15 15 16 16 public function canMakeDefault( 17 - PhabricatorProfilePanelConfiguration $config) { 17 + PhabricatorProfileMenuItemConfiguration $config) { 18 18 return true; 19 19 } 20 20 ··· 31 31 } 32 32 33 33 public function getDisplayName( 34 - PhabricatorProfilePanelConfiguration $config) { 35 - $name = $config->getPanelProperty('name'); 34 + PhabricatorProfileMenuItemConfiguration $config) { 35 + $name = $config->getMenuItemProperty('name'); 36 36 37 37 if (strlen($name)) { 38 38 return $name; ··· 42 42 } 43 43 44 44 public function buildEditEngineFields( 45 - PhabricatorProfilePanelConfiguration $config) { 45 + PhabricatorProfileMenuItemConfiguration $config) { 46 46 return array( 47 47 id(new PhabricatorTextEditField()) 48 48 ->setKey('name') 49 49 ->setLabel(pht('Name')) 50 50 ->setPlaceholder($this->getDefaultName()) 51 - ->setValue($config->getPanelProperty('name')), 51 + ->setValue($config->getMenuItemProperty('name')), 52 52 ); 53 53 } 54 54 55 55 protected function newNavigationMenuItems( 56 - PhabricatorProfilePanelConfiguration $config) { 56 + PhabricatorProfileMenuItemConfiguration $config) { 57 57 $project = $config->getProfileObject(); 58 58 59 59 $has_workboard = $project->getHasWorkboard();
+3 -3
src/applications/search/editor/PhabricatorProfileMenuEditEngine.php
··· 33 33 } 34 34 35 35 public function setNewPanelConfiguration( 36 - PhabricatorProfilePanelConfiguration $configuration) { 36 + PhabricatorProfileMenuItemConfiguration $configuration) { 37 37 $this->newPanelConfiguration = $configuration; 38 38 return $this; 39 39 } ··· 77 77 } 78 78 79 79 protected function newObjectQuery() { 80 - return id(new PhabricatorProfilePanelConfigurationQuery()); 80 + return id(new PhabricatorProfileMenuItemConfigurationQuery()); 81 81 } 82 82 83 83 protected function getObjectCreateTitleText($object) { ··· 125 125 $fields = $panel->buildEditEngineFields($object); 126 126 127 127 $type_property = 128 - PhabricatorProfilePanelConfigurationTransaction::TYPE_PROPERTY; 128 + PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY; 129 129 130 130 foreach ($fields as $field) { 131 131 $field
+90
src/applications/search/editor/PhabricatorProfileMenuEditor.php
··· 1 + <?php 2 + 3 + final class PhabricatorProfileMenuEditor 4 + extends PhabricatorApplicationTransactionEditor { 5 + 6 + public function getEditorApplicationClass() { 7 + return 'PhabricatorSearchApplication'; 8 + } 9 + 10 + public function getEditorObjectsDescription() { 11 + return pht('Profile Menu Items'); 12 + } 13 + 14 + public function getTransactionTypes() { 15 + $types = parent::getTransactionTypes(); 16 + 17 + $types[] = 18 + PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY; 19 + $types[] = 20 + PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER; 21 + $types[] = 22 + PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY; 23 + 24 + return $types; 25 + } 26 + 27 + protected function getCustomTransactionOldValue( 28 + PhabricatorLiskDAO $object, 29 + PhabricatorApplicationTransaction $xaction) { 30 + 31 + switch ($xaction->getTransactionType()) { 32 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY: 33 + $key = $xaction->getMetadataValue('property.key'); 34 + return $object->getMenuItemProperty($key, null); 35 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER: 36 + return $object->getMenuItemOrder(); 37 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY: 38 + return $object->getVisibility(); 39 + } 40 + } 41 + 42 + protected function getCustomTransactionNewValue( 43 + PhabricatorLiskDAO $object, 44 + PhabricatorApplicationTransaction $xaction) { 45 + 46 + switch ($xaction->getTransactionType()) { 47 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY: 48 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY: 49 + return $xaction->getNewValue(); 50 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER: 51 + return (int)$xaction->getNewValue(); 52 + } 53 + } 54 + 55 + protected function applyCustomInternalTransaction( 56 + PhabricatorLiskDAO $object, 57 + PhabricatorApplicationTransaction $xaction) { 58 + 59 + switch ($xaction->getTransactionType()) { 60 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY: 61 + $key = $xaction->getMetadataValue('property.key'); 62 + $value = $xaction->getNewValue(); 63 + $object->getMenuItemProperty($key, $value); 64 + return; 65 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER: 66 + $object->setMenuItemOrder($xaction->getNewValue()); 67 + return; 68 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY: 69 + $object->setVisibility($xaction->getNewValue()); 70 + return; 71 + } 72 + 73 + return parent::applyCustomInternalTransaction($object, $xaction); 74 + } 75 + 76 + protected function applyCustomExternalTransaction( 77 + PhabricatorLiskDAO $object, 78 + PhabricatorApplicationTransaction $xaction) { 79 + 80 + switch ($xaction->getTransactionType()) { 81 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY: 82 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER: 83 + case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY: 84 + return; 85 + } 86 + 87 + return parent::applyCustomExternalTransaction($object, $xaction); 88 + } 89 + 90 + }
-87
src/applications/search/editor/PhabricatorProfilePanelEditor.php
··· 1 - <?php 2 - 3 - final class PhabricatorProfilePanelEditor 4 - extends PhabricatorApplicationTransactionEditor { 5 - 6 - public function getEditorApplicationClass() { 7 - return 'PhabricatorSearchApplication'; 8 - } 9 - 10 - public function getEditorObjectsDescription() { 11 - return pht('Profile Panels'); 12 - } 13 - 14 - public function getTransactionTypes() { 15 - $types = parent::getTransactionTypes(); 16 - 17 - $types[] = PhabricatorProfilePanelConfigurationTransaction::TYPE_PROPERTY; 18 - $types[] = PhabricatorProfilePanelConfigurationTransaction::TYPE_ORDER; 19 - $types[] = PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY; 20 - 21 - return $types; 22 - } 23 - 24 - protected function getCustomTransactionOldValue( 25 - PhabricatorLiskDAO $object, 26 - PhabricatorApplicationTransaction $xaction) { 27 - 28 - switch ($xaction->getTransactionType()) { 29 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_PROPERTY: 30 - $key = $xaction->getMetadataValue('property.key'); 31 - return $object->getPanelProperty($key, null); 32 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_ORDER: 33 - return $object->getPanelOrder(); 34 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY: 35 - return $object->getVisibility(); 36 - } 37 - } 38 - 39 - protected function getCustomTransactionNewValue( 40 - PhabricatorLiskDAO $object, 41 - PhabricatorApplicationTransaction $xaction) { 42 - 43 - switch ($xaction->getTransactionType()) { 44 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_PROPERTY: 45 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY: 46 - return $xaction->getNewValue(); 47 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_ORDER: 48 - return (int)$xaction->getNewValue(); 49 - } 50 - } 51 - 52 - protected function applyCustomInternalTransaction( 53 - PhabricatorLiskDAO $object, 54 - PhabricatorApplicationTransaction $xaction) { 55 - 56 - switch ($xaction->getTransactionType()) { 57 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_PROPERTY: 58 - $key = $xaction->getMetadataValue('property.key'); 59 - $value = $xaction->getNewValue(); 60 - $object->setPanelProperty($key, $value); 61 - return; 62 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_ORDER: 63 - $object->setPanelOrder($xaction->getNewValue()); 64 - return; 65 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY: 66 - $object->setVisibility($xaction->getNewValue()); 67 - return; 68 - } 69 - 70 - return parent::applyCustomInternalTransaction($object, $xaction); 71 - } 72 - 73 - protected function applyCustomExternalTransaction( 74 - PhabricatorLiskDAO $object, 75 - PhabricatorApplicationTransaction $xaction) { 76 - 77 - switch ($xaction->getTransactionType()) { 78 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_PROPERTY: 79 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_ORDER: 80 - case PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY: 81 - return; 82 - } 83 - 84 - return parent::applyCustomExternalTransaction($object, $xaction); 85 - } 86 - 87 - }
+30 -28
src/applications/search/engine/PhabricatorProfileMenuEngine.php
··· 37 37 } 38 38 39 39 private function setDefaultPanel( 40 - PhabricatorProfilePanelConfiguration $default_panel) { 40 + PhabricatorProfileMenuItemConfiguration $default_panel) { 41 41 $this->defaultPanel = $default_panel; 42 42 return $this; 43 43 } ··· 231 231 232 232 $panels = $this->loadBuiltinProfilePanels(); 233 233 234 - $stored_panels = id(new PhabricatorProfilePanelConfigurationQuery()) 234 + $stored_panels = id(new PhabricatorProfileMenuItemConfigurationQuery()) 235 235 ->setViewer($viewer) 236 236 ->withProfilePHIDs(array($object->getPHID())) 237 237 ->execute(); ··· 327 327 $builtin_key)); 328 328 } 329 329 330 - $panel_key = $builtin->getPanelKey(); 330 + $panel_key = $builtin->getMenuItemKey(); 331 331 332 332 $panel = idx($panels, $panel_key); 333 333 if (!$panel) { ··· 346 346 ->setProfilePHID($object->getPHID()) 347 347 ->attachPanel($panel) 348 348 ->attachProfileObject($object) 349 - ->setPanelOrder($order); 349 + ->setMenuItemOrder($order); 350 350 351 351 if (!$builtin->shouldEnableForObject($object)) { 352 352 continue; ··· 488 488 $panels = array_select_keys($panels, $key_order) + $panels; 489 489 490 490 $type_order = 491 - PhabricatorProfilePanelConfigurationTransaction::TYPE_ORDER; 491 + PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER; 492 492 493 493 $order = 1; 494 494 foreach ($panels as $panel) { 495 495 $xactions = array(); 496 496 497 - $xactions[] = id(new PhabricatorProfilePanelConfigurationTransaction()) 497 + $xactions[] = id(new PhabricatorProfileMenuItemConfigurationTransaction()) 498 498 ->setTransactionType($type_order) 499 499 ->setNewValue($order); 500 500 501 - $editor = id(new PhabricatorProfilePanelEditor()) 501 + $editor = id(new PhabricatorProfileMenuEditor()) 502 502 ->setContentSourceFromRequest($request) 503 503 ->setActor($viewer) 504 504 ->setContinueOnMissingFields(true) ··· 607 607 $hide_text = pht('Delete'); 608 608 } 609 609 610 - $can_disable = $panel->canHidePanel(); 610 + $can_disable = $panel->canHideMenuItem(); 611 611 612 612 $item->addAction( 613 613 id(new PHUIListItemView()) ··· 695 695 } 696 696 697 697 $configuration = 698 - PhabricatorProfilePanelConfiguration::initializeNewPanelConfiguration( 698 + PhabricatorProfileMenuItemConfiguration::initializeNewPanelConfiguration( 699 699 $object, 700 700 $panel_type); 701 701 ··· 729 729 } 730 730 731 731 private function buildPanelBuiltinContent( 732 - PhabricatorProfilePanelConfiguration $configuration) { 732 + PhabricatorProfileMenuItemConfiguration $configuration) { 733 733 734 734 // If this builtin panel has already been persisted, redirect to the 735 735 // edit page. ··· 761 761 } 762 762 763 763 private function buildPanelHideContent( 764 - PhabricatorProfilePanelConfiguration $configuration) { 764 + PhabricatorProfileMenuItemConfiguration $configuration) { 765 765 766 766 $controller = $this->getController(); 767 767 $request = $controller->getRequest(); ··· 772 772 $configuration, 773 773 PhabricatorPolicyCapability::CAN_EDIT); 774 774 775 - if (!$configuration->canHidePanel()) { 775 + if (!$configuration->canHideMenuItem()) { 776 776 return $controller->newDialog() 777 777 ->setTitle(pht('Mandatory Panel')) 778 778 ->appendParagraph( ··· 787 787 $body = pht('Delete this menu item?'); 788 788 $button = pht('Delete Menu Item'); 789 789 } else if ($configuration->isDisabled()) { 790 - $new_value = PhabricatorProfilePanelConfiguration::VISIBILITY_VISIBLE; 790 + $new_value = PhabricatorProfileMenuItemConfiguration::VISIBILITY_VISIBLE; 791 791 792 792 $title = pht('Enable Menu Item'); 793 793 $body = pht( 794 794 'Enable this menu item? It will appear in the menu again.'); 795 795 $button = pht('Enable Menu Item'); 796 796 } else { 797 - $new_value = PhabricatorProfilePanelConfiguration::VISIBILITY_DISABLED; 797 + $new_value = PhabricatorProfileMenuItemConfiguration::VISIBILITY_DISABLED; 798 798 799 799 $title = pht('Disable Menu Item'); 800 800 $body = pht( ··· 809 809 $configuration->delete(); 810 810 } else { 811 811 $type_visibility = 812 - PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY; 812 + PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY; 813 813 814 814 $xactions = array(); 815 815 816 - $xactions[] = id(new PhabricatorProfilePanelConfigurationTransaction()) 817 - ->setTransactionType($type_visibility) 818 - ->setNewValue($new_value); 816 + $xactions[] = 817 + id(new PhabricatorProfileMenuItemConfigurationTransaction()) 818 + ->setTransactionType($type_visibility) 819 + ->setNewValue($new_value); 819 820 820 - $editor = id(new PhabricatorProfilePanelEditor()) 821 + $editor = id(new PhabricatorProfileMenuEditor()) 821 822 ->setContentSourceFromRequest($request) 822 823 ->setActor($viewer) 823 824 ->setContinueOnMissingFields(true) ··· 837 838 } 838 839 839 840 private function buildPanelDefaultContent( 840 - PhabricatorProfilePanelConfiguration $configuration, 841 + PhabricatorProfileMenuItemConfiguration $configuration, 841 842 array $panels) { 842 843 843 844 $controller = $this->getController(); ··· 894 895 } 895 896 896 897 protected function newPanel() { 897 - return PhabricatorProfilePanelConfiguration::initializeNewBuiltin(); 898 + return PhabricatorProfileMenuItemConfiguration::initializeNewBuiltin(); 898 899 } 899 900 900 901 public function adjustDefault($key) { ··· 931 932 } 932 933 933 934 $type_visibility = 934 - PhabricatorProfilePanelConfigurationTransaction::TYPE_VISIBILITY; 935 + PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY; 935 936 936 - $v_visible = PhabricatorProfilePanelConfiguration::VISIBILITY_VISIBLE; 937 - $v_default = PhabricatorProfilePanelConfiguration::VISIBILITY_DEFAULT; 937 + $v_visible = PhabricatorProfileMenuItemConfiguration::VISIBILITY_VISIBLE; 938 + $v_default = PhabricatorProfileMenuItemConfiguration::VISIBILITY_DEFAULT; 938 939 939 940 $apply = array( 940 941 array($v_visible, $visible), ··· 946 947 foreach ($panels as $panel) { 947 948 $xactions = array(); 948 949 949 - $xactions[] = id(new PhabricatorProfilePanelConfigurationTransaction()) 950 - ->setTransactionType($type_visibility) 951 - ->setNewValue($value); 950 + $xactions[] = 951 + id(new PhabricatorProfileMenuItemConfigurationTransaction()) 952 + ->setTransactionType($type_visibility) 953 + ->setNewValue($value); 952 954 953 - $editor = id(new PhabricatorProfilePanelEditor()) 955 + $editor = id(new PhabricatorProfileMenuEditor()) 954 956 ->setContentSourceFromRequest($request) 955 957 ->setActor($viewer) 956 958 ->setContinueOnMissingFields(true)
+5 -5
src/applications/search/phidtype/PhabricatorProfilePanelPHIDType.php src/applications/search/phidtype/PhabricatorProfileMenuItemPHIDType.php
··· 1 1 <?php 2 2 3 - final class PhabricatorProfilePanelPHIDType 3 + final class PhabricatorProfileMenuItemPHIDType 4 4 extends PhabricatorPHIDType { 5 5 6 6 const TYPECONST = 'PANL'; 7 7 8 8 public function getTypeName() { 9 - return pht('Profile Panel'); 9 + return pht('Profile Menu Item'); 10 10 } 11 11 12 12 public function newObject() { 13 - return new PhabricatorProfilePanelConfiguration(); 13 + return new PhabricatorProfileMenuItemConfiguration(); 14 14 } 15 15 16 16 public function getPHIDTypeApplicationClass() { ··· 20 20 protected function buildQueryForObjects( 21 21 PhabricatorObjectQuery $object_query, 22 22 array $phids) { 23 - return id(new PhabricatorProfilePanelConfigurationQuery()) 23 + return id(new PhabricatorProfileMenuItemConfigurationQuery()) 24 24 ->withPHIDs($phids); 25 25 } 26 26 ··· 32 32 foreach ($handles as $phid => $handle) { 33 33 $config = $objects[$phid]; 34 34 35 - $handle->setName(pht('Profile Panel')); 35 + $handle->setName(pht('Profile Menu Item')); 36 36 } 37 37 } 38 38
+6 -6
src/applications/search/profilepanel/PhabricatorApplicationProfilePanel.php
··· 18 18 } 19 19 20 20 public function getDisplayName( 21 - PhabricatorProfilePanelConfiguration $config) { 21 + PhabricatorProfileMenuItemConfiguration $config) { 22 22 $app = $this->getApplication($config); 23 23 if ($app) { 24 24 return $app->getName(); ··· 29 29 } 30 30 31 31 public function buildEditEngineFields( 32 - PhabricatorProfilePanelConfiguration $config) { 32 + PhabricatorProfileMenuItemConfiguration $config) { 33 33 return array( 34 34 id(new PhabricatorDatasourceEditField()) 35 35 ->setKey('application') 36 36 ->setLabel(pht('Application')) 37 37 ->setDatasource(new PhabricatorApplicationDatasource()) 38 - ->setSingleValue($config->getPanelProperty('application')), 38 + ->setSingleValue($config->getMenuItemProperty('application')), 39 39 ); 40 40 } 41 41 42 42 private function getApplication( 43 - PhabricatorProfilePanelConfiguration $config) { 43 + PhabricatorProfileMenuItemConfiguration $config) { 44 44 $viewer = $this->getViewer(); 45 - $phid = $config->getPanelProperty('application'); 45 + $phid = $config->getMenuItemProperty('application'); 46 46 $app = id(new PhabricatorApplicationQuery()) 47 47 ->setViewer($viewer) 48 48 ->withPHIDs(array($phid)) ··· 52 52 } 53 53 54 54 protected function newNavigationMenuItems( 55 - PhabricatorProfilePanelConfiguration $config) { 55 + PhabricatorProfileMenuItemConfiguration $config) { 56 56 $viewer = $this->getViewer(); 57 57 $app = $this->getApplication($config); 58 58 if (!$app) {
+3 -3
src/applications/search/profilepanel/PhabricatorDividerProfilePanel.php
··· 18 18 } 19 19 20 20 public function getDisplayName( 21 - PhabricatorProfilePanelConfiguration $config) { 21 + PhabricatorProfileMenuItemConfiguration $config) { 22 22 return pht("\xE2\x80\x94"); 23 23 } 24 24 25 25 public function buildEditEngineFields( 26 - PhabricatorProfilePanelConfiguration $config) { 26 + PhabricatorProfileMenuItemConfiguration $config) { 27 27 return array( 28 28 id(new PhabricatorInstructionsEditField()) 29 29 ->setValue( ··· 35 35 } 36 36 37 37 protected function newNavigationMenuItems( 38 - PhabricatorProfilePanelConfiguration $config) { 38 + PhabricatorProfileMenuItemConfiguration $config) { 39 39 40 40 $item = $this->newItem() 41 41 ->addClass('phui-divider');
+9 -9
src/applications/search/profilepanel/PhabricatorLinkProfilePanel.php
··· 18 18 } 19 19 20 20 public function getDisplayName( 21 - PhabricatorProfilePanelConfiguration $config) { 21 + PhabricatorProfileMenuItemConfiguration $config) { 22 22 return $this->getLinkName($config); 23 23 } 24 24 25 25 public function buildEditEngineFields( 26 - PhabricatorProfilePanelConfiguration $config) { 26 + PhabricatorProfileMenuItemConfiguration $config) { 27 27 return array( 28 28 id(new PhabricatorTextEditField()) 29 29 ->setKey('name') ··· 44 44 } 45 45 46 46 private function getLinkName( 47 - PhabricatorProfilePanelConfiguration $config) { 48 - return $config->getPanelProperty('name'); 47 + PhabricatorProfileMenuItemConfiguration $config) { 48 + return $config->getMenuItemProperty('name'); 49 49 } 50 50 51 51 private function getLinkIcon( 52 - PhabricatorProfilePanelConfiguration $config) { 53 - return $config->getPanelProperty('icon', 'link'); 52 + PhabricatorProfileMenuItemConfiguration $config) { 53 + return $config->getMenuItemProperty('icon', 'link'); 54 54 } 55 55 56 56 private function getLinkURI( 57 - PhabricatorProfilePanelConfiguration $config) { 58 - return $config->getPanelProperty('uri'); 57 + PhabricatorProfileMenuItemConfiguration $config) { 58 + return $config->getMenuItemProperty('uri'); 59 59 } 60 60 61 61 private function isValidLinkURI($uri) { ··· 63 63 } 64 64 65 65 protected function newNavigationMenuItems( 66 - PhabricatorProfilePanelConfiguration $config) { 66 + PhabricatorProfileMenuItemConfiguration $config) { 67 67 68 68 $icon = $this->getLinkIcon($config); 69 69 $name = $this->getLinkName($config);
+5 -5
src/applications/search/profilepanel/PhabricatorMotivatorProfilePanel.php
··· 18 18 } 19 19 20 20 public function getDisplayName( 21 - PhabricatorProfilePanelConfiguration $config) { 21 + PhabricatorProfileMenuItemConfiguration $config) { 22 22 23 23 $options = $this->getOptions(); 24 - $name = idx($options, $config->getPanelProperty('source')); 24 + $name = idx($options, $config->getMenuItemProperty('source')); 25 25 if ($name !== null) { 26 26 return pht('Motivator: %s', $name); 27 27 } else { ··· 30 30 } 31 31 32 32 public function buildEditEngineFields( 33 - PhabricatorProfilePanelConfiguration $config) { 33 + PhabricatorProfileMenuItemConfiguration $config) { 34 34 return array( 35 35 id(new PhabricatorInstructionsEditField()) 36 36 ->setValue( ··· 51 51 } 52 52 53 53 protected function newNavigationMenuItems( 54 - PhabricatorProfilePanelConfiguration $config) { 54 + PhabricatorProfileMenuItemConfiguration $config) { 55 55 56 - $source = $config->getPanelProperty('source'); 56 + $source = $config->getMenuItemProperty('source'); 57 57 58 58 switch ($source) { 59 59 case 'catfacts':
+6 -6
src/applications/search/profilepanel/PhabricatorProfilePanel.php
··· 5 5 private $viewer; 6 6 7 7 final public function buildNavigationMenuItems( 8 - PhabricatorProfilePanelConfiguration $config) { 8 + PhabricatorProfileMenuItemConfiguration $config) { 9 9 return $this->newNavigationMenuItems($config); 10 10 } 11 11 12 12 abstract protected function newNavigationMenuItems( 13 - PhabricatorProfilePanelConfiguration $config); 13 + PhabricatorProfileMenuItemConfiguration $config); 14 14 15 15 public function getPanelTypeIcon() { 16 16 return null; ··· 19 19 abstract public function getPanelTypeName(); 20 20 21 21 abstract public function getDisplayName( 22 - PhabricatorProfilePanelConfiguration $config); 22 + PhabricatorProfileMenuItemConfiguration $config); 23 23 24 24 public function buildEditEngineFields( 25 - PhabricatorProfilePanelConfiguration $config) { 25 + PhabricatorProfileMenuItemConfiguration $config) { 26 26 return array(); 27 27 } 28 28 ··· 35 35 } 36 36 37 37 public function canHidePanel( 38 - PhabricatorProfilePanelConfiguration $config) { 38 + PhabricatorProfileMenuItemConfiguration $config) { 39 39 return true; 40 40 } 41 41 42 42 public function canMakeDefault( 43 - PhabricatorProfilePanelConfiguration $config) { 43 + PhabricatorProfileMenuItemConfiguration $config) { 44 44 return false; 45 45 } 46 46
+10
src/applications/search/query/PhabricatorProfileMenuItemConfigurationTransactionQuery.php
··· 1 + <?php 2 + 3 + final class PhabricatorProfileMenuItemConfigurationTransactionQuery 4 + extends PhabricatorApplicationTransactionQuery { 5 + 6 + public function getTemplateApplicationTransaction() { 7 + return new PhabricatorProfileMenuItemConfigurationTransaction(); 8 + } 9 + 10 + }
+3 -3
src/applications/search/query/PhabricatorProfilePanelConfigurationQuery.php src/applications/search/query/PhabricatorProfileMenuItemConfigurationQuery.php
··· 1 1 <?php 2 2 3 - final class PhabricatorProfilePanelConfigurationQuery 3 + final class PhabricatorProfileMenuItemConfigurationQuery 4 4 extends PhabricatorCursorPagedPolicyAwareQuery { 5 5 6 6 private $ids; ··· 23 23 } 24 24 25 25 public function newResultObject() { 26 - return new PhabricatorProfilePanelConfiguration(); 26 + return new PhabricatorProfileMenuItemConfiguration(); 27 27 } 28 28 29 29 protected function loadPage() { ··· 60 60 protected function willFilterPage(array $page) { 61 61 $panels = PhabricatorProfilePanel::getAllPanels(); 62 62 foreach ($page as $key => $panel) { 63 - $panel_type = idx($panels, $panel->getPanelKey()); 63 + $panel_type = idx($panels, $panel->getMenuItemKey()); 64 64 if (!$panel_type) { 65 65 $this->didRejectResult($panel); 66 66 unset($page[$key]);
-10
src/applications/search/query/PhabricatorProfilePanelConfigurationTransactionQuery.php
··· 1 - <?php 2 - 3 - final class PhabricatorProfilePanelConfigurationTransactionQuery 4 - extends PhabricatorApplicationTransactionQuery { 5 - 6 - public function getTemplateApplicationTransaction() { 7 - return new PhabricatorProfilePanelConfigurationTransaction(); 8 - } 9 - 10 - }
+27
src/applications/search/storage/PhabricatorProfileMenuItemConfigurationTransaction.php
··· 1 + <?php 2 + 3 + final class PhabricatorProfileMenuItemConfigurationTransaction 4 + extends PhabricatorApplicationTransaction { 5 + 6 + const TYPE_PROPERTY = 'profilepanel.property'; 7 + const TYPE_ORDER = 'profilepanel.order'; 8 + const TYPE_VISIBILITY = 'profilepanel.visibility'; 9 + 10 + public function getApplicationName() { 11 + return 'search'; 12 + } 13 + 14 + public function getTableName() { 15 + // At least for now, this object uses an older table name. 16 + return 'search_profilepanelconfigurationtransaction'; 17 + } 18 + 19 + public function getApplicationTransactionType() { 20 + return PhabricatorProfileMenuItemPHIDType::TYPECONST; 21 + } 22 + 23 + public function getApplicationTransactionCommentObject() { 24 + return null; 25 + } 26 + 27 + }
+24 -19
src/applications/search/storage/PhabricatorProfilePanelConfiguration.php src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php
··· 1 1 <?php 2 2 3 - final class PhabricatorProfilePanelConfiguration 3 + final class PhabricatorProfileMenuItemConfiguration 4 4 extends PhabricatorSearchDAO 5 5 implements 6 6 PhabricatorPolicyInterface, ··· 8 8 PhabricatorApplicationTransactionInterface { 9 9 10 10 protected $profilePHID; 11 - protected $panelKey; 11 + protected $menuItemKey; 12 12 protected $builtinKey; 13 - protected $panelOrder; 13 + protected $menuItemOrder; 14 14 protected $visibility; 15 - protected $panelProperties = array(); 15 + protected $menuItemProperties = array(); 16 16 17 17 private $profileObject = self::ATTACHABLE; 18 18 private $panel = self::ATTACHABLE; ··· 21 21 const VISIBILITY_VISIBLE = 'visible'; 22 22 const VISIBILITY_DISABLED = 'disabled'; 23 23 24 + public function getTableName() { 25 + // For now, this class uses an older table name. 26 + return 'search_profilepanelconfiguration'; 27 + } 28 + 24 29 public static function initializeNewBuiltin() { 25 30 return id(new self()) 26 31 ->setVisibility(self::VISIBILITY_VISIBLE); ··· 32 37 33 38 return self::initializeNewBuiltin() 34 39 ->setProfilePHID($profile_object->getPHID()) 35 - ->setPanelKey($panel->getPanelKey()) 40 + ->setMenuItemKey($panel->getPanelKey()) 36 41 ->attachPanel($panel) 37 42 ->attachProfileObject($profile_object); 38 43 } ··· 41 46 return array( 42 47 self::CONFIG_AUX_PHID => true, 43 48 self::CONFIG_SERIALIZATION => array( 44 - 'panelProperties' => self::SERIALIZATION_JSON, 49 + 'menuItemProperties' => self::SERIALIZATION_JSON, 45 50 ), 46 51 self::CONFIG_COLUMN_SCHEMA => array( 47 - 'panelKey' => 'text64', 52 + 'menuItemKey' => 'text64', 48 53 'builtinKey' => 'text64?', 49 - 'panelOrder' => 'uint32?', 54 + 'menuItemOrder' => 'uint32?', 50 55 'visibility' => 'text32', 51 56 ), 52 57 self::CONFIG_KEY_SCHEMA => array( 53 58 'key_profile' => array( 54 - 'columns' => array('profilePHID', 'panelOrder'), 59 + 'columns' => array('profilePHID', 'menuItemOrder'), 55 60 ), 56 61 ), 57 62 ) + parent::getConfiguration(); ··· 59 64 60 65 public function generatePHID() { 61 66 return PhabricatorPHID::generateNewPHID( 62 - PhabricatorProfilePanelPHIDType::TYPECONST); 67 + PhabricatorProfileMenuItemPHIDType::TYPECONST); 63 68 } 64 69 65 70 public function attachPanel(PhabricatorProfilePanel $panel) { ··· 80 85 return $this->assertAttached($this->profileObject); 81 86 } 82 87 83 - public function setPanelProperty($key, $value) { 84 - $this->panelProperties[$key] = $value; 88 + public function setMenuItemProperty($key, $value) { 89 + $this->menuItemProperties[$key] = $value; 85 90 return $this; 86 91 } 87 92 88 - public function getPanelProperty($key, $default = null) { 89 - return idx($this->panelProperties, $key, $default); 93 + public function getMenuItemProperty($key, $default = null) { 94 + return idx($this->menuItemProperties, $key, $default); 90 95 } 91 96 92 97 public function buildNavigationMenuItems() { ··· 105 110 return $this->getPanel()->canMakeDefault($this); 106 111 } 107 112 108 - public function canHidePanel() { 113 + public function canHideMenuItem() { 109 114 return $this->getPanel()->canHidePanel($this); 110 115 } 111 116 ··· 114 119 } 115 120 116 121 public function getSortKey() { 117 - $order = $this->getPanelOrder(); 122 + $order = $this->getMenuItemOrder(); 118 123 if ($order === null) { 119 124 $order = 'Z'; 120 125 } else { ··· 128 133 } 129 134 130 135 public function isDisabled() { 131 - if (!$this->canHidePanel()) { 136 + if (!$this->canHideMenuItem()) { 132 137 return false; 133 138 } 134 139 return ($this->getVisibility() === self::VISIBILITY_DISABLED); ··· 179 184 180 185 181 186 public function getApplicationTransactionEditor() { 182 - return new PhabricatorProfilePanelEditor(); 187 + return new PhabricatorProfileMenuEditor(); 183 188 } 184 189 185 190 public function getApplicationTransactionObject() { ··· 187 192 } 188 193 189 194 public function getApplicationTransactionTemplate() { 190 - return new PhabricatorProfilePanelConfigurationTransaction(); 195 + return new PhabricatorProfileMenuItemConfigurationTransaction(); 191 196 } 192 197 193 198 public function willRenderTimeline(
-22
src/applications/search/storage/PhabricatorProfilePanelConfigurationTransaction.php
··· 1 - <?php 2 - 3 - final class PhabricatorProfilePanelConfigurationTransaction 4 - extends PhabricatorApplicationTransaction { 5 - 6 - const TYPE_PROPERTY = 'profilepanel.property'; 7 - const TYPE_ORDER = 'profilepanel.order'; 8 - const TYPE_VISIBILITY = 'profilepanel.visibility'; 9 - 10 - public function getApplicationName() { 11 - return 'search'; 12 - } 13 - 14 - public function getApplicationTransactionType() { 15 - return PhabricatorProfilePanelPHIDType::TYPECONST; 16 - } 17 - 18 - public function getApplicationTransactionCommentObject() { 19 - return null; 20 - } 21 - 22 - }
+1 -1
src/applications/search/storage/PhabricatorSearchSchemaSpec.php
··· 4 4 extends PhabricatorConfigSchemaSpec { 5 5 6 6 public function buildSchemata() { 7 - $this->buildEdgeSchemata(new PhabricatorProfilePanelConfiguration()); 7 + $this->buildEdgeSchemata(new PhabricatorProfileMenuItemConfiguration()); 8 8 9 9 $this->buildRawSchema( 10 10 'search',
+2 -2
src/applications/settings/controller/PhabricatorSettingsMainController.php
··· 98 98 $panels = $this->buildPanels($preferences); 99 99 $nav = $this->renderSideNav($panels); 100 100 101 - $key = $nav->selectFilter($key, head($panels)->getPanelKey()); 101 + $key = $nav->selectFilter($key, head($panels)->getMenuItemKey()); 102 102 103 103 $panel = $panels[$key] 104 104 ->setController($this) ··· 196 196 $nav->addLabel($group->getPanelGroupName()); 197 197 } 198 198 199 - $nav->addFilter($panel->getPanelKey(), $panel->getPanelName()); 199 + $nav->addFilter($panel->getMenuItemKey(), $panel->getPanelName()); 200 200 } 201 201 202 202 return $nav;