diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index a819390bfb..289dd23ff7 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -132,9 +132,14 @@ final class DifferentialChangesetListView extends AphrontView { $ref, $changeset); + $prefs = $this->user->loadPreferences(); + $pref_symbols = $prefs->getPreference( + PhabricatorUserPreferences::PREFERENCE_DIFFUSION_SYMBOLS); $detail->setChangeset($changeset); $detail->addButton($view_options); - $detail->setSymbolIndex(idx($this->symbolIndexes, $key)); + if ($pref_symbols != 'disabled') { + $detail->setSymbolIndex(idx($this->symbolIndexes, $key)); + } $detail->setVsChangesetID(idx($this->vsMap, $changeset->getID())); $detail->setEditable(true); diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php index d88bad10b5..1eea798a0b 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php @@ -231,7 +231,10 @@ final class DiffusionBrowseFileController extends DiffusionController { $lang = last(explode('.', $drequest->getPath())); - if (isset($langs[$lang])) { + $prefs = $this->getRequest()->getUser()->loadPreferences(); + $pref_symbols = $prefs->getPreference( + PhabricatorUserPreferences::PREFERENCE_DIFFUSION_SYMBOLS); + if (isset($langs[$lang]) && $pref_symbols != 'disabled') { Javelin::initBehavior( 'repository-crossreference', array( diff --git a/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php b/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php index f650a76008..09d5c10ce6 100644 --- a/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php +++ b/src/applications/people/controller/settings/panels/PhabricatorUserPreferenceSettingsPanelController.php @@ -25,9 +25,10 @@ final class PhabricatorUserPreferenceSettingsPanelController $user = $request->getUser(); $preferences = $user->loadPreferences(); - $pref_monospaced = PhabricatorUserPreferences::PREFERENCE_MONOSPACED; - $pref_editor = PhabricatorUserPreferences::PREFERENCE_EDITOR; - $pref_titles = PhabricatorUserPreferences::PREFERENCE_TITLES; + $pref_monospaced = PhabricatorUserPreferences::PREFERENCE_MONOSPACED; + $pref_editor = PhabricatorUserPreferences::PREFERENCE_EDITOR; + $pref_titles = PhabricatorUserPreferences::PREFERENCE_TITLES; + $pref_symbols = PhabricatorUserPreferences::PREFERENCE_DIFFUSION_SYMBOLS; if ($request->isFormPost()) { $monospaced = $request->getStr($pref_monospaced); @@ -37,6 +38,8 @@ final class PhabricatorUserPreferenceSettingsPanelController $preferences->setPreference($pref_titles, $request->getStr($pref_titles)); $preferences->setPreference($pref_editor, $request->getStr($pref_editor)); + $preferences->setPreference($pref_symbols, + $request->getStr($pref_symbols)); $preferences->setPreference($pref_monospaced, $monospaced); $preferences->save(); @@ -101,6 +104,15 @@ EXAMPLE; '
'.
phutil_escape_html($example_string).
''))
+ ->appendChild(
+ id(new AphrontFormRadioButtonControl())
+ ->setLabel('Symbol Links')
+ ->setName($pref_symbols)
+ ->setValue($preferences->getPreference($pref_symbols) ?: 'enabled')
+ ->addButton('enabled', 'Enabled (default)',
+ 'Use this setting to disable linking symbol names in Differential '.
+ 'and Diffusion to their definitions. This is enabled by default.')
+ ->addButton('disabled', 'Disabled', null))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Save Preferences'));
diff --git a/src/applications/people/storage/PhabricatorUserPreferences.php b/src/applications/people/storage/PhabricatorUserPreferences.php
index d569d8929a..2d4941207b 100644
--- a/src/applications/people/storage/PhabricatorUserPreferences.php
+++ b/src/applications/people/storage/PhabricatorUserPreferences.php
@@ -18,19 +18,20 @@
final class PhabricatorUserPreferences extends PhabricatorUserDAO {
- const PREFERENCE_MONOSPACED = 'monospaced';
- const PREFERENCE_EDITOR = 'editor';
- const PREFERENCE_TITLES = 'titles';
+ const PREFERENCE_MONOSPACED = 'monospaced';
+ const PREFERENCE_EDITOR = 'editor';
+ const PREFERENCE_TITLES = 'titles';
- const PREFERENCE_RE_PREFIX = 're-prefix';
- const PREFERENCE_NO_SELF_MAIL = 'self-mail';
- const PREFERENCE_MAILTAGS = 'mailtags';
- const PREFERENCE_VARY_SUBJECT = 'vary-subject';
+ const PREFERENCE_RE_PREFIX = 're-prefix';
+ const PREFERENCE_NO_SELF_MAIL = 'self-mail';
+ const PREFERENCE_MAILTAGS = 'mailtags';
+ const PREFERENCE_VARY_SUBJECT = 'vary-subject';
- const PREFERENCE_SEARCHBAR_JUMP = 'searchbar-jump';
- const PREFERENCE_SEARCH_SHORTCUT = 'search-shortcut';
+ const PREFERENCE_SEARCHBAR_JUMP = 'searchbar-jump';
+ const PREFERENCE_SEARCH_SHORTCUT = 'search-shortcut';
- const PREFERENCE_DIFFUSION_VIEW = 'diffusion-view';
+ const PREFERENCE_DIFFUSION_VIEW = 'diffusion-view';
+ const PREFERENCE_DIFFUSION_SYMBOLS = 'diffusion-symbols';
protected $userPHID;
protected $preferences = array();