Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/macro/xaction/PhabricatorMacroDisabledTransaction.php
12241 views
1
<?php
2
3
final class PhabricatorMacroDisabledTransaction
4
extends PhabricatorMacroTransactionType {
5
6
const TRANSACTIONTYPE = 'macro:disabled';
7
8
public function generateOldValue($object) {
9
return $object->getIsDisabled();
10
}
11
12
public function applyInternalEffects($object, $value) {
13
$object->setIsDisabled($value);
14
}
15
16
public function getTitle() {
17
if ($this->getNewValue()) {
18
return pht(
19
'%s disabled this macro.',
20
$this->renderAuthor());
21
} else {
22
return pht(
23
'%s restored this macro.',
24
$this->renderAuthor());
25
}
26
}
27
28
public function getTitleForFeed() {
29
if ($this->getNewValue()) {
30
return pht(
31
'%s disabled %s.',
32
$this->renderAuthor(),
33
$this->renderObject());
34
} else {
35
return pht(
36
'%s restored %s.',
37
$this->renderAuthor(),
38
$this->renderObject());
39
}
40
}
41
42
public function getIcon() {
43
if ($this->getNewValue()) {
44
return 'fa-ban';
45
} else {
46
return 'fa-check';
47
}
48
}
49
50
}
51
52