3 final class PhabricatorDarkConsoleSetting
4 extends PhabricatorSelectSetting
{
6 const SETTINGKEY
= 'dark_console';
8 const VALUE_DARKCONSOLE_DISABLED
= '0';
9 const VALUE_DARKCONSOLE_ENABLED
= '1';
11 public function getSettingName() {
12 return pht('DarkConsole');
15 public function getSettingPanelKey() {
16 return PhabricatorDeveloperPreferencesSettingsPanel
::PANELKEY
;
19 protected function getSettingOrder() {
23 protected function isEnabledForViewer(PhabricatorUser
$viewer) {
24 return PhabricatorEnv
::getEnvConfig('darkconsole.enabled');
27 protected function getControlInstructions() {
29 'DarkConsole is a debugging console for developing and troubleshooting '.
30 'applications. After enabling DarkConsole, press the '.
31 '{nav `} key on your keyboard to toggle it on or off.');
34 public function getSettingDefaultValue() {
35 return self
::VALUE_DARKCONSOLE_DISABLED
;
38 protected function getSelectOptions() {
40 self
::VALUE_DARKCONSOLE_DISABLED
=> pht('Disable DarkConsole'),
41 self
::VALUE_DARKCONSOLE_ENABLED
=> pht('Enable DarkConsole'),
45 public function expandSettingTransaction($object, $xaction) {
46 // If the user has hidden the DarkConsole UI, forget their setting when
47 // they enable or disable it.
50 $this->newSettingTransaction(
52 PhabricatorDarkConsoleVisibleSetting
::SETTINGKEY
,