Differential D19301 Diff 46202 src/applications/files/document/render/PhabricatorFileDocumentRenderingEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/render/PhabricatorFileDocumentRenderingEngine.php
- This file was added.
<?php | |||||
final class PhabricatorFileDocumentRenderingEngine | |||||
extends PhabricatorDocumentRenderingEngine { | |||||
protected function newRefViewURI( | |||||
PhabricatorDocumentRef $ref, | |||||
PhabricatorDocumentEngine $engine) { | |||||
$file = $ref->getFile(); | |||||
$engine_key = $engine->getDocumentEngineKey(); | |||||
return urisprintf( | |||||
'/file/view/%d/%s/', | |||||
$file->getID(), | |||||
$engine_key); | |||||
} | |||||
protected function newRefRenderURI( | |||||
PhabricatorDocumentRef $ref, | |||||
PhabricatorDocumentEngine $engine) { | |||||
$file = $ref->getFile(); | |||||
if (!$file) { | |||||
throw new PhutilMethodNotImplementedException(); | |||||
} | |||||
$engine_key = $engine->getDocumentEngineKey(); | |||||
$file_phid = $file->getPHID(); | |||||
return urisprintf( | |||||
'/file/document/%s/%s/', | |||||
$engine_key, | |||||
$file_phid); | |||||
} | |||||
protected function addApplicationCrumbs( | |||||
PhabricatorDocumentRef $ref, | |||||
PHUICrumbsView $crumbs) { | |||||
$file = $ref->getFile(); | |||||
if ($file) { | |||||
$crumbs->addTextCrumb($file->getMonogram(), $file->getInfoURI()); | |||||
} | |||||
} | |||||
} |