Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14005276
D7477.id16855.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7477.id16855.diff
View Options
Index: src/applications/phriction/editor/PhrictionDocumentEditor.php
===================================================================
--- src/applications/phriction/editor/PhrictionDocumentEditor.php
+++ src/applications/phriction/editor/PhrictionDocumentEditor.php
@@ -286,6 +286,22 @@
return $this;
}
+ private function getChangeTypeDescription($const, $title) {
+ $map = array(
+ PhrictionChangeType::CHANGE_EDIT =>
+ pht("Phriction Document %s was edited.", $title),
+ PhrictionChangeType::CHANGE_DELETE =>
+ pht("Phriction Document %s was deleted.", $title),
+ PhrictionChangeType::CHANGE_MOVE_HERE =>
+ pht("Phriction Document %s was moved here.", $title),
+ PhrictionChangeType::CHANGE_MOVE_AWAY =>
+ pht("Phriction Document %s was moved away.", $title),
+ PhrictionChangeType::CHANGE_STUB =>
+ pht("Phriction Document %s was created through child.", $title),
+ );
+ return idx($map, $const, pht('Something magical occurred.'));
+ }
+
private function sendMailToSubscribers(array $subscribers, $old_content) {
if (!$subscribers) {
return;
@@ -304,14 +320,9 @@
$old_title = $old_content->getTitle();
$title = $content->getTitle();
-
- // TODO: Currently, this produces something like
- // Phriction Document Xyz was Edit
- // I'm too lazy to build my own action string everywhere
- // Plus, it does not have pht() anyway
+ $name = $this->getChangeTypeDescription($content->getChangeType(), $title);
$action = PhrictionChangeType::getChangeTypeLabel(
$content->getChangeType());
- $name = pht("Phriction Document %s was %s", $title, $action);
$body = array($name);
// Content may have changed, you never know
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 28, 10:35 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715132
Default Alt Text
D7477.id16855.diff (1 KB)
Attached To
Mode
D7477: Fix Phriction email language
Attached
Detach File
Event Timeline
Log In to Comment