Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/PhabricatorTextDocumentEngine.php
<?php | <?php | ||||
abstract class PhabricatorTextDocumentEngine | abstract class PhabricatorTextDocumentEngine | ||||
extends PhabricatorDocumentEngine { | extends PhabricatorDocumentEngine { | ||||
protected function canRenderDocumentType(PhabricatorDocumentRef $ref) { | protected function canRenderDocumentType(PhabricatorDocumentRef $ref) { | ||||
return $ref->isProbablyText(); | return $ref->isProbablyText(); | ||||
} | } | ||||
protected function newTextDocumentContent($content) { | protected function newTextDocumentContent($content) { | ||||
$lines = phutil_split_lines($content); | $lines = phutil_split_lines($content); | ||||
$view = id(new PhabricatorSourceCodeView()) | $view = id(new PhabricatorSourceCodeView()) | ||||
->setLines($lines) | ->setHighlights($this->getHighlightedLines()) | ||||
->disableHighlightOnClick(); | ->setLines($lines); | ||||
$container = phutil_tag( | $container = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'document-engine-text', | 'class' => 'document-engine-text', | ||||
), | ), | ||||
$view); | $view); | ||||
Show All 10 Lines |