Allow macros to have associated audio and audio behaviors

Summary: Ref T3887. Implements storage and editors, but not the actual audio part.

Test Plan: Edited audio, audio behaviors of macros. Transactions and email looked good. Hit error cases.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3887

Differential Revision: https://secure.phabricator.com/D7159
This commit is contained in:
epriestley
2013-09-27 16:01:37 -07:00
parent 5ab15b51a3
commit 7091dad606
10 changed files with 325 additions and 0 deletions

View File

@@ -119,6 +119,12 @@ final class PhabricatorMacroViewController
->setHref($this->getApplicationURI('/edit/'.$macro->getID().'/'))
->setIcon('edit'));
$view->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Audio'))
->setHref($this->getApplicationURI('/audio/'.$macro->getID().'/'))
->setIcon('herald'));
if ($macro->getIsDisabled()) {
$view->addAction(
id(new PhabricatorActionView())
@@ -146,6 +152,25 @@ final class PhabricatorMacroViewController
->setUser($this->getRequest()->getUser())
->setObject($macro);
switch ($macro->getAudioBehavior()) {
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
$view->addProperty(pht('Audio Behavior'), pht('Play Once'));
break;
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_LOOP:
$view->addProperty(pht('Audio Behavior'), pht('Loop'));
break;
}
$audio_phid = $macro->getAudioPHID();
if ($audio_phid) {
$this->loadHandles(array($audio_phid));
$view->addProperty(
pht('Audio'),
$this->getHandle($audio_phid)->renderLink());
}
$view->invokeWillRenderEvent();
if ($file) {