r94360 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94359‎ | r94360 | r94361 >
Date:16:26, 12 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
some fixed as cleanup
Modified paths:
  • /trunk/extensions/SemanticSignup/SemanticSignup.hooks.php (modified) (history)
  • /trunk/extensions/SemanticSignup/SemanticSignup.i18n.php (modified) (history)
  • /trunk/extensions/SemanticSignup/includes/SES_SignupFields.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticSignup/SemanticSignup.hooks.php
@@ -39,7 +39,7 @@
4040 */
4141 public static function onParserFirstCallInit() {
4242 global $wgParser;
43 - $wgParser->setHook( 'signupfields', 'SES_SignupFields::render' );
 43+ $wgParser->setFunctionHook( 'signupfields', 'SES_SignupFields::render' );
4444 return true;
4545 }
4646
Index: trunk/extensions/SemanticSignup/includes/SES_SignupFields.php
@@ -153,15 +153,21 @@
154154 }
155155 }
156156
157 -class SES_SignupFields
158 -{
159 - public static function render($input, $args, $parser)
160 - {
 157+class SES_SignupFields {
 158+
 159+ public static function render( $args, $parser ) {
 160+ $args = func_get_args();
 161+
 162+ $parser = array_shift( $args );
 163+
161164 $template = new CreateUserFieldsTemplate();
162165
163166 $template->set( 'header', '' );
164167
165168 global $wgEnableEmail, $wgAllowRealName, $wgEmailConfirmToEdit, $wgAuth, $wgUser;
 169+
 170+ $template->set( 'link', '' ); // TODO
 171+ $template->set( 'email', '' ); // TODO
166172 $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() );
167173 $template->set( 'userealname', $wgAllowRealName );
168174 $template->set( 'useemail', $wgEnableEmail );
@@ -171,17 +177,23 @@
172178
173179 global $wgLoginLanguageSelector;
174180 # Prepare language selection links as needed
175 - if( $wgLoginLanguageSelector )
 181+ if( $wgLoginLanguageSelector ) {
176182 $template->set( 'languages', $this->makeLanguageSelector() );
 183+ }
177184
178185 // Give authentication and captcha plugins a chance to modify the form
179 - $wgAuth->modifyUITemplate( $template );
 186+ $type = 'signup';
 187+ $wgAuth->modifyUITemplate( $template, $type );
180188
181189 ob_start();
182190 $template->execute();
183191 $text = ob_get_clean();
184192
185 - return $text;
 193+ return array(
 194+ $text,
 195+ 'noparse' => true,
 196+ 'isHTML' => true
 197+ );
186198 }
187199
188200 }
Index: trunk/extensions/SemanticSignup/SemanticSignup.i18n.php
@@ -19,3 +19,10 @@
2020 'throttlehit' => 'New user accounts number maximum per day has been exceeded for this IP',
2121 'ses_userexists' => 'User already exists'
2222 );
 23+
 24+$magicWords = array();
 25+
 26+/** English (English) */
 27+$magicWords['en'] = array(
 28+ 'signupfields' => array( 0, 'signupfields' ),
 29+);