Ejemplo n.º 1
0
 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $new = $this->getNewValue();
     $body = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_CONTENT:
             return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($new));
             break;
     }
     return parent::getBodyForFeed($story);
 }
Ejemplo n.º 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);
 }
 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);
 }
 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     $new = $this->getNewValue();
     $old = $this->getOldValue();
     $body = null;
     switch ($this->getTransactionType()) {
         case self::TYPE_TITLE:
             if ($old === null) {
                 $question = $story->getObject($this->getObjectPHID());
                 return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($question->getContent()));
             }
             break;
         case self::TYPE_ANSWERS:
             $answer = $this->getNewAnswerObject($story);
             if ($answer) {
                 return phutil_escape_html_newlines(id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(128)->truncateString($answer->getContent()));
             }
             break;
     }
     return parent::getBodyForFeed($story);
 }
 public function getBodyForFeed(PhabricatorFeedStory $story)
 {
     switch ($this->getTransactionType()) {
         case self::TYPE_COMMIT:
             $data = $this->getNewValue();
             return $story->renderSummary($data['summary']);
     }
     return parent::getBodyForFeed($story);
 }