Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100912519
PhabricatorSourceDocumentEngine.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
Mon, Feb 3, 21:31
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Feb 5, 21:31 (2 d)
Engine
blob
Format
Raw Data
Handle
24033393
Attached To
rPH Phabricator
PhabricatorSourceDocumentEngine.php
View Options
<?php
final
class
PhabricatorSourceDocumentEngine
extends
PhabricatorTextDocumentEngine
{
const
ENGINEKEY
=
'source'
;
public
function
getViewAsLabel
(
PhabricatorDocumentRef
$ref
)
{
return
pht
(
'View as Source'
);
}
public
function
canConfigureHighlighting
(
PhabricatorDocumentRef
$ref
)
{
return
true
;
}
protected
function
getDocumentIconIcon
(
PhabricatorDocumentRef
$ref
)
{
return
'fa-code'
;
}
protected
function
getContentScore
(
PhabricatorDocumentRef
$ref
)
{
return
1500
;
}
protected
function
newDocumentContent
(
PhabricatorDocumentRef
$ref
)
{
$content
=
$this
->
loadTextData
(
$ref
);
$highlighting
=
$this
->
getHighlightingConfiguration
();
if
(
$highlighting
!==
null
)
{
$content
=
PhabricatorSyntaxHighlighter
::
highlightWithLanguage
(
$highlighting
,
$content
);
}
else
{
$content
=
PhabricatorSyntaxHighlighter
::
highlightWithFilename
(
$ref
->
getName
(),
$content
);
}
return
$this
->
newTextDocumentContent
(
$content
);
}
}
Event Timeline
Log In to Comment