r34695 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34694‎ | r34695 | r34696 >
Date:22:05, 12 May 2008
Author:nad
Status:old
Tags:
Comment:
add and settings
Modified paths:
  • /trunk/extensions/NewUserMessage/NewUserMessage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NewUserMessage/NewUserMessage.php
@@ -12,10 +12,23 @@
1313 if (!defined('MEDIAWIKI'))
1414 die('Not an entry point.');
1515
16 -define('NEWUSERMESSAGE_VERSION','1.1, 2008-05-05');
 16+define('NEWUSERMESSAGE_VERSION','1.1.1, 2008-05-13');
1717
 18+// Specify a template to wrap the new user message within
1819 $wgNewUserMessageTemplate = 'MediaWiki:NewUserMessage';
1920
 21+// Set the username of the user that makes the edit on user talk pages. If
 22+// this user does not exist, the new user will show up as editing user.
 23+$wgNewUserMessageEditor = 'Admin';
 24+
 25+// Sepcify whether or not the new user message creation should show up in recent changes
 26+$wgNewUserSupressRC = false;
 27+
 28+// Should the new user message creation be a minor edit?
 29+$wgNewUserMinorEdit = true;
 30+
 31+
 32+
2033 $wgExtensionMessagesFiles['NewUserMessage'] = dirname(__FILE__) . '/NewUserMessage.i18n.php';
2134 $wgHooks['AddNewAccount'][] = 'wfCreateNewUserMessage';
2235
@@ -28,15 +41,11 @@
2942 'url' => 'http://www.mediawiki.org/wiki/Extension:NewUserMessage',
3043 );
3144
32 -// Set the username of the user that makes the edit on user talk pages. If
33 -// this user does not exist, the new user will show up as editing user.
34 -$wgNewUserMessageEditor = 'Admin';
35 -
3645 /*
3746 * Add the template message if the users talk page doesn't already exist
3847 */
3948 function wfCreateNewUserMessage($user) {
40 - global $wgNewUserMessageTemplate;
 49+ global $wgNewUserMessageTemplate, $wgNewUserMinorEdit, $wgNewUserSupressRC;
4150
4251 $name = $user->getName();
4352 $talk = $user->getTalkPage();
@@ -57,7 +66,11 @@
5867 $wgUser = $parkedWgUser;
5968 }
6069
61 - $article->doEdit('{'.'{'."$wgNewUserMessageTemplate|$name}}", false, EDIT_MINOR);
 70+ $flags = 0;
 71+ if ($wgNewUserMinorEdit) $flags = $flags | EDIT_MINOR;
 72+ if ($wgNewUserSupressRC) $flags = $flags | EDIT_SUPPRESS_RC;
 73+
 74+ $article->doEdit('{'.'{'."$wgNewUserMessageTemplate|$name}}", false, $flags);
6275 $wgUser = $parkedWgUser;
6376 }
6477

Status & tagging log