Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/94692


Change subject: Use a [[wikilink]] to display local targets
......................................................................

Use a [[wikilink]] to display local targets

Change-Id: I43af5690f411e3a2fe91d4031b903fee6f876518
---
M MassMessage.hooks.php
M MassMessage.i18n.php
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/92/94692/1

diff --git a/MassMessage.hooks.php b/MassMessage.hooks.php
index 5be2ba8..7a3e03b 100644
--- a/MassMessage.hooks.php
+++ b/MassMessage.hooks.php
@@ -60,7 +60,7 @@
         * @return array
         */
        public static function outputParserFunction( Parser $parser, $page, 
$site = '' ) {
-               global $wgScript;
+               global $wgScript, $wgAllowGlobalMessaging;
 
                $data = self::verifyPFData( $page, $site );
                if ( isset( $data['error'] ) ) {
@@ -71,7 +71,11 @@
                $page = $data['title'];
 
                // Use a message so wikis can customize the output
-               $msg = wfMessage( 'massmessage-target' )->params( $site, 
$wgScript, $page )->plain();
+               if ( $wgAllowGlobalMessaging ) {
+                       $msg = wfMessage( 'massmessage-target' )->params( 
$site, $wgScript, $page )->plain();
+               } else {
+                       $msg = wfMessage( 'massmessage-target-local' )->params( 
$page )->plain();
+               }
 
                return array( $msg, 'noparse' => false );
        }
diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
index 992ab66..da7cd50 100644
--- a/MassMessage.i18n.php
+++ b/MassMessage.i18n.php
@@ -29,6 +29,7 @@
        'massmessage-unescaped-langlinks' => 'Warning: There are unescaped 
language links in your message.',
        'massmessage-form-header' => 'Use the form below to send messages to a 
specified list. All fields are required.',
        'massmessage-target' => '[//$1$2?title={{urlencode:$3|WIKI}} $3]',
+       'massmessage-target-local' => '[[$1]]',
        'massmessage-queued-count' => 'Queued [[Special:MassMessage|mass 
messages]]',
        'massmessage-hidden-comment' => '<!-- Message sent by User:$1@$2 using 
the list at $3 -->',
        'massmessage-optout-category' => 'Opted-out of message delivery',
@@ -88,6 +89,8 @@
 * $1 is the domain (example: "en.wikipedia.org")
 * $2 is <code>$wgScriptPath</code> (example: "/w/index.php")
 * $3 the page name (example: "User talk:Example")',
+       'massmessage-target-local' => 'Used to display the {{#target}} 
parserfunction on sites where global messaging is disabled.
+* $1 is the page title',
        'massmessage-queued-count' => 'Text for row on [[Special:Statistics]].',
        'massmessage-hidden-comment' => 'A hidden HTML comment that is appended 
after the message. Parameters:
 * $1 - the username of the user who sent the message

-- 
To view, visit https://gerrit.wikimedia.org/r/94692
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43af5690f411e3a2fe91d4031b903fee6f876518
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

Reply via email to