Page MenuHomePhabricator
Diviner Phabricator Tech Docs PhabricatorSettingsPanel

abstract class PhabricatorSettingsPanel
Phabricator Technical Documentation (Settings)

Defines a settings panel. Settings panels appear in the Settings application, and behave like lightweight controllers -- generally, they render some sort of form with options in it, and then update preferences when the user submits the form. By extending this class, you can add new settings panels.

Tasks

Panel Configuration

  • public function getPanelKey() — Return a unique string used in the URI to identify this panel, like "example".
  • abstract public function getPanelName() — Return a human-readable description of the panel's contents, like "Example Settings".
  • public function getPanelMenuIcon() — Return an icon for the panel in the menu.
  • abstract public function getPanelGroupKey() — Return a panel group key constant for this panel.
  • public function isEnabled() — Return false to prevent this panel from being displayed or used. You can do, e.g., configuration checks here, to determine if the feature your panel controls is unavailable in this install. By default, all panels are enabled.
  • public function isUserPanel() — Return true if this panel is available to users while editing their own settings.
  • public function isManagementPanel() — Return true if this panel is available to administrators while managing bot and mailing list accounts.
  • public function isTemplatePanel() — Return true if this panel is available while editing settings templates.
  • public function isMultiFactorEnrollmentPanel() — Return true if this panel should be available when enrolling in MFA on a new account with MFA requiredd.

Panel Implementation

  • abstract public function processRequest($request) — Process a user request for this settings panel. Implement this method like a lightweight controller. If you return an @{class:AphrontResponse}, the response will be used in whole. If you return anything else, it will be treated as a view and composed into a normal settings page.
  • final public function getPanelURI($path) — Get the URI for this panel.

Internals

Other Methods

Methods

public function setUser($user)

This method is not documented.
Parameters
PhabricatorUser$user
Return
wild

public function getUser()

This method is not documented.
Return
wild

public function setViewer($viewer)

This method is not documented.
Parameters
PhabricatorUser$viewer
Return
wild

public function getViewer()

This method is not documented.
Return
wild

public function setOverrideURI($override_uri)

This method is not documented.
Parameters
$override_uri
Return
wild

final public function setController($controller)

This method is not documented.
Parameters
PhabricatorController$controller
Return
wild

final public function getController()

This method is not documented.
Return
wild

final public function setNavigation($navigation)

This method is not documented.
Parameters
AphrontSideNavFilterView$navigation
Return
wild

final public function getNavigation()

This method is not documented.
Return
wild

public function setPreferences($preferences)

This method is not documented.
Parameters
PhabricatorUserPreferences$preferences
Return
wild

public function getPreferences()

This method is not documented.
Return
wild

final public static function getAllPanels()

This method is not documented.
Return
wild

final public static function getAllDisplayPanels()

This method is not documented.
Return
wild

final public function getPanelGroup()

This method is not documented.
Return
wild

public function getPanelKey()

Return a unique string used in the URI to identify this panel, like "example".

Return
stringUnique panel identifier (used in URIs).

abstract public function getPanelName()

Return a human-readable description of the panel's contents, like "Example Settings".

Return
stringHuman-readable panel name.

public function getPanelMenuIcon()

Return an icon for the panel in the menu.

Return
stringIcon identifier.

abstract public function getPanelGroupKey()

Return a panel group key constant for this panel.

Return
constPanel group key.

public function isEnabled()

Return false to prevent this panel from being displayed or used. You can do, e.g., configuration checks here, to determine if the feature your panel controls is unavailable in this install. By default, all panels are enabled.

Return
boolTrue if the panel should be shown.

public function isUserPanel()

Return true if this panel is available to users while editing their own settings.

Return
boolTrue to enable management on behalf of a user.

public function isManagementPanel()

Return true if this panel is available to administrators while managing bot and mailing list accounts.

Return
boolTrue to enable management on behalf of accounts.

public function isTemplatePanel()

Return true if this panel is available while editing settings templates.

Return
boolTrue to allow editing in templates.

Return true if this panel should be available when enrolling in MFA on a new account with MFA requiredd.

Return
boolTrue to allow configuration during MFA enrollment.

abstract public function processRequest($request)

Process a user request for this settings panel. Implement this method like a lightweight controller. If you return an AphrontResponse, the response will be used in whole. If you return anything else, it will be treated as a view and composed into a normal settings page.

Generally, render your settings panel by returning a form, then return a redirect when the user saves settings.

Parameters
AphrontRequest$requestIncoming request.
Return
wildResponse to request, either as an @{class:AphrontResponse} or something which can be composed into a @{class:AphrontView}.

final public function getPanelURI($path)

Get the URI for this panel.

Parameters
string?$pathOptional path to append.
Return
stringRelative URI for the panel.

final public function getPanelOrderVector()

Generates a key to sort the list of panels.

Return
stringSortable key.

protected function newDialog()

This method is not documented.
Return
wild

protected function writeSetting($preferences, $key, $value)

This method is not documented.
Parameters
PhabricatorUserPreferences$preferences
$key
$value
Return
wild

public function newBox($title, $content, $actions)

This method is not documented.
Parameters
$title
$content
$actions
Return
wild