r97383 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97382‎ | r97383 | r97384 >
Date:19:04, 17 September 2011
Author:ialex
Status:ok
Tags:
Comment:
* Use local context instead of global variables
* Call Linker methods statically
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBrokenRedirects.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBrokenRedirects.php
@@ -77,8 +77,6 @@
7878 * @return String
7979 */
8080 function formatResult( $skin, $result ) {
81 - global $wgUser, $wgLang;
82 -
8381 $fromObj = Title::makeTitle( $result->namespace, $result->title );
8482 if ( isset( $result->rd_title ) ) {
8583 $toObj = Title::makeTitle( $result->rd_namespace, $result->rd_title );
@@ -93,35 +91,35 @@
9492
9593 // $toObj may very easily be false if the $result list is cached
9694 if ( !is_object( $toObj ) ) {
97 - return '<del>' . $skin->link( $fromObj ) . '</del>';
 95+ return '<del>' . Linker::link( $fromObj ) . '</del>';
9896 }
9997
100 - $from = $skin->linkKnown(
 98+ $from = Linker::linkKnown(
10199 $fromObj,
102100 null,
103101 array(),
104102 array( 'redirect' => 'no' )
105103 );
106104 $links = array();
107 - $links[] = $skin->linkKnown(
 105+ $links[] = Linker::linkKnown(
108106 $fromObj,
109107 wfMsgHtml( 'brokenredirects-edit' ),
110108 array(),
111109 array( 'action' => 'edit' )
112110 );
113 - $to = $skin->link(
 111+ $to = Linker::link(
114112 $toObj,
115113 null,
116114 array(),
117115 array(),
118116 array( 'broken' )
119117 );
120 - $arr = $wgLang->getArrow();
 118+ $arr = $this->getLang()->getArrow();
121119
122120 $out = $from . wfMsg( 'word-separator' );
123121
124 - if( $wgUser->isAllowed( 'delete' ) ) {
125 - $links[] = $skin->linkKnown(
 122+ if( $this->getUser()->isAllowed( 'delete' ) ) {
 123+ $links[] = Linker::linkKnown(
126124 $fromObj,
127125 wfMsgHtml( 'brokenredirects-delete' ),
128126 array(),
@@ -129,7 +127,7 @@
130128 );
131129 }
132130
133 - $out .= wfMsg( 'parentheses', $wgLang->pipeList( $links ) );
 131+ $out .= wfMsg( 'parentheses', $this->getLang()->pipeList( $links ) );
134132 $out .= " {$arr} {$to}";
135133 return $out;
136134 }

Status & tagging log