Index: trunk/extensions/OpenID/OpenID.i18n.php |
— | — | @@ -73,7 +73,8 @@ |
74 | 74 | 'openidchoosemanual' => 'A name of your choice:', |
75 | 75 | 'openidchooseexisting' => 'An existing account on this wiki:', |
76 | 76 | 'openidchoosepassword' => 'password:', |
77 | | - 'openidconvertinstructions' => 'This form lets you change your user account to use an OpenID URL.', |
| 77 | + 'openidconvertinstructions' => 'This form lets you change your user account to use an OpenID URL or add more OpenID URLs', |
| 78 | + 'openidconvertoraddmoreids' => 'Convert to OpenID or add onother OpenID URL', |
78 | 79 | 'openidconvertsuccess' => 'Successfully converted to OpenID', |
79 | 80 | 'openidconvertsuccesstext' => 'You have successfully converted your OpenID to $1.', |
80 | 81 | 'openidconvertyourstext' => 'That is already your OpenID.', |
Index: trunk/extensions/OpenID/SpecialOpenIDConvert.body.php |
— | — | @@ -92,22 +92,69 @@ |
93 | 93 | } |
94 | 94 | |
95 | 95 | function form() { |
96 | | - global $wgOut, $wgUser, $wgOpenIDLoginLogoUrl; |
| 96 | + global $wgOut, $wgUser, $wgScriptPath, $wgOpenIDShowProviderIcons; |
97 | 97 | |
98 | | - $url = self::getUserUrl( $wgUser ); |
99 | | - if ( count( $url ) ) { |
100 | | - $url = ''; |
| 98 | + $oidScriptPath = $wgScriptPath . '/extensions/OpenID'; |
| 99 | + |
| 100 | + $wgOut->addLink( array( |
| 101 | + 'rel' => 'stylesheet', |
| 102 | + 'type' => 'text/css', |
| 103 | + 'media' => 'screen, projection', |
| 104 | + 'href' => $oidScriptPath . ( $wgOpenIDShowProviderIcons ? '/skin/openid.css' : '/skin/openid-plain.css' ) |
| 105 | + ) ); |
| 106 | + |
| 107 | + $wgOut->addScript( '<script type="text/javascript" src="' . $oidScriptPath . '/skin/jquery-1.3.2.min.js"></script>' . "\n" ); |
| 108 | + $wgOut->addScript( '<script type="text/javascript" src="' . $oidScriptPath . '/skin/openid.js"></script>' . "\n" ); |
| 109 | + |
| 110 | + $formsHTML = ''; |
| 111 | + |
| 112 | + $largeButtonsHTML = '<div id="openid_large_providers">'; |
| 113 | + foreach ( OpenIDProvider::getLargeProviders() as $provider ) { |
| 114 | + $largeButtonsHTML .= $provider->getLargeButtonHTML(); |
| 115 | + $formsHTML .= $provider->getLoginFormHTML(); |
101 | 116 | } |
| 117 | + $largeButtonsHTML .= '</div>'; |
102 | 118 | |
103 | | - $wgOut->addWikiMsg( 'openidconvertinstructions' ); |
| 119 | + $smallButtonsHTML = ''; |
| 120 | + if ( $wgOpenIDShowProviderIcons ) { |
| 121 | + $smallButtonsHTML .= '<div id="openid_small_providers_icons">'; |
| 122 | + foreach ( OpenIDProvider::getSmallProviders() as $provider ) { |
| 123 | + $smallButtonsHTML .= $provider->getSmallButtonHTML(); |
| 124 | + $formsHTML .= $provider->getLoginFormHTML(); |
| 125 | + } |
| 126 | + $smallButtonsHTML .= '</div>'; |
| 127 | + } else { |
| 128 | + $smallButtonsHTML .= '<div id="openid_small_providers_links">'; |
| 129 | + $smallButtonsHTML .= '<ul class="openid_small_providers_block">'; |
| 130 | + $small = OpenIDProvider::getSmallProviders(); |
| 131 | + |
| 132 | + $i = 0; |
| 133 | + $break = true; |
| 134 | + foreach ( $small as $provider ) { |
| 135 | + if ( $break && $i > count( $small ) / 2 ) { |
| 136 | + $smallButtonsHTML .= '</ul><ul class="openid_small_providers_block">'; |
| 137 | + $break = false; |
| 138 | + } |
| 139 | + |
| 140 | + $smallButtonsHTML .= '<li>' . $provider->getSmallButtonHTML() . '</li>'; |
| 141 | + |
| 142 | + $formsHTML .= $provider->getLoginFormHTML(); |
| 143 | + $i++; |
| 144 | + } |
| 145 | + $smallButtonsHTML .= '</ul>'; |
| 146 | + $smallButtonsHTML .= '</div>'; |
| 147 | + } |
| 148 | + |
104 | 149 | $wgOut->addHTML( |
105 | | - Xml::openElement( 'form', array( 'action' => $this->getTitle()->getLocalUrl(), 'method' => 'post' ) ) . |
106 | | - '<input type="text" name="openid_url" size="30" ' . |
107 | | - ' style="background: url(' . $wgOpenIDLoginLogoUrl . ') ' . |
108 | | - ' no-repeat; background-color: #fff; background-position: 0 50%; ' . |
109 | | - ' color: #000; padding-left: 18px;" value="" />' . |
110 | | - Xml::submitButton( wfMsg( 'ok' ) ) . |
111 | | - Xml::closeElement( 'form' ) |
| 150 | + Xml::openElement( 'form', array( 'id' => 'openid_form', 'action' => $this->getTitle()->getLocalUrl(), 'method' => 'post', 'onsubmit' => 'openid.update()' ) ) . |
| 151 | + Xml::fieldset( wfMsg( 'openidconvertoraddmoreids' ) ) . |
| 152 | + Xml::openElement('p') . wfMsg( 'openidconvertinstructions' ) . Xml::closeElement( 'p' ) . |
| 153 | + $largeButtonsHTML . |
| 154 | + '<div id="openid_input_area">' . |
| 155 | + $formsHTML . |
| 156 | + '</div>' . |
| 157 | + $smallButtonsHTML . |
| 158 | + Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ) |
112 | 159 | ); |
113 | 160 | } |
114 | 161 | |
Index: trunk/extensions/OpenID/OpenID.setup.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | exit( 1 ); |
28 | 28 | } |
29 | 29 | |
30 | | -define( 'MEDIAWIKI_OPENID_VERSION', '0.9.0' ); |
| 30 | +define( 'MEDIAWIKI_OPENID_VERSION', '0.9-dev' ); |
31 | 31 | |
32 | 32 | # CONFIGURATION VARIABLES |
33 | 33 | |