1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 20:52:43 +01:00
phorge-phorge/src/applications/transactions/xaction/PhabricatorEditEngineDisableTransaction.php

52 lines
1,013 B
PHP
Raw Normal View History

<?php
final class PhabricatorEditEngineDisableTransaction
extends PhabricatorEditEngineTransactionType {
const TRANSACTIONTYPE = 'editengine.config.disable';
public function generateOldValue($object) {
return (int)$object->getIsDisabled();
}
public function generateNewValue($object, $value) {
return (int)$value;
}
public function applyInternalEffects($object, $value) {
$object->setIsDisabled($value);
}
public function getTitle() {
$new = $this->getNewValue();
if ($new) {
return pht(
'%s disabled this form.',
$this->renderAuthor());
} else {
return pht(
'%s enabled this form.',
$this->renderAuthor());
}
}
public function getColor() {
$new = $this->getNewValue();
if ($new) {
return 'indigo';
} else {
return 'green';
}
}
public function getIcon() {
$new = $this->getNewValue();
if ($new) {
return 'fa-ban';
} else {
return 'fa-check';
}
}
}