Changeset View
Changeset View
Standalone View
Standalone View
src/applications/macro/storage/PhabricatorMacroTransaction.php
| <?php | <?php | ||||
| final class PhabricatorMacroTransaction | final class PhabricatorMacroTransaction | ||||
| extends PhabricatorApplicationTransaction { | extends PhabricatorApplicationTransaction { | ||||
| const TYPE_NAME = 'macro:name'; | const TYPE_NAME = 'macro:name'; | ||||
| const TYPE_DISABLED = 'macro:disabled'; | const TYPE_DISABLED = 'macro:disabled'; | ||||
| const TYPE_FILE = 'macro:file'; | const TYPE_FILE = 'macro:file'; | ||||
| const TYPE_ORIGINAL_SIZE = 'macro:originalsize'; | |||||
| const TYPE_AUDIO = 'macro:audio'; | const TYPE_AUDIO = 'macro:audio'; | ||||
| const TYPE_AUDIO_BEHAVIOR = 'macro:audiobehavior'; | const TYPE_AUDIO_BEHAVIOR = 'macro:audiobehavior'; | ||||
| public function getApplicationName() { | public function getApplicationName() { | ||||
| return 'file'; | return 'file'; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| } else { | } else { | ||||
| return pht( | return pht( | ||||
| '%s restored this macro.', | '%s restored this macro.', | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| } | } | ||||
| break; | break; | ||||
| case self::TYPE_ORIGINAL_SIZE: | |||||
| if ($new) { | |||||
| return pht( | |||||
| '%s configured this macro to render as it\'s original size.', | |||||
| $this->renderHandleLink($author_phid)); | |||||
| } else { | |||||
| return pht( | |||||
| '%s configured this macro to automatically resize.', | |||||
| $this->renderHandleLink($author_phid)); | |||||
| } | |||||
| break; | |||||
| case self::TYPE_AUDIO: | case self::TYPE_AUDIO: | ||||
| if (!$old) { | if (!$old) { | ||||
| return pht( | return pht( | ||||
| '%s attached audio: %s.', | '%s attached audio: %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($new)); | $this->renderHandleLink($new)); | ||||
| } else { | } else { | ||||
| return pht( | return pht( | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| } else { | } else { | ||||
| return pht( | return pht( | ||||
| '%s restored %s.', | '%s restored %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| } | } | ||||
| case self::TYPE_ORIGINAL_SIZE: | |||||
| if ($new) { | |||||
| return pht( | |||||
| '%s configured %s to render as it\'s original size.', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $this->renderHandleLink($object_phid)); | |||||
| } else { | |||||
| return pht( | |||||
| '%s configured %s to automatically resize.', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $this->renderHandleLink($object_phid)); | |||||
| } | |||||
| case self::TYPE_FILE: | case self::TYPE_FILE: | ||||
| if ($old === null) { | if ($old === null) { | ||||
| return pht( | return pht( | ||||
| '%s created %s.', | '%s created %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| } else { | } else { | ||||
| return pht( | return pht( | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
| return pht('Renamed'); | return pht('Renamed'); | ||||
| } | } | ||||
| case self::TYPE_DISABLED: | case self::TYPE_DISABLED: | ||||
| if ($new) { | if ($new) { | ||||
| return pht('Disabled'); | return pht('Disabled'); | ||||
| } else { | } else { | ||||
| return pht('Restored'); | return pht('Restored'); | ||||
| } | } | ||||
| case self::TYPE_ORIGINAL_SIZE: | |||||
| return pht('Configured Original Size'); | |||||
| case self::TYPE_FILE: | case self::TYPE_FILE: | ||||
| if ($old === null) { | if ($old === null) { | ||||
| return pht('Created'); | return pht('Created'); | ||||
| } else { | } else { | ||||
| return pht('Edited Image'); | return pht('Edited Image'); | ||||
| } | } | ||||
| case self::TYPE_AUDIO: | case self::TYPE_AUDIO: | ||||
| Show All 31 Lines | switch ($this->getTransactionType()) { | ||||
| return 'fa-pencil'; | return 'fa-pencil'; | ||||
| } | } | ||||
| case self::TYPE_DISABLED: | case self::TYPE_DISABLED: | ||||
| if ($new) { | if ($new) { | ||||
| return 'fa-times'; | return 'fa-times'; | ||||
| } else { | } else { | ||||
| return 'fa-undo'; | return 'fa-undo'; | ||||
| } | } | ||||
| case self::TYPE_ORIGINAL_SIZE: | |||||
| if ($new) { | |||||
| return 'fa-expand'; | |||||
| } else { | |||||
| return 'fa-compress'; | |||||
| } | |||||
| case self::TYPE_AUDIO: | case self::TYPE_AUDIO: | ||||
| return 'fa-headphones'; | return 'fa-headphones'; | ||||
| } | } | ||||
| return parent::getIcon(); | return parent::getIcon(); | ||||
| } | } | ||||
| public function getColor() { | public function getColor() { | ||||
| Show All 25 Lines | |||||