Page MenuHomePhorge

PhabricatorMacroAudioBehaviorTransaction.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PhabricatorMacroAudioBehaviorTransaction.php

<?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';
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, May 13, 5:45 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
121934
Default Alt Text
PhabricatorMacroAudioBehaviorTransaction.php (1 KB)

Event Timeline