Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / settings / setting / PhabricatorConpherenceSoundSetting.php
blob77ff6eac467d54d81c666c3f5b15939884931160
1 <?php
3 final class PhabricatorConpherenceSoundSetting
4 extends PhabricatorSelectSetting {
6 const SETTINGKEY = 'conpherence-sound';
8 const VALUE_CONPHERENCE_SILENT = '0';
9 const VALUE_CONPHERENCE_MENTION = '1';
10 const VALUE_CONPHERENCE_ALL = '2';
12 public function getSettingName() {
13 return pht('Conpherence Sound');
16 public function getSettingPanelKey() {
17 return PhabricatorConpherencePreferencesSettingsPanel::PANELKEY;
20 protected function getControlInstructions() {
21 return pht(
22 'Choose the default sound behavior for new Conpherence rooms.');
25 protected function isEnabledForViewer(PhabricatorUser $viewer) {
26 return PhabricatorApplication::isClassInstalledForViewer(
27 'PhabricatorConpherenceApplication',
28 $viewer);
31 public function getSettingDefaultValue() {
32 return self::VALUE_CONPHERENCE_ALL;
35 protected function getSelectOptions() {
36 return self::getOptionsMap();
39 public static function getSettingLabel($key) {
40 $labels = self::getOptionsMap();
41 return idx($labels, $key, pht('Unknown ("%s")', $key));
44 public static function getDefaultSound($value) {
45 switch ($value) {
46 case self::VALUE_CONPHERENCE_ALL:
47 return array(
48 ConpherenceRoomSettings::SOUND_RECEIVE =>
49 ConpherenceRoomSettings::DEFAULT_RECEIVE_SOUND,
50 ConpherenceRoomSettings::SOUND_MENTION =>
51 ConpherenceRoomSettings::DEFAULT_MENTION_SOUND,
53 break;
54 case self::VALUE_CONPHERENCE_MENTION:
55 return array(
56 ConpherenceRoomSettings::SOUND_RECEIVE =>
57 ConpherenceRoomSettings::DEFAULT_NO_SOUND,
58 ConpherenceRoomSettings::SOUND_MENTION =>
59 ConpherenceRoomSettings::DEFAULT_MENTION_SOUND,
61 break;
62 case self::VALUE_CONPHERENCE_SILENT:
63 return array(
64 ConpherenceRoomSettings::SOUND_RECEIVE =>
65 ConpherenceRoomSettings::DEFAULT_NO_SOUND,
66 ConpherenceRoomSettings::SOUND_MENTION =>
67 ConpherenceRoomSettings::DEFAULT_NO_SOUND,
69 break;
73 private static function getOptionsMap() {
74 return array(
75 self::VALUE_CONPHERENCE_SILENT => pht('No Sounds'),
76 // self::VALUE_CONPHERENCE_MENTION => pht('Mentions Only'),
77 self::VALUE_CONPHERENCE_ALL => pht('All Messages'),