Path: blob/master/src/applications/files/document/PhabricatorRemarkupDocumentEngine.php
12241 views
<?php12final class PhabricatorRemarkupDocumentEngine3extends PhabricatorDocumentEngine {45const ENGINEKEY = 'remarkup';67public function getViewAsLabel(PhabricatorDocumentRef $ref) {8return pht('View as Remarkup');9}1011protected function getDocumentIconIcon(PhabricatorDocumentRef $ref) {12return 'fa-file-text-o';13}1415protected function getContentScore(PhabricatorDocumentRef $ref) {16$name = $ref->getName();1718if ($name !== null) {19if (preg_match('/\\.remarkup\z/i', $name)) {20return 2000;21}22}2324return 500;25}2627protected function canRenderDocumentType(PhabricatorDocumentRef $ref) {28return $ref->isProbablyText();29}3031protected function newDocumentContent(PhabricatorDocumentRef $ref) {32$viewer = $this->getViewer();3334$content = $ref->loadData();35$content = phutil_utf8ize($content);3637$remarkup = new PHUIRemarkupView($viewer, $content);3839$container = phutil_tag(40'div',41array(42'class' => 'document-engine-remarkup',43),44$remarkup);4546return $container;47}4849}505152