Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/82570
Change subject: Add a required footer to all messages
......................................................................
Add a required footer to all messages
Individual wikis can customize the "massmessage-message-footer"
message to add a footer to any message *sent* from that
project.
Change-Id: I680141519675bf6b7bdcc8075d6feb0e6fc104a7
---
M MassMessage.i18n.php
M SpecialMassMessage.php
2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage
refs/changes/70/82570/1
diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
index e27cdc1..f884a0b 100644
--- a/MassMessage.i18n.php
+++ b/MassMessage.i18n.php
@@ -38,6 +38,7 @@
'logentry-massmessage-send' => '$1 {{GENDER:$2|sent a message}} to $3',
'logentry-massmessage-failure' => 'Delivery of "$4" to $3 failed with
an error code of <code>$5</code>',
'massmessage-cannot-rename' => 'This is a system account and cannot be
renamed.',
+ 'massmessage-message-footer' => '',
);
/** Message documentation (Message documentation)
@@ -90,6 +91,7 @@
* $4 is the subject line of the message
* $5 is the API error code. This will always be in English.',
'massmessage-cannot-rename' => 'Error message a user sees when they try
renaming the bot account.',
+ 'massmessage-message-footer' => 'The footer that is by added at the end
of very message. It is left blank so individual wikis can customize it.',
);
/** Bengali (বাংলা)
diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php
index c8fe026..e234400 100644
--- a/SpecialMassMessage.php
+++ b/SpecialMassMessage.php
@@ -158,6 +158,12 @@
return $this->status;
}
+ // Add a global footer
+ $footer = $this->msg( 'massmessage-message-footer'
)->inContentLanguage()->parse();
+ $data['message'] .= "\n" . $footer;
+ // If the footer is empty, we don't want the extra newline
+ $data['message'] .= trim( $data['message'] );
+
if ( $this->state == 'submit' ) {
return $this->submit( $data );
} else { // $this->state can only be 'preview' here
--
To view, visit https://gerrit.wikimedia.org/r/82570
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I680141519675bf6b7bdcc8075d6feb0e6fc104a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits