Remove product literal strings in "pht()", part 5
[phabricator.git] / src / applications / files / document / PhabricatorRemarkupDocumentEngine.php
blob053640af5f02ceadae9f519fbc25ae33b041809a
1 <?php
3 final class PhabricatorRemarkupDocumentEngine
4 extends PhabricatorDocumentEngine {
6 const ENGINEKEY = 'remarkup';
8 public function getViewAsLabel(PhabricatorDocumentRef $ref) {
9 return pht('View as Remarkup');
12 protected function getDocumentIconIcon(PhabricatorDocumentRef $ref) {
13 return 'fa-file-text-o';
16 protected function getContentScore(PhabricatorDocumentRef $ref) {
17 $name = $ref->getName();
19 if ($name !== null) {
20 if (preg_match('/\\.remarkup\z/i', $name)) {
21 return 2000;
25 return 500;
28 protected function canRenderDocumentType(PhabricatorDocumentRef $ref) {
29 return $ref->isProbablyText();
32 protected function newDocumentContent(PhabricatorDocumentRef $ref) {
33 $viewer = $this->getViewer();
35 $content = $ref->loadData();
36 $content = phutil_utf8ize($content);
38 $remarkup = new PHUIRemarkupView($viewer, $content);
40 $container = phutil_tag(
41 'div',
42 array(
43 'class' => 'document-engine-remarkup',
45 $remarkup);
47 return $container;