mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 03:42:41 +01:00
42896f9f90
Summary: Ref T11957. Test Plan: - Viewed an existing project profile. - Viewed a user profile. - Created a new project. - Edited a profile menu. - Added new profile items. - Grepped for renamed symbols. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11957 Differential Revision: https://secure.phabricator.com/D17028
71 lines
1.6 KiB
PHP
71 lines
1.6 KiB
PHP
<?php
|
|
|
|
abstract class PhabricatorProfileMenuItem extends Phobject {
|
|
|
|
private $viewer;
|
|
|
|
final public function buildNavigationMenuItems(
|
|
PhabricatorProfileMenuItemConfiguration $config) {
|
|
return $this->newNavigationMenuItems($config);
|
|
}
|
|
|
|
abstract protected function newNavigationMenuItems(
|
|
PhabricatorProfileMenuItemConfiguration $config);
|
|
|
|
public function getMenuItemTypeIcon() {
|
|
return null;
|
|
}
|
|
|
|
abstract public function getMenuItemTypeName();
|
|
|
|
abstract public function getDisplayName(
|
|
PhabricatorProfileMenuItemConfiguration $config);
|
|
|
|
public function buildEditEngineFields(
|
|
PhabricatorProfileMenuItemConfiguration $config) {
|
|
return array();
|
|
}
|
|
|
|
public function canAddToObject($object) {
|
|
return false;
|
|
}
|
|
|
|
public function shouldEnableForObject($object) {
|
|
return true;
|
|
}
|
|
|
|
public function canHideMenuItem(
|
|
PhabricatorProfileMenuItemConfiguration $config) {
|
|
return true;
|
|
}
|
|
|
|
public function canMakeDefault(
|
|
PhabricatorProfileMenuItemConfiguration $config) {
|
|
return false;
|
|
}
|
|
|
|
public function setViewer(PhabricatorUser $viewer) {
|
|
$this->viewer = $viewer;
|
|
return $this;
|
|
}
|
|
|
|
public function getViewer() {
|
|
return $this->viewer;
|
|
}
|
|
|
|
final public function getMenuItemKey() {
|
|
return $this->getPhobjectClassConstant('MENUITEMKEY');
|
|
}
|
|
|
|
final public static function getAllMenuItems() {
|
|
return id(new PhutilClassMapQuery())
|
|
->setAncestorClass(__CLASS__)
|
|
->setUniqueMethod('getMenuItemKey')
|
|
->execute();
|
|
}
|
|
|
|
protected function newItem() {
|
|
return new PHUIListItemView();
|
|
}
|
|
|
|
}
|