2016-01-12 19:27:39 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PhabricatorProfilePanel extends Phobject {
|
|
|
|
|
|
|
|
private $viewer;
|
|
|
|
|
|
|
|
final public function buildNavigationMenuItems(
|
|
|
|
PhabricatorProfilePanelConfiguration $config) {
|
|
|
|
return $this->newNavigationMenuItems($config);
|
|
|
|
}
|
|
|
|
|
|
|
|
abstract protected function newNavigationMenuItems(
|
|
|
|
PhabricatorProfilePanelConfiguration $config);
|
|
|
|
|
2016-01-13 00:06:43 +01:00
|
|
|
public function getPanelTypeIcon() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
abstract public function getPanelTypeName();
|
|
|
|
|
|
|
|
abstract public function getDisplayName(
|
|
|
|
PhabricatorProfilePanelConfiguration $config);
|
|
|
|
|
|
|
|
public function buildEditEngineFields(
|
|
|
|
PhabricatorProfilePanelConfiguration $config) {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
2016-01-14 14:59:25 +01:00
|
|
|
public function canAddToObject($object) {
|
2016-01-13 00:06:43 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-01-25 12:21:36 +01:00
|
|
|
public function canHidePanel(
|
|
|
|
PhabricatorProfilePanelConfiguration $config) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-01-22 14:33:21 +01:00
|
|
|
public function canMakeDefault(
|
|
|
|
PhabricatorProfilePanelConfiguration $config) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-01-12 19:27:39 +01:00
|
|
|
public function setViewer(PhabricatorUser $viewer) {
|
|
|
|
$this->viewer = $viewer;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getViewer() {
|
|
|
|
return $this->viewer;
|
|
|
|
}
|
|
|
|
|
|
|
|
final public function getPanelKey() {
|
|
|
|
return $this->getPhobjectClassConstant('PANELKEY');
|
|
|
|
}
|
|
|
|
|
|
|
|
final public static function getAllPanels() {
|
|
|
|
return id(new PhutilClassMapQuery())
|
|
|
|
->setAncestorClass(__CLASS__)
|
|
|
|
->setUniqueMethod('getPanelKey')
|
|
|
|
->execute();
|
|
|
|
}
|
|
|
|
|
2016-01-14 01:07:04 +01:00
|
|
|
protected function newItem() {
|
|
|
|
return new PHUIListItemView();
|
|
|
|
}
|
|
|
|
|
2016-01-12 19:27:39 +01:00
|
|
|
}
|