Index: trunk/extensions/SemanticSignup/SemanticSignup.hooks.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | */ |
41 | 41 | public static function onParserFirstCallInit() { |
42 | 42 | global $wgParser; |
43 | | - $wgParser->setHook( 'signupfields', 'SES_SignupFields::render' ); |
| 43 | + $wgParser->setFunctionHook( 'signupfields', 'SES_SignupFields::render' ); |
44 | 44 | return true; |
45 | 45 | } |
46 | 46 | |
Index: trunk/extensions/SemanticSignup/includes/SES_SignupFields.php |
— | — | @@ -153,15 +153,21 @@ |
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
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 | + |
161 | 164 | $template = new CreateUserFieldsTemplate(); |
162 | 165 | |
163 | 166 | $template->set( 'header', '' ); |
164 | 167 | |
165 | 168 | global $wgEnableEmail, $wgAllowRealName, $wgEmailConfirmToEdit, $wgAuth, $wgUser; |
| 169 | + |
| 170 | + $template->set( 'link', '' ); // TODO |
| 171 | + $template->set( 'email', '' ); // TODO |
166 | 172 | $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() ); |
167 | 173 | $template->set( 'userealname', $wgAllowRealName ); |
168 | 174 | $template->set( 'useemail', $wgEnableEmail ); |
— | — | @@ -171,17 +177,23 @@ |
172 | 178 | |
173 | 179 | global $wgLoginLanguageSelector; |
174 | 180 | # Prepare language selection links as needed |
175 | | - if( $wgLoginLanguageSelector ) |
| 181 | + if( $wgLoginLanguageSelector ) { |
176 | 182 | $template->set( 'languages', $this->makeLanguageSelector() ); |
| 183 | + } |
177 | 184 | |
178 | 185 | // Give authentication and captcha plugins a chance to modify the form |
179 | | - $wgAuth->modifyUITemplate( $template ); |
| 186 | + $type = 'signup'; |
| 187 | + $wgAuth->modifyUITemplate( $template, $type ); |
180 | 188 | |
181 | 189 | ob_start(); |
182 | 190 | $template->execute(); |
183 | 191 | $text = ob_get_clean(); |
184 | 192 | |
185 | | - return $text; |
| 193 | + return array( |
| 194 | + $text, |
| 195 | + 'noparse' => true, |
| 196 | + 'isHTML' => true |
| 197 | + ); |
186 | 198 | } |
187 | 199 | |
188 | 200 | } |
Index: trunk/extensions/SemanticSignup/SemanticSignup.i18n.php |
— | — | @@ -19,3 +19,10 @@ |
20 | 20 | 'throttlehit' => 'New user accounts number maximum per day has been exceeded for this IP', |
21 | 21 | 'ses_userexists' => 'User already exists' |
22 | 22 | ); |
| 23 | + |
| 24 | +$magicWords = array(); |
| 25 | + |
| 26 | +/** English (English) */ |
| 27 | +$magicWords['en'] = array( |
| 28 | + 'signupfields' => array( 0, 'signupfields' ), |
| 29 | +); |