Differential D20800 Diff 49604 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 287 Lines • ▼ Show 20 Lines | if (!$document) { | ||||
'content here, or use history to revert to an earlier '. | 'content here, or use history to revert to an earlier '. | ||||
'version.'))); | 'version.'))); | ||||
} | } | ||||
$core_content = $notice->render(); | $core_content = $notice->render(); | ||||
} else { | } else { | ||||
throw new Exception(pht("Unknown document status '%s'!", $doc_status)); | throw new Exception(pht("Unknown document status '%s'!", $doc_status)); | ||||
} | } | ||||
$move_notice = null; | |||||
if ($current_status == PhrictionChangeType::CHANGE_MOVE_HERE) { | |||||
$from_doc_id = $content->getChangeRef(); | |||||
$slug_uri = null; | |||||
// If the old document exists and is visible, provide a link to it. | |||||
$from_docs = id(new PhrictionDocumentQuery()) | |||||
->setViewer($viewer) | |||||
->withIDs(array($from_doc_id)) | |||||
->execute(); | |||||
if ($from_docs) { | |||||
$from_doc = head($from_docs); | |||||
$slug_uri = PhrictionDocument::getSlugURI($from_doc->getSlug()); | |||||
} | |||||
$move_notice = id(new PHUIInfoView()) | |||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE); | |||||
if ($slug_uri) { | |||||
$move_notice->appendChild( | |||||
pht( | |||||
'This document was moved from %s.', | |||||
phutil_tag('a', array('href' => $slug_uri), $slug_uri))); | |||||
} else { | |||||
// Render this for consistency, even though it's a bit silly. | |||||
$move_notice->appendChild( | |||||
pht('This document was moved from elsewhere.')); | |||||
} | |||||
} | |||||
} | } | ||||
$children = $this->renderDocumentChildren($slug); | $children = $this->renderDocumentChildren($slug); | ||||
$curtain = null; | $curtain = null; | ||||
if ($document->getID()) { | if ($document->getID()) { | ||||
$curtain = $this->buildCurtain($document, $content); | $curtain = $this->buildCurtain($document, $content); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 370 Lines • Show Last 20 Lines |