Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99372185
PhabricatorRemarkupDocumentEngine.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 23, 23:14
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jan 25, 23:14 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23776728
Attached To
rPH Phabricator
PhabricatorRemarkupDocumentEngine.php
View Options
<?php
final
class
PhabricatorRemarkupDocumentEngine
extends
PhabricatorDocumentEngine
{
const
ENGINEKEY
=
'remarkup'
;
public
function
getViewAsLabel
(
PhabricatorDocumentRef
$ref
)
{
return
pht
(
'View as Remarkup'
);
}
protected
function
getDocumentIconIcon
(
PhabricatorDocumentRef
$ref
)
{
return
'fa-file-text-o'
;
}
protected
function
getContentScore
(
PhabricatorDocumentRef
$ref
)
{
$name
=
$ref
->
getName
();
if
(
preg_match
(
'/
\\
.remarkup
\z
/i'
,
$name
))
{
return
2000
;
}
return
500
;
}
protected
function
canRenderDocumentType
(
PhabricatorDocumentRef
$ref
)
{
return
$ref
->
isProbablyText
();
}
protected
function
newDocumentContent
(
PhabricatorDocumentRef
$ref
)
{
$viewer
=
$this
->
getViewer
();
$content
=
$ref
->
loadData
();
$content
=
phutil_utf8ize
(
$content
);
$remarkup
=
new
PHUIRemarkupView
(
$viewer
,
$content
);
$container
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'document-engine-remarkup'
,
),
$remarkup
);
return
$container
;
}
}
Event Timeline
Log In to Comment