Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/editor/PhabricatorPasteEditor.php
| <?php | <?php | ||||
| final class PhabricatorPasteEditor | final class PhabricatorPasteEditor | ||||
| extends PhabricatorApplicationTransactionEditor { | extends PhabricatorApplicationTransactionEditor { | ||||
| private $newPasteTitle; | |||||
| public function getNewPasteTitle() { | |||||
| return $this->newPasteTitle; | |||||
| } | |||||
| public function getEditorApplicationClass() { | public function getEditorApplicationClass() { | ||||
| return 'PhabricatorPasteApplication'; | return 'PhabricatorPasteApplication'; | ||||
| } | } | ||||
| public function getEditorObjectsDescription() { | public function getEditorObjectsDescription() { | ||||
| return pht('Pastes'); | return pht('Pastes'); | ||||
| } | } | ||||
| Show All 10 Lines | public function getTransactionTypes() { | ||||
| $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; | $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; | ||||
| $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; | $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; | ||||
| $types[] = PhabricatorTransactions::TYPE_COMMENT; | $types[] = PhabricatorTransactions::TYPE_COMMENT; | ||||
| return $types; | return $types; | ||||
| } | } | ||||
| protected function expandTransactions( | |||||
| PhabricatorLiskDAO $object, | |||||
| array $xactions) { | |||||
| $new_title = $object->getTitle(); | |||||
| foreach ($xactions as $xaction) { | |||||
| $type = $xaction->getTransactionType(); | |||||
| if ($type === PhabricatorPasteTitleTransaction::TRANSACTIONTYPE) { | |||||
| $new_title = $xaction->getNewValue(); | |||||
| } | |||||
| } | |||||
| $this->newPasteTitle = $new_title; | |||||
| return parent::expandTransactions($object, $xactions); | |||||
| } | |||||
| protected function shouldSendMail( | protected function shouldSendMail( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| array $xactions) { | array $xactions) { | ||||
| if ($this->getIsNewObject()) { | if ($this->getIsNewObject()) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||