r67974 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67973‎ | r67974 | r67975 >
Date:01:48, 14 June 2010
Author:ashley
Status:deferred
Tags:
Comment:
FormatEmail: killed ugly & unnecessary extension function (wfLoadExtensionMessages() is a no-op in trunk, but I moved the call to it to wfFormatEmail), tweaked spacing, added version number
Modified paths:
  • /trunk/extensions/FormatEmail/FormatEmail.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FormatEmail/FormatEmail.php
@@ -1,41 +1,39 @@
22 <?php
3 -if ( ! defined( 'MEDIAWIKI' ) )
4 - die();
5 -
6 -/**#@+
 3+/**
74 * Allows custom headers/footers to be added to user to user emails.
85 *
96 * @file
107 * @ingroup Extensions
11 - *
12 - * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation
13 - *
 8+ * @version 1.0
149 * @author Travis Derouin <travis@wikihow.com>
1510 * @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
1612 */
1713
18 -$wgExtensionFunctions[] = 'wfFormatEmailInit';
 14+if ( !defined( 'MEDIAWIKI' ) ) {
 15+ die();
 16+}
1917
 18+// Extension credits that will show up on Special:Version
2019 $wgExtensionCredits['other'][] = array(
2120 'path' => __FILE__,
2221 'name' => 'FormatEmail',
 22+ 'version' => '1.0',
2323 'author' => 'Travis Derouin',
2424 'descriptionmsg' => 'email-desc',
2525 'url' => 'http://www.mediawiki.org/wiki/Extension:FormatEmail',
2626 );
2727
28 -$dir = dirname(__FILE__) . '/';
 28+$dir = dirname( __FILE__ ) . '/';
2929 $wgExtensionMessagesFiles['EmailUser'] = $dir . 'FormatEmail.i18n.php';
3030
3131 $wgHooks['EmailUser'][] = 'wfFormatEmail';
3232
33 -function wfFormatEmailInit() {
34 - wfLoadExtensionMessages( 'EmailUser' );
35 -}
36 -
37 -function wfFormatEmail (&$to, &$from, &$subject, &$text ) {
 33+function wfFormatEmail( &$to, &$from, &$subject, &$text ) {
3834 global $wgUser;
 35+ wfLoadExtensionMessages( 'EmailUser' );
3936 $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() );
4139 return true;
4240 }

Status & tagging log