r92792 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92791‎ | r92792 | r92793 >
Date:21:21, 21 July 2011
Author:robin
Status:ok
Tags:
Comment:
Use Linker trick to get rid of wgUser, per r92559
Modified paths:
  • /trunk/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)
  • /trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php
@@ -67,11 +67,12 @@
6868 * @param $target Mixed: user whose language and test wiki we're looking up
6969 */
7070 function showInfo( $target ) {
71 - global $wgOut, $wmincPref, $wmincProjectSite, $wgUser;
 71+ global $wgOut, $wmincPref, $wmincProjectSite;
7272 $user = User::newFromName( $target );
7373 $name = $user->getName();
7474 $id = $user->getId();
7575 $langNames = Language::getLanguageNames();
 76+ $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker;
7677 if ( $user == null || $id == 0 ) {
7778 // show error if a user with that name does not exist
7879 $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) );
@@ -81,7 +82,7 @@
8283 $usercode = $user->getOption( $wmincPref . '-code' );
8384 $prefix = IncubatorTest::displayPrefix( $userproject, $usercode );
8485 if ( IncubatorTest::isContentProject( $userproject ) ) {
85 - $testwiki = $wgUser->getSkin()->link( Title::newFromText( $prefix ) );
 86+ $testwiki = $linker->link( Title::newFromText( $prefix ) );
8687 } elseif ( $prefix == $wmincProjectSite['short'] ) {
8788 $testwiki = htmlspecialchars( $wmincProjectSite['name'] );
8889 } else {
@@ -90,7 +91,7 @@
9192 $wgOut->addHtml(
9293 Xml::openElement( 'ul' ) .
9394 '<li>' . wfMsgHtml( 'username' ) . ' ' .
94 - $wgUser->getSkin()->userLink( $id, $name ) . $wgUser->getSkin()->userToolLinks( $id, $name, true ) . '</li>' .
 95+ $linker->userLink( $id, $name ) . $linker->userToolLinks( $id, $name, true ) . '</li>' .
9596 '<li>' . wfMsgHtml( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] .
9697 ' (' . $user->getOption( 'language' ) . ')' ) . '</li>' .
9798 '<li>' . wfMsgHtml( 'wminc-testwiki' ) . ' ' . $testwiki . '</li>' .
Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php
@@ -431,7 +431,7 @@
432432 * @return True
433433 */
434434 static function onShowMissingArticle( $article ) {
435 - global $wgOut, $wgUser;
 435+ global $wgOut;
436436 $title = $article->getTitle();
437437 $prefix = self::analyzePrefix( $title->getText(), true /* only info pages */ );
438438
@@ -447,7 +447,8 @@
448448 return true;
449449 } else {
450450 # Show a link to the existing wiki
451 - $showLink = $wgUser->getSkin()->makeExternalLink( $link, $link );
 451+ $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker;
 452+ $showLink = $linker->makeExternalLink( $link, $link );
452453 $wgOut->addHtml( '<div class="wminc-wiki-exists">' .
453454 wfMsgHtml( 'wminc-error-wiki-exists', $showLink ) .
454455 '</div>' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92559Major update of stable features from development code....robin19:51, 19 July 2011

Status & tagging log