Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94939709
PhabricatorMacroAudioBehaviorTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Dec 11, 13:47
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Dec 13, 13:47 (2 d)
Engine
blob
Format
Raw Data
Handle
22901021
Attached To
rPH Phabricator
PhabricatorMacroAudioBehaviorTransaction.php
View Options
<?php
final
class
PhabricatorMacroAudioBehaviorTransaction
extends
PhabricatorMacroTransactionType
{
const
TRANSACTIONTYPE
=
'macro:audiobehavior'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getAudioBehavior
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setAudioBehavior
(
$value
);
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
$old
=
$this
->
getOldValue
();
switch
(
$new
)
{
case
PhabricatorFileImageMacro
::
AUDIO_BEHAVIOR_ONCE
:
return
pht
(
'%s set the audio to play once.'
,
$this
->
renderAuthor
());
case
PhabricatorFileImageMacro
::
AUDIO_BEHAVIOR_LOOP
:
return
pht
(
'%s set the audio to loop.'
,
$this
->
renderAuthor
());
default
:
return
pht
(
'%s disabled the audio for this macro.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
$old
=
$this
->
getOldValue
();
switch
(
$new
)
{
case
PhabricatorFileImageMacro
::
AUDIO_BEHAVIOR_ONCE
:
return
pht
(
'%s set the audio for %s to play once.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
case
PhabricatorFileImageMacro
::
AUDIO_BEHAVIOR_LOOP
:
return
pht
(
'%s set the audio for %s to loop.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
default
:
return
pht
(
'%s disabled the audio for %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$new
=
$this
->
getNewValue
();
switch
(
$new
)
{
case
PhabricatorFileImageMacro
::
AUDIO_BEHAVIOR_ONCE
:
return
'fa-play-circle'
;
case
PhabricatorFileImageMacro
::
AUDIO_BEHAVIOR_LOOP
:
return
'fa-repeat'
;
default
:
return
'fa-pause-circle'
;
}
}
}
Event Timeline
Log In to Comment