Path: blob/master/src/applications/paste/xaction/PhabricatorPasteStatusTransaction.php
12241 views
<?php12final class PhabricatorPasteStatusTransaction3extends PhabricatorPasteTransactionType {45const TRANSACTIONTYPE = 'paste.status';67public function generateOldValue($object) {8return $object->getStatus();9}1011public function applyInternalEffects($object, $value) {12$object->setStatus($value);13}1415private function isActivate() {16return ($this->getNewValue() == PhabricatorPaste::STATUS_ACTIVE);17}1819public function getIcon() {20if ($this->isActivate()) {21return 'fa-check';22} else {23return 'fa-ban';24}25}2627public function getColor() {28if ($this->isActivate()) {29return 'green';30} else {31return 'indigo';32}33}3435public function getTitle() {36if ($this->isActivate()) {37return pht(38'%s activated this paste.',39$this->renderAuthor());40} else {41return pht(42'%s archived this paste.',43$this->renderAuthor());44}45}4647public function getTitleForFeed() {48if ($this->isActivate()) {49return pht(50'%s activated %s.',51$this->renderAuthor(),52$this->renderObject());53} else {54return pht(55'%s archived %s.',56$this->renderAuthor(),57$this->renderObject());58}59}6061}626364