Index: trunk/extensions/SignupAPI/SignupAPI.php |
— | — | @@ -25,6 +25,8 @@ |
26 | 26 | 'descriptionmsg' => 'signupapi-desc', |
27 | 27 | ); |
28 | 28 | |
| 29 | +global $wgSignupAPISourceTracking,$wgSignupAPIUseAjax; |
| 30 | +echo "before, AJAX = $wgSignupAPIUseAjax, Source= $wgSignupAPISourceTracking"; |
29 | 31 | $wgSignupAPIUseAjax = true; |
30 | 32 | $wgSignupAPISourceTracking = true; |
31 | 33 | |
— | — | @@ -40,23 +42,33 @@ |
41 | 43 | = $wgMyExtensionIncludes . '/APISignup.php'; |
42 | 44 | $wgSpecialPages['UserSignup'] = 'SignupForm'; |
43 | 45 | |
44 | | -if ( $wgSignupAPIUseAjax ) { |
45 | | - $wgAutoloadClasses['validateSignup'] |
46 | | - = $wgMyExtensionIncludes . '/validateSignup.php'; |
| 46 | +$wgAutoloadClasses['ValidateSignup'] |
| 47 | + = $wgMyExtensionIncludes . '/ValidateSignup.php'; |
47 | 48 | |
48 | | - $wgAPIModules['signup'] = 'ApiSignup'; |
49 | | - $wgAPIModules['validatesignup'] = 'validateSignup'; |
| 49 | +$wgAPIModules['signup'] = 'ApiSignup'; |
50 | 50 | |
51 | | - # Requires jquery.ui.progressbar for password strength validation |
52 | | - $wgResourceModules['ext.SignupAPI'] = array( |
| 51 | +$wgAPIModules['validatesignup'] = 'ValidateSignup'; |
53 | 52 | |
54 | | - 'scripts' => array( 'includes/verification.js' ), |
55 | | - 'messages' => array( 'ok', 'signupapi-enterpassword', 'passwordtooshort', 'signupapi-weak', 'signupapi-medium', 'signupapi-strong', 'badretype', 'signupapi-passwordsmatch' ), |
56 | | - 'dependencies' => array( 'jquery.ui.progressbar' ), |
57 | | - 'localBasePath' => dirname( __FILE__ ), |
58 | | - 'remoteExtPath' => 'SignupAPI' |
59 | | - ); |
| 53 | +# Requires jquery.ui.progressbar for password strength validation |
| 54 | +$wgResourceModules['ext.SignupAPI'] = array( |
60 | 55 | |
| 56 | + 'scripts' => array( 'includes/verification.js' ), |
| 57 | + 'messages' => array( 'signupapi-ok', 'signupapi-enterpassword', 'signupapi-passwordtooshort', 'signupapi-weak', 'signupapi-medium', 'signupapi-strong', 'signupapi-badretype', 'signupapi-passwordsmatch' ), |
| 58 | + 'dependencies' => array( 'jquery.ui.progressbar' ), |
| 59 | + 'localBasePath' => dirname( __FILE__ ), |
| 60 | + 'remoteExtPath' => 'SignupAPI' |
| 61 | +); |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +if ( $wgSignupAPIUseAjax ) { |
| 66 | + $wgHooks['SignupForm'][] = 'onSignupAPIUseAjax'; |
| 67 | + function onSignupAPIUseAjax() { |
| 68 | + echo "Entered onSignupAPIUseAJax"; |
| 69 | + global $wgOut; |
| 70 | + $wgOut->addModules( 'ext.SignupAPI' ); |
| 71 | + return true; |
| 72 | + } |
61 | 73 | } |
62 | 74 | |
63 | 75 | if ( $wgSignupAPISourceTracking ) { |
— | — | @@ -73,8 +85,7 @@ |
74 | 86 | # Add source tracking to personal URL's |
75 | 87 | $wgHooks['PersonalUrls'][] = 'addSourceTracking'; |
76 | 88 | |
77 | | - function addSourceTracking( &$personal_urls, &$title ) |
78 | | - { |
| 89 | + function addSourceTracking( &$personal_urls, &$title ) { |
79 | 90 | global $wgRequest,$wgUser; |
80 | 91 | |
81 | 92 | #generate source tracking parameters |
— | — | @@ -133,12 +144,12 @@ |
134 | 145 | $is_signup = $wgRequest->getText( 'type' ) == "signup"; |
135 | 146 | $createaccount_url = array( |
136 | 147 | 'text' => wfMsg( 'createaccount' ), |
137 | | - 'href' => SkinTemplate::makeSpecialUrl( 'Usersignup', "$returnto&type=signup&wpSourceAction=$sourceAction&wpSourceNS=$sourceNS&wpSourceArticle=$sourceArticle" ), |
| 148 | + 'href' => SkinTemplate::makeSpecialUrl( 'UserSignup', "$returnto&type=signup&wpSourceAction=$sourceAction&wpSourceNS=$sourceNS&wpSourceArticle=$sourceArticle" ), |
138 | 149 | 'active' => $title->isSpecial( 'Userlogin' ) && $is_signup |
139 | 150 | ); |
140 | 151 | |
141 | 152 | if ( substr( $wgServer, 0, 5 ) === 'http:' && $wgSecureLogin ) { |
142 | | - $title = SpecialPage::getTitleFor( 'Usersignup' ); |
| 153 | + $title = SpecialPage::getTitleFor( 'UserSignup' ); |
143 | 154 | $https_url = preg_replace( '/^http:/', 'https:', $title->getFullURL( "type=signup" ) ); |
144 | 155 | $createaccount_url['href'] = $https_url; |
145 | 156 | $createaccount_url['class'] = 'link-https'; |