http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67974

Revision: 67974
Author:   ashley
Date:     2010-06-14 01:48:07 +0000 (Mon, 14 Jun 2010)

Log Message:
-----------
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: trunk/extensions/FormatEmail/FormatEmail.php
===================================================================
--- trunk/extensions/FormatEmail/FormatEmail.php        2010-06-14 01:36:58 UTC 
(rev 67973)
+++ trunk/extensions/FormatEmail/FormatEmail.php        2010-06-14 01:48:07 UTC 
(rev 67974)
@@ -1,41 +1,39 @@
 <?php
-if ( ! defined( 'MEDIAWIKI' ) )
-       die();
-
-/*...@+
+/**
  * Allows custom headers/footers to be added to user to user emails.
  *
  * @file
  * @ingroup Extensions
- *
- * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation
- *
+ * @version 1.0
  * @author Travis Derouin <tra...@wikihow.com>
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation
  */
 
-$wgExtensionFunctions[] = 'wfFormatEmailInit';
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die();
+}
 
+// Extension credits that will show up on Special:Version
 $wgExtensionCredits['other'][] = array(
        'path' => __FILE__,
        'name' => 'FormatEmail',
+       'version' => '1.0',
        'author' => 'Travis Derouin',
        'descriptionmsg' => 'email-desc',
        'url' => 'http://www.mediawiki.org/wiki/Extension:FormatEmail',
 );
 
-$dir = dirname(__FILE__) . '/';
+$dir = dirname( __FILE__ ) . '/';
 $wgExtensionMessagesFiles['EmailUser'] = $dir . 'FormatEmail.i18n.php';
 
 $wgHooks['EmailUser'][] = 'wfFormatEmail';
 
-function wfFormatEmailInit() {
-       wfLoadExtensionMessages( 'EmailUser' );
-}
-
-function wfFormatEmail (&$to, &$from, &$subject, &$text ) {
+function wfFormatEmail( &$to, &$from, &$subject, &$text ) {
        global $wgUser;
+       wfLoadExtensionMessages( 'EmailUser' );
        $ul = $wgUser->getUserPage();
-       $text = wfMsg('email_header') . $text . 
wfMsg('email_footer',$wgUser->getName(), $ul->getFullURL());
+       $text = wfMsg( 'email_header' ) . $text .
+                       wfMsg( 'email_footer', $wgUser->getName(), 
$ul->getFullURL() );
        return true;
 }



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to