Page MenuHomePhabricator

D21755.id51862.diff
No OneTemporary

D21755.id51862.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -5288,6 +5288,7 @@
'PhamePostEditConduitAPIMethod' => 'applications/phame/conduit/PhamePostEditConduitAPIMethod.php',
'PhamePostEditController' => 'applications/phame/controller/post/PhamePostEditController.php',
'PhamePostEditEngine' => 'applications/phame/editor/PhamePostEditEngine.php',
+ 'PhamePostEditEngineLock' => 'applications/phame/editor/PhamePostEditEngineLock.php',
'PhamePostEditor' => 'applications/phame/editor/PhamePostEditor.php',
'PhamePostFerretEngine' => 'applications/phame/search/PhamePostFerretEngine.php',
'PhamePostFulltextEngine' => 'applications/phame/search/PhamePostFulltextEngine.php',
@@ -12182,6 +12183,7 @@
'PhabricatorDestructibleInterface',
'PhabricatorTokenReceiverInterface',
'PhabricatorConduitResultInterface',
+ 'PhabricatorEditEngineLockableInterface',
'PhabricatorFulltextInterface',
'PhabricatorFerretInterface',
),
@@ -12192,6 +12194,7 @@
'PhamePostEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'PhamePostEditController' => 'PhamePostController',
'PhamePostEditEngine' => 'PhabricatorEditEngine',
+ 'PhamePostEditEngineLock' => 'PhabricatorEditEngineLock',
'PhamePostEditor' => 'PhabricatorApplicationTransactionEditor',
'PhamePostFerretEngine' => 'PhabricatorFerretEngine',
'PhamePostFulltextEngine' => 'PhabricatorFulltextEngine',
diff --git a/src/applications/phame/editor/PhamePostEditEngineLock.php b/src/applications/phame/editor/PhamePostEditEngineLock.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phame/editor/PhamePostEditEngineLock.php
@@ -0,0 +1,29 @@
+<?php
+
+final class PhamePostEditEngineLock
+ extends PhabricatorEditEngineLock {
+
+ public function willPromptUserForLockOverrideWithDialog(
+ AphrontDialogView $dialog) {
+
+ return $dialog
+ ->setTitle(pht('Edit Locked Post'))
+ ->appendParagraph(
+ pht('Comments are disabled for this post. Edit it anyway?'))
+ ->addSubmitButton(pht('Edit Post'));
+ }
+
+ public function willBlockUserInteractionWithDialog(
+ AphrontDialogView $dialog) {
+
+ return $dialog
+ ->setTitle(pht('Post Locked'))
+ ->appendParagraph(
+ pht('You can not interact with this post because it is locked.'));
+ }
+
+ public function getLockedObjectDisplayText() {
+ return pht('Comments have been disabled for this post.');
+ }
+
+}
diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -11,6 +11,7 @@
PhabricatorDestructibleInterface,
PhabricatorTokenReceiverInterface,
PhabricatorConduitResultInterface,
+ PhabricatorEditEngineLockableInterface,
PhabricatorFulltextInterface,
PhabricatorFerretInterface {
@@ -393,4 +394,11 @@
return new PhamePostFerretEngine();
}
+
+/* -( PhabricatorEditEngineLockableInterface )----------------------------- */
+
+ public function newEditEngineLock() {
+ return new PhamePostEditEngineLock();
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 1:54 AM (1 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7549840
Default Alt Text
D21755.id51862.diff (3 KB)

Event Timeline