Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F539995
PhabricatorConpherenceSoundSetting.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorConpherenceSoundSetting.php
View Options
<?php
final
class
PhabricatorConpherenceSoundSetting
extends
PhabricatorSelectSetting
{
const
SETTINGKEY
=
'conpherence-sound'
;
const
VALUE_CONPHERENCE_SILENT
=
'0'
;
const
VALUE_CONPHERENCE_MENTION
=
'1'
;
const
VALUE_CONPHERENCE_ALL
=
'2'
;
public
function
getSettingName
()
{
return
pht
(
'Conpherence Sound'
);
}
public
function
getSettingPanelKey
()
{
return
PhabricatorConpherencePreferencesSettingsPanel
::
PANELKEY
;
}
protected
function
getControlInstructions
()
{
return
pht
(
'Choose the default sound behavior for new Conpherence rooms.'
);
}
protected
function
isEnabledForViewer
(
PhabricatorUser
$viewer
)
{
return
PhabricatorApplication
::
isClassInstalledForViewer
(
'PhabricatorConpherenceApplication'
,
$viewer
);
}
public
function
getSettingDefaultValue
()
{
return
self
::
VALUE_CONPHERENCE_ALL
;
}
protected
function
getSelectOptions
()
{
return
self
::
getOptionsMap
();
}
public
static
function
getSettingLabel
(
$key
)
{
$labels
=
self
::
getOptionsMap
();
return
idx
(
$labels
,
$key
,
pht
(
'Unknown ("%s")'
,
$key
));
}
public
static
function
getDefaultSound
(
$value
)
{
switch
(
$value
)
{
case
self
::
VALUE_CONPHERENCE_ALL
:
return
array
(
ConpherenceRoomSettings
::
SOUND_RECEIVE
=>
ConpherenceRoomSettings
::
DEFAULT_RECEIVE_SOUND
,
ConpherenceRoomSettings
::
SOUND_MENTION
=>
ConpherenceRoomSettings
::
DEFAULT_MENTION_SOUND
,
);
case
self
::
VALUE_CONPHERENCE_MENTION
:
return
array
(
ConpherenceRoomSettings
::
SOUND_RECEIVE
=>
ConpherenceRoomSettings
::
DEFAULT_NO_SOUND
,
ConpherenceRoomSettings
::
SOUND_MENTION
=>
ConpherenceRoomSettings
::
DEFAULT_MENTION_SOUND
,
);
case
self
::
VALUE_CONPHERENCE_SILENT
:
return
array
(
ConpherenceRoomSettings
::
SOUND_RECEIVE
=>
ConpherenceRoomSettings
::
DEFAULT_NO_SOUND
,
ConpherenceRoomSettings
::
SOUND_MENTION
=>
ConpherenceRoomSettings
::
DEFAULT_NO_SOUND
,
);
}
}
private
static
function
getOptionsMap
()
{
return
array
(
self
::
VALUE_CONPHERENCE_SILENT
=>
pht
(
'No Sounds'
),
// self::VALUE_CONPHERENCE_MENTION => pht('Mentions Only'),
self
::
VALUE_CONPHERENCE_ALL
=>
pht
(
'All Messages'
),
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 9:23 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
106218
Default Alt Text
PhabricatorConpherenceSoundSetting.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment