Index: trunk/extensions/NewUserNotif/NewUserNotif.class.php |
— | — | @@ -10,10 +10,10 @@ |
11 | 11 | require_once( 'UserMailer.php' ); |
12 | 12 | |
13 | 13 | class NewUserNotifier { |
14 | | - |
| 14 | + |
15 | 15 | private $sender; |
16 | 16 | private $user; |
17 | | - |
| 17 | + |
18 | 18 | /** |
19 | 19 | * Constructor |
20 | 20 | */ |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | */ |
31 | 31 | public function execute( $user ) { |
32 | 32 | $this->user = $user; |
| 33 | + wfLoadExtensionMessages( 'NewUserNotifier' ); |
33 | 34 | $this->sendExternalMails(); |
34 | 35 | $this->sendInternalMails(); |
35 | 36 | } |
— | — | @@ -47,7 +48,7 @@ |
48 | 49 | ); |
49 | 50 | } |
50 | 51 | } |
51 | | - |
| 52 | + |
52 | 53 | /** |
53 | 54 | * Send email to users |
54 | 55 | */ |
— | — | @@ -64,7 +65,7 @@ |
65 | 66 | } |
66 | 67 | } |
67 | 68 | } |
68 | | - |
| 69 | + |
69 | 70 | /** |
70 | 71 | * Initialise a user from an identifier or a username |
71 | 72 | * |
— | — | @@ -95,7 +96,7 @@ |
96 | 97 | $wgContLang->timeAndDate( wfTimestampNow() ) |
97 | 98 | ); |
98 | 99 | } |
99 | | - |
| 100 | + |
100 | 101 | /** |
101 | 102 | * Hook account creation |
102 | 103 | * |
— | — | @@ -107,5 +108,4 @@ |
108 | 109 | $notifier->execute( $user ); |
109 | 110 | return true; |
110 | 111 | } |
111 | | - |
112 | | -} |
\ No newline at end of file |
| 112 | +} |
Index: trunk/extensions/NewUserNotif/NewUserNotif.i18n.php |
— | — | @@ -1,154 +1,147 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | | - * Internationalisation file for the New User Email Notification extension |
6 | | - * |
| 4 | + * Internationalisation file for the extension New User Email Notification |
7 | 5 | * @addtogroup Extensions |
8 | 6 | * @author Rob Church <robchur@gmail.com> |
9 | 7 | */ |
10 | 8 | |
11 | | -function efNewUserNotifMessages() { |
12 | | - $messages = array( |
13 | | - |
14 | | -'en' => array( |
| 9 | +$messages = array(); |
| 10 | + |
| 11 | +/* English |
| 12 | + * @author Rob Church |
| 13 | + */ |
| 14 | +$messages['en'] = array( |
15 | 15 | 'newusernotifsubj' => 'New User Notification for $1', |
16 | 16 | 'newusernotifbody' => "Hello $1,\n\nA new user account, $2, has been created on $3 at $4.", |
17 | | -), |
| 17 | +); |
18 | 18 | |
19 | | -'ar' => array( |
| 19 | +$messages['ar'] = array( |
20 | 20 | 'newusernotifsubj' => 'إخطار مستخدم جديد ل$1', |
21 | 21 | 'newusernotifbody' => 'مرحبا يا $1، |
22 | 22 | |
23 | 23 | حساب مستخدم جديد، $2، تم إنشاؤه على $3 في $4.', |
24 | | -), |
| 24 | +); |
25 | 25 | |
26 | 26 | /** Bulgarian (Български) |
27 | 27 | * @author DCLXVI |
28 | 28 | */ |
29 | | -'bg' => array( |
| 29 | +$messages['bg'] = array( |
30 | 30 | 'newusernotifsubj' => 'Съобщение за нов потребител в $1', |
31 | 31 | 'newusernotifbody' => 'Здравейте $1, |
32 | 32 | |
33 | 33 | В $3 беше регистрирана нова потребителска сметка, $2, на $4.', |
34 | | -), |
| 34 | +); |
35 | 35 | |
36 | | -'de' => array( |
| 36 | +$messages['de'] = array( |
37 | 37 | 'newusernotifsubj' => 'Benachrichtung für $1 über die Einrichtung eines neuen Benutzerskontos', |
38 | 38 | 'newusernotifbody' => "Hallo $1,\n\nEin neues Benutzerkonto, $2, wurde am $4 auf $3 angelegt.", |
39 | | -), |
| 39 | +); |
40 | 40 | |
41 | | -'fr' => array( |
| 41 | +$messages['fr'] = array( |
42 | 42 | 'newusernotifsubj' => 'Notification d’un nouvel utilisateur pour $1', |
43 | 43 | 'newusernotifbody' => "Bonjour $1,\n\nUn nouveau compte utilisateur, $2, a été créé sur $3 le $4.", |
44 | | -), |
| 44 | +); |
45 | 45 | |
46 | | -'gl' => array( |
| 46 | +$messages['gl'] = array( |
47 | 47 | 'newusernotifsubj' => 'Notificación de novo usuario para $1', |
48 | 48 | 'newusernotifbody' => 'Ola $1, |
49 | 49 | |
50 | 50 | Unha nova conta de usuario, $2, foi creada sobre $3 en $4.', |
51 | | -), |
| 51 | +); |
52 | 52 | |
53 | | -'hsb' => array( |
| 53 | +$messages['hsb'] = array( |
54 | 54 | 'newusernotifsubj' => 'Zdźělenka za noweho wužiwarja $1', |
55 | 55 | 'newusernotifbody' => 'Witaj $1, |
56 | 56 | |
57 | 57 | Nowe wužiwarske konto, $2, bu dnja $4 na $3 wutworjene.', |
58 | | -), |
| 58 | +); |
59 | 59 | |
60 | | -'hy' => array( |
| 60 | +$messages['hy'] = array( |
61 | 61 | 'newusernotifsubj' => 'Նոր Մասնակցի Տեղեկացում $1 մասնակցի համար', |
62 | 62 | 'newusernotifbody' => 'Ողջո՜ւյն, $1։ |
63 | 63 | |
64 | 64 | $3 կայքում ստեղծվել է նոր մասնակցային հաշիվ՝ $2, $4-ին։', |
65 | | -), |
| 65 | +); |
66 | 66 | |
67 | | -'nl' => array( |
| 67 | +$messages['nl'] = array( |
68 | 68 | 'newusernotifsubj' => 'Melding van een nieuwe gebruiker op $1', |
69 | 69 | 'newusernotifbody' => 'Hallo $1. |
70 | 70 | |
71 | 71 | Er is een nieuwe gebruiker $2 aangemaakt om $3 op $4.', |
72 | | -), |
| 72 | +); |
73 | 73 | |
74 | | -'no' => array( |
| 74 | +$messages['no'] = array( |
75 | 75 | 'newusernotifsubj' => 'Beskjed om ny bruker for $1', |
76 | 76 | 'newusernotifbody' => 'Hei, $1. En ny brukerkonto, $2, ble opprettet på $3 $4.', |
77 | | -), |
| 77 | +); |
78 | 78 | |
79 | | -'oc' => array( |
| 79 | +$messages['oc'] = array( |
80 | 80 | 'newusernotifsubj' => 'Notificacion d’un utilizaire novèl per $1', |
81 | 81 | 'newusernotifbody' => 'Adissiatz $1, Un compte novèl d\'utilizaire, $2, es estat creat sus $3 lo $4.', |
82 | | -), |
| 82 | +); |
83 | 83 | |
84 | | -'pl' => array( |
| 84 | +$messages['pl'] = array( |
85 | 85 | 'newusernotifsubj' => 'Powiadamianie użytkownika $1 o nowych użytkownikach', |
86 | 86 | 'newusernotifbody' => 'Witaj $1, nowe konto użytkownika, $2, zostało stworzone w dniu $3 o $4.', |
87 | | -), |
| 87 | +); |
88 | 88 | |
89 | | -'pms' => array( |
| 89 | +$messages['pms'] = array( |
90 | 90 | 'newusernotifsubj' => 'Notìfica d\'utent neuv për $1', |
91 | 91 | 'newusernotifbody' => 'Bondì $1, un neuv utent, $2, a l\'é stait creà ansima a $3 dël $4.', |
92 | | -), |
| 92 | +); |
93 | 93 | |
94 | 94 | /** Slovak (Slovenčina) |
95 | 95 | * @author Helix84 |
96 | 96 | */ |
97 | | -'sk' => array( |
| 97 | +$messages['sk'] = array( |
98 | 98 | 'newusernotifsubj' => 'Upozornenie na nových používateľov pre $1', |
99 | 99 | 'newusernotifbody' => 'Ahoj $1, |
100 | 100 | |
101 | 101 | $3 na $4 bol vytvorený nový používateľský účet $2.', |
102 | | -), |
| 102 | +); |
103 | 103 | |
104 | 104 | /** ћирилица (ћирилица) |
105 | 105 | * @author Sasa Stefanovic |
106 | 106 | */ |
107 | | -'sr-ec' => array( |
| 107 | +$messages['sr-ec'] = array( |
108 | 108 | 'newusernotifsubj' => 'Нови корисник за $1', |
109 | 109 | 'newusernotifbody' => 'Здраво $1 |
110 | 110 | Нови кориснички налог, $2, је направљен на $3 у $4.', |
111 | | -), |
| 111 | +); |
112 | 112 | |
113 | 113 | /** Seeltersk (Seeltersk) |
114 | 114 | * @author Pyt |
115 | 115 | */ |
116 | | -'stq' => array( |
| 116 | +$messages['stq'] = array( |
117 | 117 | 'newusernotifsubj' => 'Bescheedtällen foar $1 uur ju Iengjuchtenge fon n näi Benutserkonto', |
118 | 118 | 'newusernotifbody' => 'Hallo $1, |
119 | 119 | |
120 | 120 | N näi Benutserkonto, $2, wuude ap n $4 ap $3 anlaid.', |
121 | | -), |
| 121 | +); |
122 | 122 | |
123 | | -'tet' => array( |
| 123 | +$messages['tet'] = array( |
124 | 124 | 'newusernotifsubj' => 'Mensajen kona-ba uza-na\'in foun ba $1', |
125 | 125 | 'newusernotifbody' => 'Olá $1,\n\nuza-na\'in foun, $2, registrar tiha iha $3 iha loron $4.', |
126 | | -), |
| 126 | +); |
127 | 127 | |
128 | | -'yue' => array( |
| 128 | +$messages['yue'] = array( |
129 | 129 | 'newusernotifsubj' => '$1嘅新用戶通知', |
130 | 130 | 'newusernotifbody' => "你好 $1,\n\n一個新嘅用戶戶口$2,已經響$4喺$3度開咗。", |
131 | | -), |
| 131 | +); |
132 | 132 | |
133 | | -'zh-hans' => array( |
| 133 | +$messages['zh-hans'] = array( |
134 | 134 | 'newusernotifsubj' => '$1的新用户通知', |
135 | 135 | 'newusernotifbody' => "你好 $1,\n\n一个新的用户账号$2,已经在$4于$3创建。", |
136 | | -), |
| 136 | +); |
137 | 137 | |
138 | | -'zh-hant' => array( |
| 138 | +$messages['zh-hant'] = array( |
139 | 139 | 'newusernotifsubj' => '$1的新用戶通知', |
140 | 140 | 'newusernotifbody' => "你好 $1,\n\n一個新的用戶帳號$2,已經在$4於$3創建。", |
141 | | -), |
142 | | - |
143 | | - ); |
| 141 | +); |
144 | 142 | |
145 | | - /* Chinese defaults, fallback to zh-hans or zh-hant */ |
146 | | - $messages['zh'] = $messages['zh-hans']; |
147 | | - $messages['zh-cn'] = $messages['zh-hans']; |
148 | | - $messages['zh-hk'] = $messages['zh-hant']; |
149 | | - $messages['zh-sg'] = $messages['zh-hans']; |
150 | | - $messages['zh-tw'] = $messages['zh-hant']; |
151 | | - /* Cantonese default, fallback to yue */ |
152 | | - $messages['zh-yue'] = $messages['yue']; |
153 | | - |
154 | | - return $messages; |
155 | | -} |
| 143 | +$messages['zh'] = $messages['zh-hans']; |
| 144 | +$messages['zh-cn'] = $messages['zh-hans']; |
| 145 | +$messages['zh-hk'] = $messages['zh-hant']; |
| 146 | +$messages['zh-sg'] = $messages['zh-hans']; |
| 147 | +$messages['zh-tw'] = $messages['zh-hant']; |
| 148 | +$messages['zh-yue'] = $messages['yue']; |
Index: trunk/extensions/NewUserNotif/README |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | NEW USER EMAIL NOTIFICATION EXTENSION |
3 | 3 | |
4 | | - Version 1.4 |
| 4 | + Version 1.5 |
5 | 5 | © 2006-2007 Rob Church |
6 | 6 | |
7 | 7 | This is free software licenced under the GNU General Public Licence. Please |
Index: trunk/extensions/NewUserNotif/NewUserNotif.php |
— | — | @@ -1,4 +1,6 @@ |
2 | 2 | <?php |
| 3 | +if ( ! defined( 'MEDIAWIKI' ) ) |
| 4 | + die(); |
3 | 5 | |
4 | 6 | /** |
5 | 7 | * Extension to provide customisable email notification of new user creation |
— | — | @@ -9,54 +11,48 @@ |
10 | 12 | * @licence GNU General Public Licence 2.0 or later |
11 | 13 | */ |
12 | 14 | |
13 | | -if( defined( 'MEDIAWIKI' ) ) { |
| 15 | +$wgExtensionCredits['other'][] = array( |
| 16 | + 'name' => 'New User Email Notification', |
| 17 | + 'version' => '1.5', |
| 18 | + 'author' => 'Rob Church', |
| 19 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:New_User_Email_Notification', |
| 20 | + 'description' => 'Sends email notification when user accounts are created', |
| 21 | +); |
14 | 22 | |
15 | | - $wgAutoloadClasses['NewUserNotifier'] = dirname( __FILE__ ) . '/NewUserNotif.class.php'; |
16 | | - $wgExtensionFunctions[] = 'efNewUserNotifSetup'; |
17 | | - $wgExtensionCredits['other'][] = array( |
18 | | - 'name' => 'New User Email Notification', |
19 | | - 'author' => 'Rob Church', |
20 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:New_User_Email_Notification', |
21 | | - 'description' => 'Sends email notification when user accounts are created', |
22 | | - ); |
| 23 | +$dir = dirname(__FILE__) . '/'; |
| 24 | +$wgExtensionMessagesFiles['NewUserNotifier'] = $dir . 'NewUserNotif.i18n.php'; |
| 25 | +$wgAutoloadClasses['NewUserNotifier'] = $dir . 'NewUserNotif.class.php'; |
| 26 | +$wgExtensionFunctions[] = 'efNewUserNotifSetup'; |
23 | 27 | |
24 | | - /** |
25 | | - * Email address to use as the sender |
26 | | - */ |
27 | | - $wgNewUserNotifSender = $wgPasswordSender; |
28 | | - |
29 | | - /** |
30 | | - * Users who should receive notification mails |
31 | | - */ |
32 | | - $wgNewUserNotifTargets[] = 1; |
33 | | - |
34 | | - /** |
35 | | - * Additional email addresses to send mails to |
36 | | - */ |
37 | | - $wgNewUserNotifEmailTargets = array(); |
| 28 | +/** |
| 29 | + * Email address to use as the sender |
| 30 | + */ |
| 31 | +$wgNewUserNotifSender = $wgPasswordSender; |
38 | 32 | |
39 | | - /** |
40 | | - * Extension setup |
41 | | - */ |
42 | | - function efNewUserNotifSetup() { |
43 | | - global $wgHooks, $wgMessageCache; |
44 | | - $wgHooks['AddNewAccount'][] = 'efNewUserNotif'; |
45 | | - require_once( dirname( __FILE__ ) . '/NewUserNotif.i18n.php' ); |
46 | | - foreach( efNewUserNotifMessages() as $lang => $messages ) |
47 | | - $wgMessageCache->addMessages( $messages, $lang ); |
48 | | - } |
49 | | - |
50 | | - /** |
51 | | - * Hook account creation |
52 | | - * |
53 | | - * @param User $user User account that was created |
54 | | - * @return bool |
55 | | - */ |
56 | | - function efNewUserNotif( $user ) { |
57 | | - return NewUserNotifier::hook( $user ); |
58 | | - } |
59 | | - |
60 | | -} else { |
61 | | - echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
62 | | - exit( 1 ); |
63 | | -} |
\ No newline at end of file |
| 33 | +/** |
| 34 | + * Users who should receive notification mails |
| 35 | + */ |
| 36 | +$wgNewUserNotifTargets[] = 1; |
| 37 | + |
| 38 | +/** |
| 39 | + * Additional email addresses to send mails to |
| 40 | + */ |
| 41 | +$wgNewUserNotifEmailTargets = array(); |
| 42 | + |
| 43 | +/** |
| 44 | + * Extension setup |
| 45 | + */ |
| 46 | +function efNewUserNotifSetup() { |
| 47 | + global $wgHooks; |
| 48 | + $wgHooks['AddNewAccount'][] = 'efNewUserNotif'; |
| 49 | +} |
| 50 | + |
| 51 | +/** |
| 52 | + * Hook account creation |
| 53 | + * |
| 54 | + * @param User $user User account that was created |
| 55 | + * @return bool |
| 56 | + */ |
| 57 | +function efNewUserNotif( $user ) { |
| 58 | + return NewUserNotifier::hook( $user ); |
| 59 | +} |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -1412,17 +1412,11 @@ |
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | class NewUserNotifMessageGroup extends ExtensionMessageGroup { |
1416 | | - protected $fileExporter = null; |
1417 | 1416 | protected $label = 'New User Notification'; |
1418 | 1417 | protected $id = 'ext-newusernotif'; |
1419 | 1418 | |
1420 | | - protected $functionName = 'efNewUserNotifMessages'; |
| 1419 | + protected $arrName = 'messages'; |
1421 | 1420 | protected $messageFile = 'NewUserNotif/NewUserNotif.i18n.php'; |
1422 | | - |
1423 | | - protected $exportStart = '\'$CODE\' => array('; |
1424 | | - protected $exportPrefix= ''; |
1425 | | - protected $exportLineP = "\t"; |
1426 | | - protected $exportEnd = '),'; |
1427 | 1421 | } |
1428 | 1422 | |
1429 | 1423 | class NukeMessageGroup extends ExtensionMessageGroup { |