Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/storage/PhabricatorPasteTransaction.php
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | public function getTitle() { | ||||
| $author_phid = $this->getAuthorPHID(); | $author_phid = $this->getAuthorPHID(); | ||||
| $object_phid = $this->getObjectPHID(); | $object_phid = $this->getObjectPHID(); | ||||
| $old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
| $new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
| $type = $this->getTransactionType(); | $type = $this->getTransactionType(); | ||||
| switch ($type) { | switch ($type) { | ||||
| case PhabricatorPasteTransaction::TYPE_CONTENT: | case self::TYPE_CONTENT: | ||||
| if ($old === null) { | if ($old === null) { | ||||
| return pht( | return pht( | ||||
| '%s created this paste.', | '%s created this paste.', | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| } else { | } else { | ||||
| return pht( | return pht( | ||||
| '%s edited the content of this paste.', | '%s edited the content of this paste.', | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| } | } | ||||
| break; | break; | ||||
| case PhabricatorPasteTransaction::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
| return pht( | return pht( | ||||
| '%s updated the paste\'s title to "%s".', | '%s updated the paste\'s title to "%s".', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $new); | $new); | ||||
| break; | break; | ||||
| case PhabricatorPasteTransaction::TYPE_LANGUAGE: | case self::TYPE_LANGUAGE: | ||||
| return pht( | return pht( | ||||
| "%s updated the paste's language.", | "%s updated the paste's language.", | ||||
| $this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
| break; | break; | ||||
| } | } | ||||
| return parent::getTitle(); | return parent::getTitle(); | ||||
| } | } | ||||
| public function getTitleForFeed() { | public function getTitleForFeed() { | ||||
| $author_phid = $this->getAuthorPHID(); | $author_phid = $this->getAuthorPHID(); | ||||
| $object_phid = $this->getObjectPHID(); | $object_phid = $this->getObjectPHID(); | ||||
| $old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
| $new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
| $type = $this->getTransactionType(); | $type = $this->getTransactionType(); | ||||
| switch ($type) { | switch ($type) { | ||||
| case PhabricatorPasteTransaction::TYPE_CONTENT: | case self::TYPE_CONTENT: | ||||
| if ($old === null) { | if ($old === null) { | ||||
| return pht( | return pht( | ||||
| '%s created %s.', | '%s created %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| } else { | } else { | ||||
| return pht( | return pht( | ||||
| '%s edited %s.', | '%s edited %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| } | } | ||||
| break; | break; | ||||
| case PhabricatorPasteTransaction::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
| return pht( | return pht( | ||||
| '%s updated the title for %s.', | '%s updated the title for %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| break; | break; | ||||
| case PhabricatorPasteTransaction::TYPE_LANGUAGE: | case self::TYPE_LANGUAGE: | ||||
| return pht( | return pht( | ||||
| '%s updated the language for %s.', | '%s updated the language for %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| break; | break; | ||||
| } | } | ||||
| return parent::getTitleForFeed(); | return parent::getTitleForFeed(); | ||||
| ▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines | |||||