Differential D19093 Diff 45773 src/applications/phriction/controller/PhrictionDocumentController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/controller/PhrictionDocumentController.php
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | if (!$document) { | ||||
$properties = $this | $properties = $this | ||||
->buildPropertyListView($document, $content, $slug); | ->buildPropertyListView($document, $content, $slug); | ||||
$doc_status = $document->getStatus(); | $doc_status = $document->getStatus(); | ||||
$current_status = $content->getChangeType(); | $current_status = $content->getChangeType(); | ||||
if ($current_status == PhrictionChangeType::CHANGE_EDIT || | if ($current_status == PhrictionChangeType::CHANGE_EDIT || | ||||
$current_status == PhrictionChangeType::CHANGE_MOVE_HERE) { | $current_status == PhrictionChangeType::CHANGE_MOVE_HERE) { | ||||
$core_content = $content->renderContent($viewer); | $remarkup_view = $content->newRemarkupView($viewer); | ||||
$toc = $this->getToc($content); | |||||
$core_content = $remarkup_view->render(); | |||||
$toc = $remarkup_view->getTableOfContents(); | |||||
$toc = $this->getToc($toc); | |||||
} else if ($current_status == PhrictionChangeType::CHANGE_DELETE) { | } else if ($current_status == PhrictionChangeType::CHANGE_DELETE) { | ||||
$notice = new PHUIInfoView(); | $notice = new PHUIInfoView(); | ||||
$notice->setSeverity(PHUIInfoView::SEVERITY_NOTICE); | $notice->setSeverity(PHUIInfoView::SEVERITY_NOTICE); | ||||
$notice->setTitle(pht('Document Deleted')); | $notice->setTitle(pht('Document Deleted')); | ||||
$notice->appendChild( | $notice->appendChild( | ||||
pht('This document has been deleted. You can edit it to put new '. | pht('This document has been deleted. You can edit it to put new '. | ||||
'content here, or use history to revert to an earlier version.')); | 'content here, or use history to revert to an earlier version.')); | ||||
▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | private function renderChildDocumentLink(array $info) { | ||||
return $item; | return $item; | ||||
} | } | ||||
protected function getDocumentSlug() { | protected function getDocumentSlug() { | ||||
return $this->slug; | return $this->slug; | ||||
} | } | ||||
protected function getToc(PhrictionContent $content) { | protected function getToc($toc) { | ||||
$toc = $content->getRenderedTableOfContents(); | |||||
if ($toc) { | if ($toc) { | ||||
$toc = phutil_tag_div('phui-document-toc-content', array( | $toc = phutil_tag_div('phui-document-toc-content', array( | ||||
phutil_tag_div( | phutil_tag_div( | ||||
'phui-document-toc-header', | 'phui-document-toc-header', | ||||
pht('Contents')), | pht('Contents')), | ||||
$toc, | $toc, | ||||
)); | )); | ||||
} | } | ||||
return $toc; | return $toc; | ||||
} | } | ||||
} | } |