3 abstract class PhabricatorApplicationConfigurationPanel
9 public function setViewer(PhabricatorUser
$viewer) {
10 $this->viewer
= $viewer;
14 public function getViewer() {
18 public function setApplication(PhabricatorApplication
$application) {
19 $this->application
= $application;
23 public function getApplication() {
24 return $this->application
;
27 public function getPanelURI($path = null) {
28 $app_key = get_class($this->getApplication());
29 $panel_key = $this->getPanelKey();
30 $base = "/applications/panel/{$app_key}/{$panel_key}/";
31 return $base.ltrim($path, '/');
35 * Return a short, unique string key which identifies this panel.
37 * This key is used in URIs. Good values might be "email" or "files".
39 abstract public function getPanelKey();
41 abstract public function shouldShowForApplication(
42 PhabricatorApplication
$application);
44 abstract public function buildConfigurationPagePanel();
45 abstract public function handlePanelRequest(
46 AphrontRequest
$request,
47 PhabricatorController
$controller);
49 public static function loadAllPanels() {
50 return id(new PhutilClassMapQuery())
51 ->setAncestorClass(__CLASS__
)
52 ->setUniqueMethod('getPanelKey')
56 public static function loadAllPanelsForApplication(
57 PhabricatorApplication
$application) {
58 $panels = self
::loadAllPanels();
60 $application_panels = array();
61 foreach ($panels as $key => $panel) {
62 if (!$panel->shouldShowForApplication($application)) {
65 $application_panels[$key] = $panel;
68 return $application_panels;