Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98064822
PholioRemarkupRule.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, Jan 9, 06:26
Size
914 B
Mime Type
text/x-php
Expires
Sat, Jan 11, 06:26 (1 d, 12 h)
Engine
blob
Format
Raw Data
Handle
23492364
Attached To
rPH Phabricator
PholioRemarkupRule.php
View Options
<?php
final
class
PholioRemarkupRule
extends
PhabricatorRemarkupRuleObject
{
protected
function
getObjectNamePrefix
()
{
return
'M'
;
}
protected
function
loadObjects
(
array
$ids
)
{
$viewer
=
$this
->
getEngine
()->
getConfig
(
'viewer'
);
return
id
(
new
PholioMockQuery
())
->
setViewer
(
$viewer
)
->
needImages
(
true
)
->
needTokenCounts
(
true
)
->
withIDs
(
$ids
)
->
execute
();
}
protected
function
renderObjectEmbed
(
$object
,
$handle
,
$options
)
{
$embed_mock
=
id
(
new
PholioMockEmbedView
())
->
setMock
(
$object
);
if
(
strlen
(
$options
))
{
$parser
=
new
PhutilSimpleOptions
();
$opts
=
$parser
->
parse
(
substr
(
$options
,
1
));
if
(
isset
(
$opts
[
'image'
]))
{
$images
=
array_unique
(
explode
(
'&'
,
preg_replace
(
'/
\s
+/'
,
''
,
$opts
[
'image'
])));
$embed_mock
->
setImages
(
$images
);
}
}
return
$embed_mock
->
render
();
}
}
Event Timeline
Log In to Comment