Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / macro / xaction / PhabricatorMacroAudioBehaviorTransaction.php
blobe27e9081ed4fda631083656238be8c9ac52e1947
1 <?php
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();
19 switch ($new) {
20 case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
21 return pht(
22 '%s set the audio to play once.',
23 $this->renderAuthor());
24 case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
25 return pht(
26 '%s set the audio to loop.',
27 $this->renderAuthor());
28 default:
29 return pht(
30 '%s disabled the audio for this macro.',
31 $this->renderAuthor());
35 public function getTitleForFeed() {
36 $new = $this->getNewValue();
37 $old = $this->getOldValue();
38 switch ($new) {
39 case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
40 return pht(
41 '%s set the audio for %s to play once.',
42 $this->renderAuthor(),
43 $this->renderObject());
44 case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
45 return pht(
46 '%s set the audio for %s to loop.',
47 $this->renderAuthor(),
48 $this->renderObject());
49 default:
50 return pht(
51 '%s disabled the audio for %s.',
52 $this->renderAuthor(),
53 $this->renderObject());
57 public function getIcon() {
58 $new = $this->getNewValue();
59 switch ($new) {
60 case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
61 return 'fa-play-circle';
62 case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
63 return 'fa-repeat';
64 default:
65 return 'fa-pause-circle';