Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phame / xaction / PhameBlogStatusTransaction.php
blobb3366bece71a4bc10b683c876ddceae0fa005cb7
1 <?php
3 final class PhameBlogStatusTransaction
4 extends PhameBlogTransactionType {
6 const TRANSACTIONTYPE = 'phame.blog.status';
8 public function generateOldValue($object) {
9 return $object->getStatus();
12 public function applyInternalEffects($object, $value) {
13 $object->setStatus($value);
16 public function getTitle() {
17 $new = $this->getNewValue();
18 switch ($new) {
19 case PhameBlog::STATUS_ACTIVE:
20 return pht(
21 '%s published this blog.',
22 $this->renderAuthor());
23 case PhameBlog::STATUS_ARCHIVED:
24 return pht(
25 '%s archived this blog.',
26 $this->renderAuthor());
30 public function getTitleForFeed() {
31 $new = $this->getNewValue();
32 switch ($new) {
33 case PhameBlog::STATUS_ACTIVE:
34 return pht(
35 '%s published the blog %s.',
36 $this->renderAuthor(),
37 $this->renderObject());
38 case PhameBlog::STATUS_ARCHIVED:
39 return pht(
40 '%s archived the blog %s.',
41 $this->renderAuthor(),
42 $this->renderObject());
46 public function getIcon() {
47 $new = $this->getNewValue();
48 if ($new == PhameBlog::STATUS_ARCHIVED) {
49 return 'fa-ban';
50 } else {
51 return 'fa-check';