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 |
1 | 24 | + 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 |
1 | 48 | + native |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -165,6 +165,7 @@ |
166 | 166 | 'ext-networkauth' => 'NetworkAuthMessageGroup', |
167 | 167 | 'ext-newestpages' => 'NewestPagesMessageGroup', |
168 | 168 | 'ext-newuserlog' => 'NewuserLogMessageGroup', |
| 169 | +'ext-newusermessage' => 'NewUserMessageMessageGroup', |
169 | 170 | 'ext-newusernotif' => 'NewUserNotifMessageGroup', |
170 | 171 | 'ext-nuke' => 'NukeMessageGroup', |
171 | 172 | 'ext-ogghandler' => 'OggHandlerMessageGroup', |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -1442,6 +1442,14 @@ |
1443 | 1443 | ); |
1444 | 1444 | } |
1445 | 1445 | |
| 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 | + |
1446 | 1454 | class NewUserNotifMessageGroup extends ExtensionMessageGroup { |
1447 | 1455 | protected $label = 'New User Notification'; |
1448 | 1456 | protected $id = 'ext-newusernotif'; |