Index: trunk/extensions/FormatEmail/FormatEmail.php |
— | — | @@ -1,41 +1,39 @@ |
2 | 2 | <?php |
3 | | -if ( ! defined( 'MEDIAWIKI' ) ) |
4 | | - die(); |
5 | | - |
6 | | -/**#@+ |
| 3 | +/** |
7 | 4 | * Allows custom headers/footers to be added to user to user emails. |
8 | 5 | * |
9 | 6 | * @file |
10 | 7 | * @ingroup Extensions |
11 | | - * |
12 | | - * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation |
13 | | - * |
| 8 | + * @version 1.0 |
14 | 9 | * @author Travis Derouin <travis@wikihow.com> |
15 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 11 | + * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation |
16 | 12 | */ |
17 | 13 | |
18 | | -$wgExtensionFunctions[] = 'wfFormatEmailInit'; |
| 14 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 15 | + die(); |
| 16 | +} |
19 | 17 | |
| 18 | +// Extension credits that will show up on Special:Version |
20 | 19 | $wgExtensionCredits['other'][] = array( |
21 | 20 | 'path' => __FILE__, |
22 | 21 | 'name' => 'FormatEmail', |
| 22 | + 'version' => '1.0', |
23 | 23 | 'author' => 'Travis Derouin', |
24 | 24 | 'descriptionmsg' => 'email-desc', |
25 | 25 | 'url' => 'http://www.mediawiki.org/wiki/Extension:FormatEmail', |
26 | 26 | ); |
27 | 27 | |
28 | | -$dir = dirname(__FILE__) . '/'; |
| 28 | +$dir = dirname( __FILE__ ) . '/'; |
29 | 29 | $wgExtensionMessagesFiles['EmailUser'] = $dir . 'FormatEmail.i18n.php'; |
30 | 30 | |
31 | 31 | $wgHooks['EmailUser'][] = 'wfFormatEmail'; |
32 | 32 | |
33 | | -function wfFormatEmailInit() { |
34 | | - wfLoadExtensionMessages( 'EmailUser' ); |
35 | | -} |
36 | | - |
37 | | -function wfFormatEmail (&$to, &$from, &$subject, &$text ) { |
| 33 | +function wfFormatEmail( &$to, &$from, &$subject, &$text ) { |
38 | 34 | global $wgUser; |
| 35 | + wfLoadExtensionMessages( 'EmailUser' ); |
39 | 36 | $ul = $wgUser->getUserPage(); |
40 | | - $text = wfMsg('email_header') . $text . wfMsg('email_footer',$wgUser->getName(), $ul->getFullURL()); |
| 37 | + $text = wfMsg( 'email_header' ) . $text . |
| 38 | + wfMsg( 'email_footer', $wgUser->getName(), $ul->getFullURL() ); |
41 | 39 | return true; |
42 | 40 | } |