r99301 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99300‎ | r99301 | r99302 >
Date:09:12, 8 October 2011
Author:ialex
Status:ok
Tags:
Comment:
* Use local context instead of global variables
* Call Linker methods statically
Modified paths:
  • /trunk/phase3/includes/specials/SpecialDoubleRedirects.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialDoubleRedirects.php
@@ -76,8 +76,6 @@
7777 }
7878
7979 function formatResult( $skin, $result ) {
80 - global $wgLang;
81 -
8280 $titleA = Title::makeTitle( $result->namespace, $result->title );
8381
8482 if ( $result && !isset( $result->nsb ) ) {
@@ -91,19 +89,20 @@
9290 }
9391 }
9492 if ( !$result ) {
95 - return '<del>' . $skin->link( $titleA, null, array(), array( 'redirect' => 'no' ) ) . '</del>';
 93+ return '<del>' . Linker::link( $titleA, null, array(), array( 'redirect' => 'no' ) ) . '</del>';
9694 }
9795
9896 $titleB = Title::makeTitle( $result->nsb, $result->tb );
9997 $titleC = Title::makeTitle( $result->nsc, $result->tc );
10098
101 - $linkA = $skin->linkKnown(
 99+ $linkA = Linker::linkKnown(
102100 $titleA,
103101 null,
104102 array(),
105103 array( 'redirect' => 'no' )
106104 );
107 - $edit = $skin->linkKnown(
 105+
 106+ $edit = Linker::linkKnown(
108107 $titleA,
109108 wfMsgExt( 'parentheses', array( 'escape' ), wfMsg( 'editlink' ) ),
110109 array(),
@@ -112,15 +111,19 @@
113112 'action' => 'edit'
114113 )
115114 );
116 - $linkB = $skin->linkKnown(
 115+
 116+ $linkB = Linker::linkKnown(
117117 $titleB,
118118 null,
119119 array(),
120120 array( 'redirect' => 'no' )
121121 );
122 - $linkC = $skin->linkKnown( $titleC );
123 - $arr = $wgLang->getArrow() . $wgLang->getDirMark();
124122
 123+ $linkC = Linker::linkKnown( $titleC );
 124+
 125+ $lang = $this->getLang();
 126+ $arr = $lang->getArrow() . $lang->getDirMark();
 127+
125128 return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
126129 }
127130 }

Status & tagging log