r66697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66696‎ | r66697 | r66698 >
Date:18:33, 20 May 2010
Author:mah
Status:deferred
Tags:
Comment:
* Get rid of the LQT-specific new-user message templates … no need for them.
* Add hook to “format” user messages.
Modified paths:
  • /trunk/extensions/LiquidThreads/LiquidThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/Hooks.php (modified) (history)
  • /trunk/extensions/LiquidThreads/i18n/Lqt.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/i18n/Lqt.i18n.php
@@ -315,9 +315,6 @@
316316 // Reply subpage name
317317 'lqt-reply-subpage' => 'reply',
318318
319 - // New User Welcome Message
320 - 'lqt-newusermessage-template-subject' => 'Template:Welcome-subject',
321 - 'lqt-newusermessage-template-body' => 'Template:Welcome-body',
322319 );
323320
324321 /** Message documentation (Message documentation)
@@ -522,8 +519,6 @@
523520 'lqt-reply-subpage' => 'Part of the page title when a LiquidThread answer is given. Should probably be translated as a noun and not as a verb.
524521
525522 {{Identical|Reply}}',
526 - 'lqt-newusermessage-template-subject' => 'Always substituted. Used if LiquidThreads is enabled in the User_talk namespace. Do not translate or duplicate this message to other languages',
527 - 'lqt-newusermessage-template-body' => 'Used if LiquidThreads is enabled in the User_talk namespace. Do not translate or duplicate this message to other languages',
528523 );
529524
530525 /** Faeag Rotuma (Faeag Rotuma)
Index: trunk/extensions/LiquidThreads/LiquidThreads.php
@@ -100,6 +100,7 @@
101101 // New User Messages
102102 $wgHooks['SetupNewUserMessageSubject'][] = 'LqtHooks::setupNewUserMessageSubject';
103103 $wgHooks['SetupNewUserMessageBody'][] = 'LqtHooks::setupNewUserMessageBody';
 104+$wgHooks['FormatUserMessage'][] = 'LqtHooks::formatUserMessage';
104105
105106 // User Message
106107 $wgHooks['SetupUserMessageArticle'][] = 'LqtHooks::setupUserMessageArticle';
Index: trunk/extensions/LiquidThreads/classes/Hooks.php
@@ -484,35 +484,6 @@
485485 return true;
486486 }
487487
488 - static function setupNewUserMessageSubject( &$subject ) {
489 - wfLoadExtensionMessages( 'LiquidThreads' );
490 -
491 - $subject = self::getTextForPageInKey( 'lqt-newusermessage-template-subject' );
492 -
493 - // Let someone else take over if we didn't get a valid subject
494 - if ( !$subject ) {
495 - wfDebug( __METHOD__ . ": no text found for the subject\n" );
496 - return true;
497 - }
498 -
499 - return false;
500 - }
501 -
502 - static function setupNewUserMessageBody( &$text ) {
503 - wfLoadExtensionMessages( 'LiquidThreads' );
504 -
505 - // Get the body text
506 - $text = self::getTextForPageInKey( 'lqt-newusermessage-template-body' );
507 -
508 - // Let someone else take over if we didn't get a valid body
509 - if ( !$text ) {
510 - wfDebug( __METHOD__ . ": no text found for the body\n" );
511 - return true;
512 - }
513 -
514 - return false;
515 - }
516 -
517488 static function setupUserMessageArticle( $user, &$article, $subject, $text, $signature, $summary, $editor ) {
518489 global $wgLqtTalkPages;
519490
@@ -530,6 +501,14 @@
531502 return true;
532503 }
533504
 505+ /**
 506+ * Take care of formatting a user message. We don't really need
 507+ * to do anything, we just need to stop others from doing stuff.
 508+ */
 509+ static function formatUserMessage( $subject, &$text, $signature ) {
 510+ return false;
 511+ }
 512+
534513 static function afterUserMessage( $user, $article, $subject, $text, $signature, $summary, $editor ) {
535514 global $wgLqtTalkPages;
536515 $talk = $user->getTalkPage();

Follow-up revisions

RevisionCommit summaryAuthorDate
r66699Follow-up r66697: Update for translatewikiraymond18:53, 20 May 2010

Status & tagging log