r30813 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30812‎ | r30813 | r30814 >
Date:23:16, 10 February 2008
Author:siebrand
Status:old
Tags:
Comment:
* Import NewUserMessage from http://www.mediawiki.org/w/index.php?title=Extension:NewUserMessage&oldid=146872. Made a few adjustments (added descriptionmsg, bumped version).
* Add support for Translate
Modified paths:
  • /trunk/extensions/NewUserMessage (added) (history)
  • /trunk/extensions/NewUserMessage/NewUserMessage.i18n.php (added) (history)
  • /trunk/extensions/NewUserMessage/NewUserMessage.php (added) (history)
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NewUserMessage/NewUserMessage.i18n.php
@@ -0,0 +1,22 @@
 2+<?php
 3+/**
 4+ * Internationalisation file for extension NewUserMessage.
 5+ *
 6+ * @addtogroup Extensions
 7+ */
 8+
 9+$messages = array();
 10+
 11+/* English
 12+ * @author [http://www.organicdesign.co.nz/User:Nad Nad]
 13+ */
 14+$messages['en'] = array(
 15+ 'newusermessage-desc' => "Add a [[MediaWiki:NewUserMessage|message]] to newly created user's talk pages",
 16+);
 17+
 18+/* Dutch (Nederlands)
 19+ * @author Siebrand
 20+ */
 21+$messages['nl'] = array(
 22+ 'newusermessage-desc' => 'Voegt een [[MediaWiki:NewUserMessage|bericht]] toe aan de overlegpagina van nieuwe gebruikers',
 23+);
Property changes on: trunk/extensions/NewUserMessage/NewUserMessage.i18n.php
___________________________________________________________________
Added: svn:eol-style
124 + native
Index: trunk/extensions/NewUserMessage/NewUserMessage.php
@@ -0,0 +1,46 @@
 2+<?php
 3+/** Extension:NewUserMessage
 4+ *
 5+ * @package MediaWiki
 6+ * @subpackage Extensions
 7+ *
 8+ * @author [http://www.organicdesign.co.nz/nad User:Nad]
 9+ * @license LGPL (http://www.gnu.org/copyleft/lesser.html)
 10+ * @copyright 2007-10-15 [http://www.organicdesign.co.nz/nad User:Nad]
 11+ */
 12+
 13+if (!defined('MEDIAWIKI'))
 14+ die('Not an entry point.');
 15+
 16+define('NEWUSERMESSAGE_VERSION','1.0.1, 2008-02-10');
 17+
 18+$wgNewUserMessageTemplate = 'MediaWiki:NewUserMessage';
 19+
 20+$wgExtensionMessagesFiles['NewUserMessage'] = dirname(__FILE__) . '/NewUserMessage.i18n.php';
 21+$wgHooks['AddNewAccount'][] = 'wfCreateNewUserMessage';
 22+
 23+$wgExtensionCredits['other'][] = array(
 24+ 'name' => 'NewUserMessage',
 25+ 'version' => NEWUSERMESSAGE_VERSION,
 26+ 'author' => "[http://www.organicdesign.co.nz/User:Nad Nad]",
 27+ 'description' => "Add a [[MediaWiki:NewUserMessage|message]] to newly created user's talk pages",
 28+ 'descriptionmsg' => 'newusermessage-desc',
 29+ 'url' => 'http://www.mediawiki.org/wiki/Extension:NewUserMessage',
 30+);
 31+
 32+/*
 33+ * Add the template message if the users talk page doesn't already exist
 34+ */
 35+function wfCreateNewUserMessage($user) {
 36+ global $wgNewUserMessageTemplate;
 37+
 38+ $name = $user->getName();
 39+ $talk = $user->getTalkPage();
 40+
 41+ if (!$talk->exists()) {
 42+ $article = new Article($talk);
 43+ $article->insertNewArticle('{'.'{'."$wgNewUserMessageTemplate|$name}}",false,false,true,false);
 44+ }
 45+
 46+ return true;
 47+}
Property changes on: trunk/extensions/NewUserMessage/NewUserMessage.php
___________________________________________________________________
Added: svn:eol-style
148 + native
Index: trunk/extensions/Translate/Translate.php
@@ -165,6 +165,7 @@
166166 'ext-networkauth' => 'NetworkAuthMessageGroup',
167167 'ext-newestpages' => 'NewestPagesMessageGroup',
168168 'ext-newuserlog' => 'NewuserLogMessageGroup',
 169+'ext-newusermessage' => 'NewUserMessageMessageGroup',
169170 'ext-newusernotif' => 'NewUserNotifMessageGroup',
170171 'ext-nuke' => 'NukeMessageGroup',
171172 'ext-ogghandler' => 'OggHandlerMessageGroup',
Index: trunk/extensions/Translate/MessageGroups.php
@@ -1442,6 +1442,14 @@
14431443 );
14441444 }
14451445
 1446+class NewUserMessageMessageGroup extends ExtensionMessageGroup {
 1447+ protected $label = 'New User Message';
 1448+ protected $id = 'ext-newusermessage';
 1449+
 1450+ protected $arrName = 'messages';
 1451+ protected $messageFile = 'NewUserMessage/NewUserMessage.i18n.php';
 1452+}
 1453+
14461454 class NewUserNotifMessageGroup extends ExtensionMessageGroup {
14471455 protected $label = 'New User Notification';
14481456 protected $id = 'ext-newusernotif';

Status & tagging log