Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/passphrase/xaction/PassphraseCredentialDescriptionTransaction.php
12256 views
1
<?php
2
3
final class PassphraseCredentialDescriptionTransaction
4
extends PassphraseCredentialTransactionType {
5
6
const TRANSACTIONTYPE = 'passphrase:description';
7
8
public function generateOldValue($object) {
9
return $object->getDescription();
10
}
11
12
public function applyInternalEffects($object, $value) {
13
$object->setDescription($value);
14
}
15
16
public function shouldHide() {
17
$old = $this->getOldValue();
18
if (!strlen($old)) {
19
return true;
20
}
21
return false;
22
}
23
24
public function getTitle() {
25
return pht(
26
'%s updated the description for this credential.',
27
$this->renderAuthor());
28
}
29
30
public function getTitleForFeed() {
31
return pht(
32
'%s updated the description for credential %s.',
33
$this->renderAuthor(),
34
$this->renderObject());
35
}
36
37
public function hasChangeDetailView() {
38
return true;
39
}
40
41
public function getMailDiffSectionHeader() {
42
return pht('CHANGES TO CREDENTIAL DESCRIPTION');
43
}
44
45
public function newChangeDetailView() {
46
$viewer = $this->getViewer();
47
48
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
49
->setViewer($viewer)
50
->setOldText($this->getOldValue())
51
->setNewText($this->getNewValue());
52
}
53
54
public function newRemarkupChanges() {
55
$changes = array();
56
57
$changes[] = $this->newRemarkupChange()
58
->setOldValue($this->getOldValue())
59
->setNewValue($this->getNewValue());
60
61
return $changes;
62
}
63
64
}
65
66