[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorFeedStoryAudit extends PhabricatorFeedStory { 4 5 public function getPrimaryObjectPHID() { 6 return $this->getStoryData()->getValue('commitPHID'); 7 } 8 9 public function renderView() { 10 $author_phid = $this->getAuthorPHID(); 11 $commit_phid = $this->getPrimaryObjectPHID(); 12 13 $view = $this->newStoryView(); 14 $view->setAppIcon('audit-dark'); 15 16 $action = $this->getValue('action'); 17 $verb = PhabricatorAuditActionConstants::getActionPastTenseVerb($action); 18 19 $view->setTitle(hsprintf( 20 '%s %s commit %s.', 21 $this->linkTo($author_phid), 22 $verb, 23 $this->linkTo($commit_phid))); 24 25 $comments = $this->getValue('content'); 26 $view->setImage($this->getHandle($author_phid)->getImageURI()); 27 28 if ($comments) { 29 $content = $this->renderSummary($this->getValue('content')); 30 $view->appendChild($content); 31 } 32 33 return $view; 34 } 35 36 public function renderText() { 37 $author_name = $this->getHandle($this->getAuthorPHID())->getLinkName(); 38 39 $commit_path = $this->getHandle($this->getPrimaryObjectPHID())->getURI(); 40 $commit_uri = PhabricatorEnv::getURI($commit_path); 41 42 $action = $this->getValue('action'); 43 $verb = PhabricatorAuditActionConstants::getActionPastTenseVerb($action); 44 45 $text = "{$author_name} {$verb} commit {$commit_uri}"; 46 47 return $text; 48 } 49 50 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |