3 final class PhabricatorMacroAudioBehaviorTransaction
4 extends PhabricatorMacroTransactionType
{
6 const TRANSACTIONTYPE
= 'macro:audiobehavior';
8 public function generateOldValue($object) {
9 return $object->getAudioBehavior();
12 public function applyInternalEffects($object, $value) {
13 $object->setAudioBehavior($value);
16 public function getTitle() {
17 $new = $this->getNewValue();
18 $old = $this->getOldValue();
20 case PhabricatorFileImageMacro
::AUDIO_BEHAVIOR_ONCE
:
22 '%s set the audio to play once.',
23 $this->renderAuthor());
24 case PhabricatorFileImageMacro
::AUDIO_BEHAVIOR_LOOP
:
26 '%s set the audio to loop.',
27 $this->renderAuthor());
30 '%s disabled the audio for this macro.',
31 $this->renderAuthor());
35 public function getTitleForFeed() {
36 $new = $this->getNewValue();
37 $old = $this->getOldValue();
39 case PhabricatorFileImageMacro
::AUDIO_BEHAVIOR_ONCE
:
41 '%s set the audio for %s to play once.',
42 $this->renderAuthor(),
43 $this->renderObject());
44 case PhabricatorFileImageMacro
::AUDIO_BEHAVIOR_LOOP
:
46 '%s set the audio for %s to loop.',
47 $this->renderAuthor(),
48 $this->renderObject());
51 '%s disabled the audio for %s.',
52 $this->renderAuthor(),
53 $this->renderObject());
57 public function getIcon() {
58 $new = $this->getNewValue();
60 case PhabricatorFileImageMacro
::AUDIO_BEHAVIOR_ONCE
:
61 return 'fa-play-circle';
62 case PhabricatorFileImageMacro
::AUDIO_BEHAVIOR_LOOP
:
65 return 'fa-pause-circle';