From 83e4e1ce7f13aecdf3c43367cc102ee38389694b Mon Sep 17 00:00:00 2001 From: Andrei Antonescu Date: Fri, 22 Feb 2013 06:16:48 -0800 Subject: [PATCH] Don't show the DarkConsole preference if is false in the config Summary: D4549 added a preference option for DarkConsole, but we should only show it if darkconsole.enabled is true. In most installs DarkConsole is not enabled, so now we check before showing it in the display settings so it's not confusing for users. Test Plan: tested on localhost, when we change the darkconsole.enabled value in ENV the option is not displayed. Reviewers: epriestley Reviewed By: epriestley CC: irinav, aran, Korvin Differential Revision: https://secure.phabricator.com/D5069 --- ...PhabricatorSettingsPanelDisplayPreferences.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php index b5b4d00d35..93ef8383b5 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php @@ -133,8 +133,10 @@ EXAMPLE; ->setValue($pref_monospaced_textareas_value) ->addButton('enabled', 'Enabled', 'Show all textareas using the monospaced font defined above.') - ->addButton('disabled', 'Disabled', null)) - ->appendChild( + ->addButton('disabled', 'Disabled', null)); + + if (PhabricatorEnv::getEnvConfig('darkconsole.enabled')) { + $form->appendChild( id(new AphrontFormRadioButtonControl()) ->setLabel('Dark Console') ->setName($pref_dark_console) @@ -142,11 +144,12 @@ EXAMPLE; $pref_dark_console_value : 0) ->addButton(1, 'Enabled', 'Enabling and using the built-in debugging console.') - ->addButton(0, 'Disabled', null)) - ->appendChild( - id(new AphrontFormSubmitControl()) - ->setValue('Save Preferences')); + ->addButton(0, 'Disabled', null)); + } + $form->appendChild( + id(new AphrontFormSubmitControl()) + ->setValue('Save Preferences')); $panel = new AphrontPanelView(); $panel->setHeader('Display Preferences');