Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / settings / setting / PhabricatorDarkConsoleSetting.php
blob7851bbdb76f0f4fc0905c3e803df8a1922eb7ed9
1 <?php
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() {
20 return 100;
23 protected function isEnabledForViewer(PhabricatorUser $viewer) {
24 return PhabricatorEnv::getEnvConfig('darkconsole.enabled');
27 protected function getControlInstructions() {
28 return pht(
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() {
39 return array(
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.
48 return array(
49 $xaction,
50 $this->newSettingTransaction(
51 $object,
52 PhabricatorDarkConsoleVisibleSetting::SETTINGKEY,
53 1),