Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121361113
PhabricatorFeedStoryAudit.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 10, 07:15
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jul 12, 07:15 (2 d)
Engine
blob
Format
Raw Data
Handle
27315240
Attached To
rPH Phabricator
PhabricatorFeedStoryAudit.php
View Options
<?php
final
class
PhabricatorFeedStoryAudit
extends
PhabricatorFeedStory
{
public
function
getPrimaryObjectPHID
()
{
return
$this
->
getStoryData
()->
getValue
(
'commitPHID'
);
}
public
function
renderView
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$commit_phid
=
$this
->
getPrimaryObjectPHID
();
$view
=
new
PhabricatorFeedStoryView
();
$action
=
$this
->
getValue
(
'action'
);
$verb
=
PhabricatorAuditActionConstants
::
getActionPastTenseVerb
(
$action
);
$view
->
setTitle
(
hsprintf
(
'%s %s commit %s.'
,
$this
->
linkTo
(
$author_phid
),
$verb
,
$this
->
linkTo
(
$commit_phid
)));
$view
->
setEpoch
(
$this
->
getEpoch
());
$comments
=
$this
->
getValue
(
'content'
);
if
(
$comments
)
{
$full_size
=
true
;
}
else
{
$full_size
=
false
;
}
if
(
$full_size
)
{
$view
->
setImage
(
$this
->
getHandle
(
$author_phid
)->
getImageURI
());
$content
=
$this
->
renderSummary
(
$this
->
getValue
(
'content'
));
$view
->
appendChild
(
$content
);
}
else
{
$view
->
setOneLineStory
(
true
);
}
return
$view
;
}
public
function
renderText
()
{
$author_name
=
$this
->
getHandle
(
$this
->
getAuthorPHID
())->
getLinkName
();
$commit_path
=
$this
->
getHandle
(
$this
->
getPrimaryObjectPHID
())->
getURI
();
$commit_uri
=
PhabricatorEnv
::
getURI
(
$commit_path
);
$action
=
$this
->
getValue
(
'action'
);
$verb
=
PhabricatorAuditActionConstants
::
getActionPastTenseVerb
(
$action
);
$text
=
"{$author_name} {$verb} commit {$commit_uri}"
;
return
$text
;
}
}
Event Timeline
Log In to Comment