r94249 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94248‎ | r94249 | r94250 >
Date:15:00, 11 August 2011
Author:jeroendedauw
Status:deferred
Tags:lamecommitsummary 
Comment:
Modified paths:
  • /trunk/extensions/SemanticSignup/SemanticSignup.hooks.php (added) (history)
  • /trunk/extensions/SemanticSignup/SemanticSignup.php (modified) (history)
  • /trunk/extensions/SemanticSignup/includes/SES_SignupFields.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticSignup/SemanticSignup.php
@@ -54,33 +54,16 @@
5555 $wgExtensionMessagesFiles['SemanticSignup'] = dirname( __FILE__ ) . '/SemanticSignup.i18n.php';
5656 $wgExtensionAliasesFiles['SemanticSignup'] = dirname( __FILE__ ) . '/SemanticSignup.i18n.aliases.php';
5757
 58+$wgAutoloadClasses['SemanticSignupHooks'] = dirname( __FILE__ ) . '/SemanticSignup.hooks.php';
5859 $wgAutoloadClasses['SemanticSignup'] = dirname( __FILE__ ) . '/includes/SES_Special.php';
5960 $wgAutoloadClasses['SES_UserAccountDataChecker'] = dirname( __FILE__ ) . '/includes/SES_Special.php';
60 -
6161 $wgAutoloadClasses['SES_DataChecker'] = dirname( __FILE__ ) . '/includes/SES_Utils.php';
62 -
6362 $wgAutoloadClasses['SES_SignupFields'] = dirname( __FILE__ ) . '/includes/SES_SignupFields.php';
6463 $wgAutoloadClasses['CreateUserFieldsTemplate'] = dirname( __FILE__ ) . '/includes/SES_SignupFields.php';
6564
6665 $wgSpecialPages['SemanticSignup'] = 'SemanticSignup';
6766
68 -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
69 - $wgHooks['ParserFirstCallInit'][] = 'SES_SignupFields::setup';
70 -} else {
71 - $wgExtensionFunctions[] = 'SES_SignupFields::setup';
72 -}
 67+$wgHooks['UserCreateForm'][] = 'SemanticSignupHooks::onUserCreateForm';
 68+$wgHooks['ParserFirstCallInit'][] = 'SemanticSignupHooks::onParserFirstCallInit';
7369
74 -function sesCreateUserRedirect($template)
75 -{
76 - $semantic_signup_title = SemanticSignup::getTitleFor('SemanticSignup');
77 - $url = $semantic_signup_title->escapeFullURL();
78 -
79 - global $wgOut;
80 - $wgOut->redirect($url);
81 -
82 - return false;
83 -}
84 -
85 -$wgHooks['UserCreateForm'][] = 'sesCreateUserRedirect';
86 -
8770 require_once 'SemanticSignup.settings.php';
Index: trunk/extensions/SemanticSignup/SemanticSignup.hooks.php
@@ -0,0 +1,44 @@
 2+<?php
 3+
 4+/**
 5+ * Static class for hooks handled by the SemanticSignup extension.
 6+ *
 7+ * @since 0.3
 8+ *
 9+ * @file SemanticSignup.hooks.php
 10+ * @ingroup SemanticSignup
 11+ *
 12+ * @licence GNU GPL v3+
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+final class SemanticSignupHooks {
 16+
 17+ /**
 18+ * @since 0.3
 19+ *
 20+ * @param $template
 21+ *
 22+ * @return false
 23+ */
 24+ public static function onUserCreateForm( $template ) {
 25+ $semantic_signup_title = SemanticSignup::getTitleFor( 'SemanticSignup' );
 26+ $url = $semantic_signup_title->escapeFullURL();
 27+
 28+ global $wgOut;
 29+ $wgOut->redirect( $url );
 30+
 31+ return false;
 32+ }
 33+
 34+ /**
 35+ * @since 0.3
 36+ *
 37+ * @return true
 38+ */
 39+ public static function onParserFirstCallInit() {
 40+ global $wgParser;
 41+ $wgParser->setHook( 'signupfields', 'SES_SignupFields::render' );
 42+ return true;
 43+ }
 44+
 45+}
Property changes on: trunk/extensions/SemanticSignup/SemanticSignup.hooks.php
___________________________________________________________________
Added: svn:eol-style
146 + native
Index: trunk/extensions/SemanticSignup/includes/SES_SignupFields.php
@@ -184,10 +184,4 @@
185185 return $text;
186186 }
187187
188 - public static function setup()
189 - {
190 - global $wgParser;
191 - $wgParser->setHook( 'signupfields', 'SES_SignupFields::render' );
192 - return true;
193 - }
194188 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94246starting on 0.3jeroendedauw14:44, 11 August 2011

Status & tagging log