@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert "Display Preferences" to modular settings

Summary: Ref T4103. Just porting these directly for now, no attempt to organize things yet.

Test Plan: {F1669263}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4103

Differential Revision: https://secure.phabricator.com/D15997

+245 -2
+14
src/__phutil_library_map__.php
··· 1711 1711 'PhabricatorAccessControlTestCase' => 'applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php', 1712 1712 'PhabricatorAccessLog' => 'infrastructure/log/PhabricatorAccessLog.php', 1713 1713 'PhabricatorAccessLogConfigOptions' => 'applications/config/option/PhabricatorAccessLogConfigOptions.php', 1714 + 'PhabricatorAccessibilitySetting' => 'applications/settings/setting/PhabricatorAccessibilitySetting.php', 1714 1715 'PhabricatorAccountSettingsPanel' => 'applications/settings/panel/PhabricatorAccountSettingsPanel.php', 1715 1716 'PhabricatorActionListView' => 'view/layout/PhabricatorActionListView.php', 1716 1717 'PhabricatorActionView' => 'view/layout/PhabricatorActionView.php', ··· 2373 2374 'PhabricatorEditPage' => 'applications/transactions/editengine/PhabricatorEditPage.php', 2374 2375 'PhabricatorEditType' => 'applications/transactions/edittype/PhabricatorEditType.php', 2375 2376 'PhabricatorEditor' => 'infrastructure/PhabricatorEditor.php', 2377 + 'PhabricatorEditorMultipleSetting' => 'applications/settings/setting/PhabricatorEditorMultipleSetting.php', 2378 + 'PhabricatorEditorSetting' => 'applications/settings/setting/PhabricatorEditorSetting.php', 2376 2379 'PhabricatorElasticFulltextStorageEngine' => 'applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php', 2377 2380 'PhabricatorElasticSearchSetupCheck' => 'applications/config/check/PhabricatorElasticSearchSetupCheck.php', 2378 2381 'PhabricatorEmailAddressesSettingsPanel' => 'applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php', ··· 2732 2735 'PhabricatorMetaMTASendGridReceiveController' => 'applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php', 2733 2736 'PhabricatorMetaMTAWorker' => 'applications/metamta/PhabricatorMetaMTAWorker.php', 2734 2737 'PhabricatorMetronomicTriggerClock' => 'infrastructure/daemon/workers/clock/PhabricatorMetronomicTriggerClock.php', 2738 + 'PhabricatorMonospacedFontSetting' => 'applications/settings/setting/PhabricatorMonospacedFontSetting.php', 2739 + 'PhabricatorMonospacedTextareasSetting' => 'applications/settings/setting/PhabricatorMonospacedTextareasSetting.php', 2735 2740 'PhabricatorMotivatorProfilePanel' => 'applications/search/profilepanel/PhabricatorMotivatorProfilePanel.php', 2736 2741 'PhabricatorMultiColumnUIExample' => 'applications/uiexample/examples/PhabricatorMultiColumnUIExample.php', 2737 2742 'PhabricatorMultiFactorSettingsPanel' => 'applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php', ··· 3463 3468 'PhabricatorStorageSetupCheck' => 'applications/config/check/PhabricatorStorageSetupCheck.php', 3464 3469 'PhabricatorStreamingProtocolAdapter' => 'infrastructure/daemon/bot/adapter/PhabricatorStreamingProtocolAdapter.php', 3465 3470 'PhabricatorStringListEditField' => 'applications/transactions/editfield/PhabricatorStringListEditField.php', 3471 + 'PhabricatorStringSetting' => 'applications/settings/setting/PhabricatorStringSetting.php', 3466 3472 'PhabricatorSubscribableInterface' => 'applications/subscriptions/interface/PhabricatorSubscribableInterface.php', 3467 3473 'PhabricatorSubscribedToObjectEdgeType' => 'applications/transactions/edges/PhabricatorSubscribedToObjectEdgeType.php', 3468 3474 'PhabricatorSubscribersEditField' => 'applications/transactions/editfield/PhabricatorSubscribersEditField.php', ··· 3522 3528 'PhabricatorTimeGuard' => 'infrastructure/time/PhabricatorTimeGuard.php', 3523 3529 'PhabricatorTimeTestCase' => 'infrastructure/time/__tests__/PhabricatorTimeTestCase.php', 3524 3530 'PhabricatorTimezoneSetupCheck' => 'applications/config/check/PhabricatorTimezoneSetupCheck.php', 3531 + 'PhabricatorTitleGlyphsSetting' => 'applications/settings/setting/PhabricatorTitleGlyphsSetting.php', 3525 3532 'PhabricatorToken' => 'applications/tokens/storage/PhabricatorToken.php', 3526 3533 'PhabricatorTokenController' => 'applications/tokens/controller/PhabricatorTokenController.php', 3527 3534 'PhabricatorTokenCount' => 'applications/tokens/storage/PhabricatorTokenCount.php', ··· 6137 6144 'PhabricatorAccessControlTestCase' => 'PhabricatorTestCase', 6138 6145 'PhabricatorAccessLog' => 'Phobject', 6139 6146 'PhabricatorAccessLogConfigOptions' => 'PhabricatorApplicationConfigOptions', 6147 + 'PhabricatorAccessibilitySetting' => 'PhabricatorSelectSetting', 6140 6148 'PhabricatorAccountSettingsPanel' => 'PhabricatorSettingsPanel', 6141 6149 'PhabricatorActionListView' => 'AphrontView', 6142 6150 'PhabricatorActionView' => 'AphrontView', ··· 6914 6922 'PhabricatorEditPage' => 'Phobject', 6915 6923 'PhabricatorEditType' => 'Phobject', 6916 6924 'PhabricatorEditor' => 'Phobject', 6925 + 'PhabricatorEditorMultipleSetting' => 'PhabricatorSelectSetting', 6926 + 'PhabricatorEditorSetting' => 'PhabricatorStringSetting', 6917 6927 'PhabricatorElasticFulltextStorageEngine' => 'PhabricatorFulltextStorageEngine', 6918 6928 'PhabricatorElasticSearchSetupCheck' => 'PhabricatorSetupCheck', 6919 6929 'PhabricatorEmailAddressesSettingsPanel' => 'PhabricatorSettingsPanel', ··· 7318 7328 'PhabricatorMetaMTASendGridReceiveController' => 'PhabricatorMetaMTAController', 7319 7329 'PhabricatorMetaMTAWorker' => 'PhabricatorWorker', 7320 7330 'PhabricatorMetronomicTriggerClock' => 'PhabricatorTriggerClock', 7331 + 'PhabricatorMonospacedFontSetting' => 'PhabricatorStringSetting', 7332 + 'PhabricatorMonospacedTextareasSetting' => 'PhabricatorSelectSetting', 7321 7333 'PhabricatorMotivatorProfilePanel' => 'PhabricatorProfilePanel', 7322 7334 'PhabricatorMultiColumnUIExample' => 'PhabricatorUIExample', 7323 7335 'PhabricatorMultiFactorSettingsPanel' => 'PhabricatorSettingsPanel', ··· 8204 8216 'PhabricatorStorageSetupCheck' => 'PhabricatorSetupCheck', 8205 8217 'PhabricatorStreamingProtocolAdapter' => 'PhabricatorProtocolAdapter', 8206 8218 'PhabricatorStringListEditField' => 'PhabricatorEditField', 8219 + 'PhabricatorStringSetting' => 'PhabricatorSetting', 8207 8220 'PhabricatorSubscribedToObjectEdgeType' => 'PhabricatorEdgeType', 8208 8221 'PhabricatorSubscribersEditField' => 'PhabricatorTokenizerEditField', 8209 8222 'PhabricatorSubscribersQuery' => 'PhabricatorQuery', ··· 8262 8275 'PhabricatorTimeGuard' => 'Phobject', 8263 8276 'PhabricatorTimeTestCase' => 'PhabricatorTestCase', 8264 8277 'PhabricatorTimezoneSetupCheck' => 'PhabricatorSetupCheck', 8278 + 'PhabricatorTitleGlyphsSetting' => 'PhabricatorSelectSetting', 8265 8279 'PhabricatorToken' => array( 8266 8280 'PhabricatorTokenDAO', 8267 8281 'PhabricatorPolicyInterface',
+1 -1
src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php
··· 10 10 } 11 11 12 12 public function getPostprocessorName() { 13 - return pht('Use Default Colors'); 13 + return pht('Use Standard Colors'); 14 14 } 15 15 16 16 public function buildDefaultPostprocessor() {
+39
src/applications/settings/setting/PhabricatorAccessibilitySetting.php
··· 1 + <?php 2 + 3 + final class PhabricatorAccessibilitySetting 4 + extends PhabricatorSelectSetting { 5 + 6 + const SETTINGKEY = 'resource-postprocessor'; 7 + 8 + public function getSettingName() { 9 + return pht('Accessibility'); 10 + } 11 + 12 + protected function getControlInstructions() { 13 + return pht( 14 + 'If you have difficulty reading the Phabricator UI, these settings '. 15 + 'may make Phabricator more accessible.'); 16 + } 17 + 18 + public function getSettingDefaultValue() { 19 + return CelerityDefaultPostprocessor::POSTPROCESSOR_KEY; 20 + } 21 + 22 + protected function getSelectOptions() { 23 + $postprocessor_map = CelerityPostprocessor::getAllPostprocessors(); 24 + 25 + $postprocessor_map = mpull($postprocessor_map, 'getPostprocessorName'); 26 + asort($postprocessor_map); 27 + 28 + $postprocessor_order = array( 29 + CelerityDefaultPostprocessor::POSTPROCESSOR_KEY, 30 + ); 31 + 32 + $postprocessor_map = array_select_keys( 33 + $postprocessor_map, 34 + $postprocessor_order) + $postprocessor_map; 35 + 36 + return $postprocessor_map; 37 + } 38 + 39 + }
+32
src/applications/settings/setting/PhabricatorEditorMultipleSetting.php
··· 1 + <?php 2 + 3 + final class PhabricatorEditorMultipleSetting 4 + extends PhabricatorSelectSetting { 5 + 6 + const SETTINGKEY = 'multiedit'; 7 + 8 + const VALUE_SPACES = 'spaces'; 9 + const VALUE_SINGLE = 'disable'; 10 + 11 + public function getSettingName() { 12 + return pht('Edit Mulitple Files'); 13 + } 14 + 15 + protected function getControlInstructions() { 16 + return pht( 17 + 'Some editors support opening multiple files with a single URI. You '. 18 + 'can specify the behavior of your editor here.'); 19 + } 20 + 21 + public function getSettingDefaultValue() { 22 + return self::VALUE_SPACES; 23 + } 24 + 25 + protected function getSelectOptions() { 26 + return array( 27 + self::VALUE_SPACES => pht('Supported, Separated by Spaces'), 28 + self::VALUE_SINGLE => pht('Not Supported'), 29 + ); 30 + } 31 + 32 + }
+33
src/applications/settings/setting/PhabricatorEditorSetting.php
··· 1 + <?php 2 + 3 + final class PhabricatorEditorSetting 4 + extends PhabricatorStringSetting { 5 + 6 + const SETTINGKEY = 'editor'; 7 + 8 + public function getSettingName() { 9 + return pht('Editor Link'); 10 + } 11 + 12 + protected function getControlInstructions() { 13 + return pht( 14 + "Many text editors can be configured as URI handlers for special ". 15 + "protocols like `editor://`. If you have such an editor, Phabricator ". 16 + "can generate links that you can click to open files locally.". 17 + "\n\n". 18 + "These special variables are supported:". 19 + "\n\n". 20 + "| Value | Replaced With |\n". 21 + "|-------|---------------|\n". 22 + "| `%%f` | Filename |\n". 23 + "| `%%l` | Line Number |\n". 24 + "| `%%r` | Repository Callsign |\n". 25 + "| `%%%%` | Literal `%%` |\n". 26 + "\n\n". 27 + "For complete instructions on editor configuration, ". 28 + "see **[[ %s | %s ]]**.", 29 + PhabricatorEnv::getDoclink('User Guide: Configuring an External Editor'), 30 + pht('User Guide: Configuring an External Editor')); 31 + } 32 + 33 + }
+40
src/applications/settings/setting/PhabricatorMonospacedFontSetting.php
··· 1 + <?php 2 + 3 + final class PhabricatorMonospacedFontSetting 4 + extends PhabricatorStringSetting { 5 + 6 + const SETTINGKEY = 'monospaced'; 7 + 8 + public function getSettingName() { 9 + return pht('Monospaced Font'); 10 + } 11 + 12 + protected function getControlInstructions() { 13 + return pht( 14 + 'You can customize the font used when showing monospaced text, '. 15 + 'including source code. You should enter a valid CSS font declaration '. 16 + 'like: `13px Consolas`'); 17 + } 18 + 19 + public function validateTransactionValue($value) { 20 + if (!strlen($value)) { 21 + return; 22 + } 23 + 24 + $filtered = self::filterMonospacedCSSRule($value); 25 + if ($filtered !== $value) { 26 + throw new Exception( 27 + pht( 28 + 'Monospaced font value "%s" is unsafe. You may only enter '. 29 + 'letters, numbers, spaces, commas, periods, forward slashes '. 30 + 'and double quotes.', 31 + $value)); 32 + } 33 + } 34 + 35 + public static function filterMonospacedCSSRule($monospaced) { 36 + // Prevent the user from doing dangerous things. 37 + return preg_replace('([^a-z0-9 ,"./]+)i', '', $monospaced); 38 + } 39 + 40 + }
+34
src/applications/settings/setting/PhabricatorMonospacedTextareasSetting.php
··· 1 + <?php 2 + 3 + final class PhabricatorMonospacedTextareasSetting 4 + extends PhabricatorSelectSetting { 5 + 6 + const SETTINGKEY = 'monospaced-textareas'; 7 + 8 + const VALUE_TEXT_VARIABLE_WIDTH = 'disabled'; 9 + const VALUE_TEXT_MONOSPACED = 'enabled'; 10 + 11 + public function getSettingName() { 12 + return pht('Monospaced Textareas'); 13 + } 14 + 15 + protected function getControlInstructions() { 16 + return pht( 17 + 'You can choose to use either a monospaced or variable-width font '. 18 + 'in textareas in the UI. Textareas are used for editing descriptions '. 19 + 'and writing comments, among other things.'); 20 + } 21 + 22 + public function getSettingDefaultValue() { 23 + return self::VALUE_TEXT_VARIABLE_WIDTH; 24 + } 25 + 26 + protected function getSelectOptions() { 27 + return array( 28 + self::VALUE_TEXT_VARIABLE_WIDTH => pht('Use Variable-Width Font'), 29 + self::VALUE_TEXT_MONOSPACED => pht('Use Monospaced Font'), 30 + ); 31 + } 32 + 33 + 34 + }
+18
src/applications/settings/setting/PhabricatorStringSetting.php
··· 1 + <?php 2 + 3 + abstract class PhabricatorStringSetting 4 + extends PhabricatorSetting { 5 + 6 + final protected function newCustomEditField($object) { 7 + return $this->newEditField($object, new PhabricatorTextEditField()); 8 + } 9 + 10 + public function getTransactionNewValue($value) { 11 + if (!strlen($value)) { 12 + return null; 13 + } 14 + 15 + return (string)$value; 16 + } 17 + 18 + }
+33
src/applications/settings/setting/PhabricatorTitleGlyphsSetting.php
··· 1 + <?php 2 + 3 + final class PhabricatorTitleGlyphsSetting 4 + extends PhabricatorSelectSetting { 5 + 6 + const SETTINGKEY = 'titles'; 7 + 8 + const VALUE_TITLE_GLYPHS = 'glyph'; 9 + const VALUE_TITLE_TEXT = 'text'; 10 + 11 + public function getSettingName() { 12 + return pht('Page Titles'); 13 + } 14 + 15 + protected function getControlInstructions() { 16 + return pht( 17 + 'Phabricator uses unicode glyphs in page titles to provide a compact '. 18 + 'representation of the current application. You can substitute plain '. 19 + 'text instead if these glyphs do not display on your system.'); 20 + } 21 + 22 + public function getSettingDefaultValue() { 23 + return self::VALUE_TITLE_GLYPHS; 24 + } 25 + 26 + protected function getSelectOptions() { 27 + return array( 28 + self::VALUE_TITLE_GLYPHS => pht("Use Unicode Glyphs: \xE2\x9A\x99"), 29 + self::VALUE_TITLE_TEXT => pht('Use Plain Text: [Differential]'), 30 + ); 31 + } 32 + 33 + }
+1 -1
src/view/page/PhabricatorStandardPageView.php
··· 374 374 // We can't print this normally because escaping quotation marks will 375 375 // break the CSS. Instead, filter it strictly and then mark it as safe. 376 376 $monospaced = new PhutilSafeHTML( 377 - PhabricatorUserPreferences::filterMonospacedCSSRule( 377 + PhabricatorMonospacedFontSetting::filterMonospacedCSSRule( 378 378 $monospaced)); 379 379 380 380 $font_css = hsprintf(