Differential D19307 Diff 46206 src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | final public function newDocumentView(PhabricatorDocumentRef $ref) { | ||||
$icon = $engine->newDocumentIcon($ref); | $icon = $engine->newDocumentIcon($ref); | ||||
if ($engine->shouldRenderAsync($ref)) { | if ($engine->shouldRenderAsync($ref)) { | ||||
$content = $engine->newLoadingContent($ref); | $content = $engine->newLoadingContent($ref); | ||||
$config = array( | $config = array( | ||||
'renderControlID' => $control_id, | 'renderControlID' => $control_id, | ||||
); | ); | ||||
} else { | } else { | ||||
$this->willRenderRef($ref); | |||||
$content = $engine->newDocument($ref); | $content = $engine->newDocument($ref); | ||||
$config = array(); | $config = array(); | ||||
} | } | ||||
Javelin::initBehavior('document-engine', $config); | Javelin::initBehavior('document-engine', $config); | ||||
$viewport = phutil_tag( | $viewport = phutil_tag( | ||||
'div', | 'div', | ||||
Show All 37 Lines | final public function newDocumentView(PhabricatorDocumentRef $ref) { | ||||
return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->appendChild($viewport); | ->appendChild($viewport); | ||||
} | } | ||||
final public function newRenderResponse(PhabricatorDocumentRef $ref) { | final public function newRenderResponse(PhabricatorDocumentRef $ref) { | ||||
$this->willRenderRef($ref); | |||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$viewer = $request->getViewer(); | $viewer = $request->getViewer(); | ||||
$engines = PhabricatorDocumentEngine::getEnginesForRef($viewer, $ref); | $engines = PhabricatorDocumentEngine::getEnginesForRef($viewer, $ref); | ||||
$engine_key = $this->getSelectedDocumentEngineKey(); | $engine_key = $this->getSelectedDocumentEngineKey(); | ||||
if (!isset($engines[$engine_key])) { | if (!isset($engines[$engine_key])) { | ||||
return $this->newErrorResponse( | return $this->newErrorResponse( | ||||
pht( | pht( | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | abstract class PhabricatorDocumentRenderingEngine | ||||
} | } | ||||
protected function addApplicationCrumbs( | protected function addApplicationCrumbs( | ||||
PHUICrumbsView $crumbs, | PHUICrumbsView $crumbs, | ||||
PhabricatorDocumentRef $ref = null) { | PhabricatorDocumentRef $ref = null) { | ||||
return; | return; | ||||
} | } | ||||
protected function willRenderRef(PhabricatorDocumentRef $ref) { | |||||
return; | |||||
} | |||||
} | } |