Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100696909
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
Sat, Feb 1, 23:34
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Feb 3, 23:34 (2 d)
Engine
blob
Format
Raw Data
Handle
24016202
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