r52285 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52284‎ | r52285 | r52286 >
Date:15:36, 22 June 2009
Author:sergeychernyshev
Status:deferred
Tags:
Comment:
Added provider picker to OpenIDConvert page (bug 19344).
Changed version to 0.9-dev until bug 19348 and bug 19347 are fixed and new version is ready for release.
Modified paths:
  • /trunk/extensions/OpenID/OpenID.i18n.php (modified) (history)
  • /trunk/extensions/OpenID/OpenID.setup.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDConvert.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/OpenID.i18n.php
@@ -73,7 +73,8 @@
7474 'openidchoosemanual' => 'A name of your choice:',
7575 'openidchooseexisting' => 'An existing account on this wiki:',
7676 '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',
7879 'openidconvertsuccess' => 'Successfully converted to OpenID',
7980 'openidconvertsuccesstext' => 'You have successfully converted your OpenID to $1.',
8081 'openidconvertyourstext' => 'That is already your OpenID.',
Index: trunk/extensions/OpenID/SpecialOpenIDConvert.body.php
@@ -92,22 +92,69 @@
9393 }
9494
9595 function form() {
96 - global $wgOut, $wgUser, $wgOpenIDLoginLogoUrl;
 96+ global $wgOut, $wgUser, $wgScriptPath, $wgOpenIDShowProviderIcons;
9797
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();
101116 }
 117+ $largeButtonsHTML .= '</div>';
102118
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+
104149 $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' )
112159 );
113160 }
114161
Index: trunk/extensions/OpenID/OpenID.setup.php
@@ -26,7 +26,7 @@
2727 exit( 1 );
2828 }
2929
30 -define( 'MEDIAWIKI_OPENID_VERSION', '0.9.0' );
 30+define( 'MEDIAWIKI_OPENID_VERSION', '0.9-dev' );
3131
3232 # CONFIGURATION VARIABLES
3333

Follow-up revisions

RevisionCommit summaryAuthorDate
r60241* (bug 19348) patch-uoi_user-not-unique.sql is now automatically applied in m...ialex16:07, 20 December 2009
r60535* (bug 19347) Restored compatibility with MW 1.15 (and maybe earlier versions)ialex15:26, 1 January 2010

Status & tagging log