Path: blob/master/src/applications/legalpad/xaction/LegalpadDocumentTextTransaction.php
13463 views
<?php12final class LegalpadDocumentTextTransaction3extends LegalpadDocumentTransactionType {45const TRANSACTIONTYPE = 'text';67public function generateOldValue($object) {8$body = $object->getDocumentBody();9return $body->getText();10}1112public function applyInternalEffects($object, $value) {13$body = $object->getDocumentBody();14$body->setText($value);15$object->attachDocumentBody($body);16}1718public function getTitle() {19$old = $this->getOldValue();2021if (!strlen($old)) {22return pht(23'%s set the document text.',24$this->renderAuthor());25} else {26return pht(27'%s updated the document text.',28$this->renderAuthor());29}30}3132public function getTitleForFeed() {33return pht(34'%s updated the document text for %s.',35$this->renderAuthor(),36$this->renderObject());37}3839public function hasChangeDetailView() {40return true;41}4243public function getMailDiffSectionHeader() {44return pht('CHANGES TO DOCUMENT TEXT');45}4647public function newChangeDetailView() {48$viewer = $this->getViewer();4950return id(new PhabricatorApplicationTransactionTextDiffDetailView())51->setViewer($viewer)52->setOldText($this->getOldValue())53->setNewText($this->getNewValue());54}5556public function newRemarkupChanges() {57$changes = array();5859$changes[] = $this->newRemarkupChange()60->setOldValue($this->getOldValue())61->setNewValue($this->getNewValue());6263return $changes;64}656667}686970