Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F950079
PhabricatorRemarkupDocumentEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
(
$name
!==
null
)
{
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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 1:56 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
223993
Default Alt Text
PhabricatorRemarkupDocumentEngine.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment