Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editengine/PhabricatorEditEngine.php
| Show First 20 Lines • Show All 1,777 Lines • ▼ Show 20 Lines | if ($actions) { | ||||
| 'value' => $field->getValueForTransaction(), | 'value' => $field->getValueForTransaction(), | ||||
| )); | )); | ||||
| foreach ($type_xactions as $type_xaction) { | foreach ($type_xactions as $type_xaction) { | ||||
| $xactions[] = $type_xaction; | $xactions[] = $type_xaction; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| $auto_xactions = $this->newAutomaticCommentTransactions($object); | |||||
| foreach ($auto_xactions as $xaction) { | |||||
| $xactions[] = $xaction; | |||||
| } | |||||
| if (strlen($comment_text) || !$xactions) { | if (strlen($comment_text) || !$xactions) { | ||||
| $xactions[] = id(clone $template) | $xactions[] = id(clone $template) | ||||
| ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ||||
| ->attachComment( | ->attachComment( | ||||
| id(clone $comment_template) | id(clone $comment_template) | ||||
| ->setContent($comment_text)); | ->setContent($comment_text)); | ||||
| } | } | ||||
| Show All 15 Lines | private function buildCommentResponse($object) { | ||||
| if (!$is_preview) { | if (!$is_preview) { | ||||
| PhabricatorVersionedDraft::purgeDrafts( | PhabricatorVersionedDraft::purgeDrafts( | ||||
| $object->getPHID(), | $object->getPHID(), | ||||
| $viewer->getPHID(), | $viewer->getPHID(), | ||||
| $this->loadDraftVersion($object)); | $this->loadDraftVersion($object)); | ||||
| } | } | ||||
| if ($request->isAjax() && $is_preview) { | if ($request->isAjax() && $is_preview) { | ||||
| $preview_content = $this->newCommentPreviewContent($object, $xactions); | |||||
| return id(new PhabricatorApplicationTransactionResponse()) | return id(new PhabricatorApplicationTransactionResponse()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->setTransactions($xactions) | ->setTransactions($xactions) | ||||
| ->setIsPreview($is_preview); | ->setIsPreview($is_preview) | ||||
| ->setPreviewContent($preview_content); | |||||
| } else { | } else { | ||||
| return id(new AphrontRedirectResponse()) | return id(new AphrontRedirectResponse()) | ||||
| ->setURI($view_uri); | ->setURI($view_uri); | ||||
| } | } | ||||
| } | } | ||||
| /* -( Conduit )------------------------------------------------------------ */ | /* -( Conduit )------------------------------------------------------------ */ | ||||
| ▲ Show 20 Lines • Show All 330 Lines • ▼ Show 20 Lines | public function getEditAction() { | ||||
| $request = $controller->getRequest(); | $request = $controller->getRequest(); | ||||
| return $request->getURIData('editAction'); | return $request->getURIData('editAction'); | ||||
| } | } | ||||
| protected function newCommentActionGroups() { | protected function newCommentActionGroups() { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| protected function newAutomaticCommentTransactions($object) { | |||||
| return array(); | |||||
| } | |||||
| protected function newCommentPreviewContent($object, array $xactions) { | |||||
| return null; | |||||
| } | |||||
| /* -( Form Pages )--------------------------------------------------------- */ | /* -( Form Pages )--------------------------------------------------------- */ | ||||
| public function getSelectedPage() { | public function getSelectedPage() { | ||||
| return $this->page; | return $this->page; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines | |||||