Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/controller/PhrictionDocumentController.php
<?php | <?php | ||||
/** | |||||
* @group phriction | |||||
*/ | |||||
final class PhrictionDocumentController | final class PhrictionDocumentController | ||||
extends PhrictionController { | extends PhrictionController { | ||||
private $slug; | private $slug; | ||||
public function willProcessRequest(array $data) { | public function willProcessRequest(array $data) { | ||||
$this->slug = $data['slug']; | $this->slug = $data['slug']; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | if (!$document) { | ||||
pht('This document is empty. You can edit it to put some proper '. | pht('This document is empty. You can edit it to put some proper '. | ||||
'content here.')); | 'content here.')); | ||||
$core_content = $notice->render(); | $core_content = $notice->render(); | ||||
} else if ($current_status == PhrictionChangeType::CHANGE_MOVE_AWAY) { | } else if ($current_status == PhrictionChangeType::CHANGE_MOVE_AWAY) { | ||||
$new_doc_id = $content->getChangeRef(); | $new_doc_id = $content->getChangeRef(); | ||||
$new_doc = id(new PhrictionDocumentQuery()) | $new_doc = id(new PhrictionDocumentQuery()) | ||||
->setViewer($user) | ->setViewer($user) | ||||
->withIDs(array($new_doc_id)) | ->withIDs(array($new_doc_id)) | ||||
->exectueOne(); | ->executeOne(); | ||||
btrahan: that must have worked well | |||||
$slug_uri = PhrictionDocument::getSlugURI($new_doc->getSlug()); | $slug_uri = PhrictionDocument::getSlugURI($new_doc->getSlug()); | ||||
$notice = new AphrontErrorView(); | $notice = new AphrontErrorView(); | ||||
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); | $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); | ||||
$notice->setTitle(pht('Document Moved')); | $notice->setTitle(pht('Document Moved')); | ||||
$notice->appendChild(phutil_tag('p', array(), | $notice->appendChild(phutil_tag('p', array(), | ||||
pht('This document has been moved to %s. You can edit it to put new '. | pht('This document has been moved to %s. You can edit it to put new '. | ||||
▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines |
that must have worked well