Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97566632
PhabricatorFeedStoryPhriction.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
Sun, Jan 5, 08:27
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 7, 08:27 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23345968
Attached To
rPH Phabricator
PhabricatorFeedStoryPhriction.php
View Options
<?php
final
class
PhabricatorFeedStoryPhriction
extends
PhabricatorFeedStory
{
public
function
getPrimaryObjectPHID
()
{
return
$this
->
getValue
(
'phid'
);
}
public
function
renderView
()
{
$data
=
$this
->
getStoryData
();
$author_phid
=
$data
->
getAuthorPHID
();
$document_phid
=
$data
->
getValue
(
'phid'
);
$view
=
new
PhabricatorFeedStoryView
();
$action
=
$data
->
getValue
(
'action'
);
$verb
=
PhrictionActionConstants
::
getActionPastTenseVerb
(
$action
);
$view
->
setTitle
(
$this
->
linkTo
(
$author_phid
).
" {$verb} the document "
.
$this
->
linkTo
(
$document_phid
).
'.'
);
$view
->
setEpoch
(
$data
->
getEpoch
());
$action
=
$data
->
getValue
(
'action'
);
switch
(
$action
)
{
case
PhrictionActionConstants
::
ACTION_CREATE
:
$full_size
=
true
;
break
;
default
:
$full_size
=
false
;
break
;
}
if
(
$full_size
)
{
$view
->
setImage
(
$this
->
getHandle
(
$author_phid
)->
getImageURI
());
$content
=
$this
->
renderSummary
(
$data
->
getValue
(
'content'
));
$view
->
appendChild
(
$content
);
}
else
{
$view
->
setOneLineStory
(
true
);
}
return
$view
;
}
public
function
renderText
()
{
$author_name
=
$this
->
getHandle
(
$this
->
getAuthorPHID
())->
getLinkName
();
$document_handle
=
$this
->
getHandle
(
$this
->
getPrimaryObjectPHID
());
$document_title
=
$document_handle
->
getLinkName
();
$document_uri
=
PhabricatorEnv
::
getURI
(
$document_handle
->
getURI
());
$action
=
$this
->
getValue
(
'action'
);
$verb
=
PhrictionActionConstants
::
getActionPastTenseVerb
(
$action
);
$text
=
"{$author_name} {$verb} the document"
.
"{$document_title} {$document_uri}"
;
return
$text
;
}
}
Event Timeline
Log In to Comment