Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/storage/PhameBlogTransaction.php
| <?php | <?php | ||||
| final class PhameBlogTransaction | final class PhameBlogTransaction | ||||
| extends PhabricatorApplicationTransaction { | extends PhabricatorApplicationTransaction { | ||||
| const TYPE_NAME = 'phame.blog.name'; | const TYPE_NAME = 'phame.blog.name'; | ||||
| const TYPE_DESCRIPTION = 'phame.blog.description'; | const TYPE_DESCRIPTION = 'phame.blog.description'; | ||||
| const TYPE_DOMAIN = 'phame.blog.domain'; | const TYPE_DOMAIN = 'phame.blog.domain'; | ||||
| const TYPE_SKIN = 'phame.blog.skin'; | |||||
| const TYPE_STATUS = 'phame.blog.status'; | const TYPE_STATUS = 'phame.blog.status'; | ||||
| const MAILTAG_DETAILS = 'phame-blog-details'; | const MAILTAG_DETAILS = 'phame-blog-details'; | ||||
| const MAILTAG_SUBSCRIBERS = 'phame-blog-subscribers'; | const MAILTAG_SUBSCRIBERS = 'phame-blog-subscribers'; | ||||
| const MAILTAG_OTHER = 'phame-blog-other'; | const MAILTAG_OTHER = 'phame-blog-other'; | ||||
| public function getApplicationName() { | public function getApplicationName() { | ||||
| return 'phame'; | return 'phame'; | ||||
| Show All 20 Lines | switch ($this->getTransactionType()) { | ||||
| if ($old === null) { | if ($old === null) { | ||||
| return 'fa-plus'; | return 'fa-plus'; | ||||
| } else { | } else { | ||||
| return 'fa-pencil'; | return 'fa-pencil'; | ||||
| } | } | ||||
| break; | break; | ||||
| case self::TYPE_DESCRIPTION: | case self::TYPE_DESCRIPTION: | ||||
| case self::TYPE_DOMAIN: | case self::TYPE_DOMAIN: | ||||
| case self::TYPE_SKIN: | |||||
| return 'fa-pencil'; | return 'fa-pencil'; | ||||
| case self::TYPE_STATUS: | case self::TYPE_STATUS: | ||||
| if ($new == PhameBlog::STATUS_ARCHIVED) { | if ($new == PhameBlog::STATUS_ARCHIVED) { | ||||
| return 'fa-ban'; | return 'fa-ban'; | ||||
| } else { | } else { | ||||
| return 'fa-check'; | return 'fa-check'; | ||||
| } | } | ||||
| break; | break; | ||||
| Show All 22 Lines | public function getMailTags() { | ||||
| switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_SUBSCRIBERS: | case PhabricatorTransactions::TYPE_SUBSCRIBERS: | ||||
| $tags[] = self::MAILTAG_SUBSCRIBERS; | $tags[] = self::MAILTAG_SUBSCRIBERS; | ||||
| break; | break; | ||||
| case self::TYPE_NAME: | case self::TYPE_NAME: | ||||
| case self::TYPE_DESCRIPTION: | case self::TYPE_DESCRIPTION: | ||||
| case self::TYPE_DOMAIN: | case self::TYPE_DOMAIN: | ||||
| case self::TYPE_SKIN: | |||||
| $tags[] = self::MAILTAG_DETAILS; | $tags[] = self::MAILTAG_DETAILS; | ||||
| break; | break; | ||||
| default: | default: | ||||
| $tags[] = self::MAILTAG_OTHER; | $tags[] = self::MAILTAG_OTHER; | ||||
| break; | break; | ||||
| } | } | ||||
| return $tags; | return $tags; | ||||
| } | } | ||||
| Show All 25 Lines | switch ($type) { | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| break; | break; | ||||
| case self::TYPE_DOMAIN: | case self::TYPE_DOMAIN: | ||||
| return pht( | return pht( | ||||
| '%s updated the blog\'s domain to "%s".', | '%s updated the blog\'s domain to "%s".', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $new); | $new); | ||||
| break; | break; | ||||
| case self::TYPE_SKIN: | |||||
| return pht( | |||||
| '%s updated the blog\'s skin to "%s".', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $new); | |||||
| break; | |||||
| case self::TYPE_STATUS: | case self::TYPE_STATUS: | ||||
| switch ($new) { | switch ($new) { | ||||
| case PhameBlog::STATUS_ACTIVE: | case PhameBlog::STATUS_ACTIVE: | ||||
| return pht( | return pht( | ||||
| '%s published this blog.', | '%s published this blog.', | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| case PhameBlog::STATUS_ARCHIVED: | case PhameBlog::STATUS_ARCHIVED: | ||||
| return pht( | return pht( | ||||
| Show All 35 Lines | switch ($type) { | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| break; | break; | ||||
| case self::TYPE_DOMAIN: | case self::TYPE_DOMAIN: | ||||
| return pht( | return pht( | ||||
| '%s updated the domain for %s.', | '%s updated the domain for %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| break; | break; | ||||
| case self::TYPE_SKIN: | |||||
| return pht( | |||||
| '%s updated the skin for %s.', | |||||
| $this->renderHandleLink($author_phid), | |||||
| $this->renderHandleLink($object_phid)); | |||||
| break; | |||||
| case self::TYPE_STATUS: | case self::TYPE_STATUS: | ||||
| switch ($new) { | switch ($new) { | ||||
| case PhameBlog::STATUS_ACTIVE: | case PhameBlog::STATUS_ACTIVE: | ||||
| return pht( | return pht( | ||||
| '%s published the blog %s.', | '%s published the blog %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| case PhameBlog::STATUS_ARCHIVED: | case PhameBlog::STATUS_ARCHIVED: | ||||
| Show All 37 Lines | |||||