コード例 #1
0
 public function getRemarkupBodyForFeed(PhabricatorFeedStory $story)
 {
     $text = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_TITLE:
             if ($this->getOldValue() === null) {
                 $post = $story->getPrimaryObject();
                 $text = $post->getBody();
             }
             break;
         case self::TYPE_VISIBILITY:
             if ($this->getNewValue() == PhameConstants::VISIBILITY_PUBLISHED) {
                 $post = $story->getPrimaryObject();
                 $text = $post->getBody();
             }
             break;
         case self::TYPE_BODY:
             $text = $this->getNewValue();
             break;
     }
     return $text;
 }
コード例 #2
0
 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $text = null;
     switch ($this->getTransactionType()) {
         case PholioTransactionType::TYPE_NAME:
             if ($this->getOldValue() === null) {
                 $mock = $story->getPrimaryObject();
                 $text = $mock->getDescription();
             }
             break;
         case PholioTransactionType::TYPE_INLINE:
             $text = $this->getComment()->getContent();
             break;
     }
     if ($text) {
         return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($text));
     }
     return parent::getBodyForFeed($story);
 }
コード例 #3
0
 public function getRemarkupBodyForFeed(PhabricatorFeedStory $story)
 {
     $text = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_NAME:
             if ($this->getOldValue() === null) {
                 $mock = $story->getPrimaryObject();
                 $text = $mock->getDescription();
             }
             break;
         case self::TYPE_INLINE:
             $text = $this->getComment()->getContent();
             break;
     }
     return $text;
 }
コード例 #4
0
 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $text = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_TITLE:
             if ($this->getOldValue() === null) {
                 $post = $story->getPrimaryObject();
                 $text = $post->getBody();
             }
             break;
         case self::TYPE_VISIBILITY:
             if ($this->getNewValue() == PhameConstants::VISIBILITY_PUBLISHED) {
                 $post = $story->getPrimaryObject();
                 $text = $post->getBody();
             }
             break;
         case self::TYPE_BODY:
             $text = $this->getNewValue();
             break;
     }
     if (strlen($text)) {
         return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($text));
     }
     return parent::getBodyForFeed($story);
 }