Index: trunk/phase3/includes/specials/SpecialSpecialpages.php |
— | — | @@ -33,11 +33,11 @@ |
34 | 34 | } |
35 | 35 | |
36 | 36 | function execute( $par ) { |
37 | | - global $wgOut; |
| 37 | + $out = $this->getOutput(); |
38 | 38 | $this->setHeaders(); |
39 | 39 | $this->outputHeader(); |
40 | | - $wgOut->allowClickjacking(); |
41 | | - $wgOut->addModuleStyles( 'mediawiki.special' ); |
| 40 | + $out->allowClickjacking(); |
| 41 | + $out->addModuleStyles( 'mediawiki.special' ); |
42 | 42 | |
43 | 43 | $groups = $this->getPageGroups(); |
44 | 44 | |
— | — | @@ -88,9 +88,9 @@ |
89 | 89 | } |
90 | 90 | |
91 | 91 | private function outputPageList( $groups ) { |
92 | | - global $wgUser, $wgOut, $wgMiserMode; |
| 92 | + global $wgMiserMode; |
| 93 | + $out = $this->getOutput(); |
93 | 94 | |
94 | | - $sk = $wgUser->getSkin(); |
95 | 95 | $includesRestrictedPages = false; |
96 | 96 | $includesCachedPages = false; |
97 | 97 | |
— | — | @@ -99,8 +99,8 @@ |
100 | 100 | $total = count( $sortedPages ); |
101 | 101 | $count = 0; |
102 | 102 | |
103 | | - $wgOut->wrapWikiMsg( "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n", "specialpages-group-$group" ); |
104 | | - $wgOut->addHTML( |
| 103 | + $out->wrapWikiMsg( "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n", "specialpages-group-$group" ); |
| 104 | + $out->addHTML( |
105 | 105 | Html::openElement( 'table', array( 'style' => 'width:100%;', 'class' => 'mw-specialpages-table' ) ) ."\n" . |
106 | 106 | Html::openElement( 'tr' ) . "\n" . |
107 | 107 | Html::openElement( 'td', array( 'style' => 'width:30%;vertical-align:top' ) ) . "\n" . |
— | — | @@ -119,20 +119,20 @@ |
120 | 120 | $pageClasses[] = 'mw-specialpagerestricted'; |
121 | 121 | } |
122 | 122 | |
123 | | - $link = $sk->linkKnown( $title , htmlspecialchars( $desc ) ); |
124 | | - $wgOut->addHTML( Html::rawElement( 'li', array( 'class' => implode( ' ', $pageClasses ) ), $link ) . "\n" ); |
| 123 | + $link = Linker::linkKnown( $title , htmlspecialchars( $desc ) ); |
| 124 | + $out->addHTML( Html::rawElement( 'li', array( 'class' => implode( ' ', $pageClasses ) ), $link ) . "\n" ); |
125 | 125 | |
126 | 126 | # Split up the larger groups |
127 | 127 | $count++; |
128 | 128 | if( $total > 3 && $count == $middle ) { |
129 | | - $wgOut->addHTML( |
| 129 | + $out->addHTML( |
130 | 130 | Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) . |
131 | 131 | Html::element( 'td', array( 'style' => 'width:10%' ), '' ) . |
132 | 132 | Html::openElement( 'td', array( 'style' => 'width:30%' ) ) . Html::openElement( 'ul' ) . "\n" |
133 | 133 | ); |
134 | 134 | } |
135 | 135 | } |
136 | | - $wgOut->addHTML( |
| 136 | + $out->addHTML( |
137 | 137 | Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) . |
138 | 138 | Html::element( 'td', array( 'style' => 'width:30%' ), '' ) . |
139 | 139 | Html::closeElement( 'tr' ) . Html::closeElement( 'table' ) . "\n" |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | } |
142 | 142 | |
143 | 143 | if ( $includesRestrictedPages || $includesCachedPages ) { |
144 | | - $wgOut->wrapWikiMsg( "<div class=\"mw-specialpages-notes\">\n$1\n</div>", 'specialpages-note' ); |
| 144 | + $out->wrapWikiMsg( "<div class=\"mw-specialpages-notes\">\n$1\n</div>", 'specialpages-note' ); |
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php |
— | — | @@ -31,20 +31,15 @@ |
32 | 32 | // Stored objects |
33 | 33 | protected $opts, $target, $selfTitle; |
34 | 34 | |
35 | | - // Stored globals |
36 | | - protected $skin; |
37 | | - |
38 | 35 | protected $limits = array( 20, 50, 100, 250, 500 ); |
39 | 36 | |
40 | 37 | public function __construct() { |
41 | 38 | parent::__construct( 'Whatlinkshere' ); |
42 | | - global $wgUser; |
43 | | - $this->skin = $wgUser->getSkin(); |
44 | 39 | } |
45 | 40 | |
46 | 41 | function execute( $par ) { |
47 | | - global $wgOut, $wgRequest; |
48 | | - |
| 42 | + $out = $this->getOutput(); |
| 43 | + |
49 | 44 | $this->setHeaders(); |
50 | 45 | |
51 | 46 | $opts = new FormOptions(); |
— | — | @@ -59,7 +54,7 @@ |
60 | 55 | $opts->add( 'hidelinks', false ); |
61 | 56 | $opts->add( 'hideimages', false ); |
62 | 57 | |
63 | | - $opts->fetchValuesFromRequest( $wgRequest ); |
| 58 | + $opts->fetchValuesFromRequest( $this->getRequest() ); |
64 | 59 | $opts->validateIntBounds( 'limit', 0, 5000 ); |
65 | 60 | |
66 | 61 | // Give precedence to subpage syntax |
— | — | @@ -72,17 +67,17 @@ |
73 | 68 | |
74 | 69 | $this->target = Title::newFromURL( $opts->getValue( 'target' ) ); |
75 | 70 | if( !$this->target ) { |
76 | | - $wgOut->addHTML( $this->whatlinkshereForm() ); |
| 71 | + $out->addHTML( $this->whatlinkshereForm() ); |
77 | 72 | return; |
78 | 73 | } |
79 | 74 | |
80 | | - $this->skin->setRelevantTitle( $this->target ); |
| 75 | + $this->getSkin()->setRelevantTitle( $this->target ); |
81 | 76 | |
82 | 77 | |
83 | 78 | $this->selfTitle = $this->getTitle( $this->target->getPrefixedDBkey() ); |
84 | 79 | |
85 | | - $wgOut->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) ); |
86 | | - $wgOut->setSubtitle( wfMsg( 'whatlinkshere-backlink', $this->skin->link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) ); |
| 80 | + $out->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) ); |
| 81 | + $out->setSubtitle( wfMsg( 'whatlinkshere-backlink', Linker::link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) ); |
87 | 82 | |
88 | 83 | $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ), |
89 | 84 | $opts->getValue( 'from' ), $opts->getValue( 'back' ) ); |
— | — | @@ -97,7 +92,8 @@ |
98 | 93 | * @private |
99 | 94 | */ |
100 | 95 | function showIndirectLinks( $level, $target, $limit, $from = 0, $back = 0 ) { |
101 | | - global $wgOut, $wgMaxRedirectLinksRetrieved; |
| 96 | + global $wgMaxRedirectLinksRetrieved; |
| 97 | + $out = $this->getOutput(); |
102 | 98 | $dbr = wfGetDB( DB_SLAVE ); |
103 | 99 | $options = array(); |
104 | 100 | |
— | — | @@ -174,14 +170,14 @@ |
175 | 171 | |
176 | 172 | if( ( !$fetchlinks || !$dbr->numRows($plRes) ) && ( $hidetrans || !$dbr->numRows($tlRes) ) && ( $hideimages || !$dbr->numRows($ilRes) ) ) { |
177 | 173 | if ( 0 == $level ) { |
178 | | - $wgOut->addHTML( $this->whatlinkshereForm() ); |
| 174 | + $out->addHTML( $this->whatlinkshereForm() ); |
179 | 175 | |
180 | 176 | // Show filters only if there are links |
181 | 177 | if( $hidelinks || $hidetrans || $hideredirs || $hideimages ) |
182 | | - $wgOut->addHTML( $this->getFilterPanel() ); |
| 178 | + $out->addHTML( $this->getFilterPanel() ); |
183 | 179 | |
184 | 180 | $errMsg = is_int($namespace) ? 'nolinkshere-ns' : 'nolinkshere'; |
185 | | - $wgOut->addWikiMsg( $errMsg, $this->target->getPrefixedText() ); |
| 181 | + $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() ); |
186 | 182 | } |
187 | 183 | return; |
188 | 184 | } |
— | — | @@ -231,31 +227,31 @@ |
232 | 228 | $prevId = $from; |
233 | 229 | |
234 | 230 | if ( $level == 0 ) { |
235 | | - $wgOut->addHTML( $this->whatlinkshereForm() ); |
236 | | - $wgOut->addHTML( $this->getFilterPanel() ); |
237 | | - $wgOut->addWikiMsg( 'linkshere', $this->target->getPrefixedText() ); |
| 231 | + $out->addHTML( $this->whatlinkshereForm() ); |
| 232 | + $out->addHTML( $this->getFilterPanel() ); |
| 233 | + $out->addWikiMsg( 'linkshere', $this->target->getPrefixedText() ); |
238 | 234 | |
239 | 235 | $prevnext = $this->getPrevNext( $prevId, $nextId ); |
240 | | - $wgOut->addHTML( $prevnext ); |
| 236 | + $out->addHTML( $prevnext ); |
241 | 237 | } |
242 | 238 | |
243 | | - $wgOut->addHTML( $this->listStart( $level ) ); |
| 239 | + $out->addHTML( $this->listStart( $level ) ); |
244 | 240 | foreach ( $rows as $row ) { |
245 | 241 | $nt = Title::makeTitle( $row->page_namespace, $row->page_title ); |
246 | 242 | |
247 | 243 | if ( $row->page_is_redirect && $level < 2 ) { |
248 | | - $wgOut->addHTML( $this->listItem( $row, $nt, true ) ); |
| 244 | + $out->addHTML( $this->listItem( $row, $nt, true ) ); |
249 | 245 | $this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved ); |
250 | | - $wgOut->addHTML( Xml::closeElement( 'li' ) ); |
| 246 | + $out->addHTML( Xml::closeElement( 'li' ) ); |
251 | 247 | } else { |
252 | | - $wgOut->addHTML( $this->listItem( $row, $nt ) ); |
| 248 | + $out->addHTML( $this->listItem( $row, $nt ) ); |
253 | 249 | } |
254 | 250 | } |
255 | 251 | |
256 | | - $wgOut->addHTML( $this->listEnd() ); |
| 252 | + $out->addHTML( $this->listEnd() ); |
257 | 253 | |
258 | 254 | if( $level == 0 ) { |
259 | | - $wgOut->addHTML( $prevnext ); |
| 255 | + $out->addHTML( $prevnext ); |
260 | 256 | } |
261 | 257 | } |
262 | 258 | |
— | — | @@ -281,7 +277,7 @@ |
282 | 278 | $query = array(); |
283 | 279 | } |
284 | 280 | |
285 | | - $link = $this->skin->linkKnown( |
| 281 | + $link = Linker::linkKnown( |
286 | 282 | $nt, |
287 | 283 | null, |
288 | 284 | array(), |
— | — | @@ -320,7 +316,7 @@ |
321 | 317 | if ( $title === null ) |
322 | 318 | $title = $this->getTitle(); |
323 | 319 | |
324 | | - return $this->skin->linkKnown( |
| 320 | + return Linker::linkKnown( |
325 | 321 | $title, |
326 | 322 | $text, |
327 | 323 | array(), |
— | — | @@ -329,7 +325,7 @@ |
330 | 326 | } |
331 | 327 | |
332 | 328 | function makeSelfLink( $text, $query ) { |
333 | | - return $this->skin->linkKnown( |
| 329 | + return Linker::linkKnown( |
334 | 330 | $this->selfTitle, |
335 | 331 | $text, |
336 | 332 | array(), |
Index: trunk/phase3/includes/specials/SpecialListgrouprights.php |
— | — | @@ -30,30 +30,27 @@ |
31 | 31 | */ |
32 | 32 | class SpecialListGroupRights extends SpecialPage { |
33 | 33 | |
34 | | - var $skin; |
35 | | - |
36 | 34 | /** |
37 | 35 | * Constructor |
38 | 36 | */ |
39 | 37 | function __construct() { |
40 | | - global $wgUser; |
41 | 38 | parent::__construct( 'Listgrouprights' ); |
42 | | - $this->skin = $wgUser->getSkin(); |
43 | 39 | } |
44 | 40 | |
45 | 41 | /** |
46 | 42 | * Show the special page |
47 | 43 | */ |
48 | 44 | public function execute( $par ) { |
49 | | - global $wgOut, $wgImplicitGroups; |
| 45 | + global $wgImplicitGroups; |
50 | 46 | global $wgGroupPermissions, $wgRevokePermissions, $wgAddGroups, $wgRemoveGroups; |
51 | 47 | global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf; |
| 48 | + $out = $this->getOutput(); |
52 | 49 | |
53 | 50 | $this->setHeaders(); |
54 | 51 | $this->outputHeader(); |
55 | | - $wgOut->addModuleStyles( 'mediawiki.special' ); |
| 52 | + $out->addModuleStyles( 'mediawiki.special' ); |
56 | 53 | |
57 | | - $wgOut->addHTML( |
| 54 | + $out->addHTML( |
58 | 55 | Xml::openElement( 'table', array( 'class' => 'wikitable mw-listgrouprights-table' ) ) . |
59 | 56 | '<tr>' . |
60 | 57 | Xml::element( 'th', null, wfMsg( 'listgrouprights-group' ) ) . |
— | — | @@ -91,7 +88,7 @@ |
92 | 89 | // Do not make a link for the generic * group |
93 | 90 | $grouppage = htmlspecialchars( $groupnameLocalized ); |
94 | 91 | } else { |
95 | | - $grouppage = $this->skin->link( |
| 92 | + $grouppage = Linker::link( |
96 | 93 | Title::newFromText( $grouppageLocalized ), |
97 | 94 | htmlspecialchars( $groupnameLocalized ) |
98 | 95 | ); |
— | — | @@ -99,7 +96,7 @@ |
100 | 97 | |
101 | 98 | if ( $group === 'user' ) { |
102 | 99 | // Link to Special:listusers for implicit group 'user' |
103 | | - $grouplink = '<br />' . $this->skin->link( |
| 100 | + $grouplink = '<br />' . Linker::link( |
104 | 101 | SpecialPage::getTitleFor( 'Listusers' ), |
105 | 102 | wfMsgHtml( 'listgrouprights-members' ), |
106 | 103 | array(), |
— | — | @@ -107,7 +104,7 @@ |
108 | 105 | array( 'known', 'noclasses' ) |
109 | 106 | ); |
110 | 107 | } elseif ( !in_array( $group, $wgImplicitGroups ) ) { |
111 | | - $grouplink = '<br />' . $this->skin->link( |
| 108 | + $grouplink = '<br />' . Linker::link( |
112 | 109 | SpecialPage::getTitleFor( 'Listusers' ), |
113 | 110 | wfMsgHtml( 'listgrouprights-members' ), |
114 | 111 | array(), |
— | — | @@ -126,7 +123,7 @@ |
127 | 124 | $removegroupsSelf = isset( $wgGroupsRemoveFromSelf[$group] ) ? $wgGroupsRemoveFromSelf[$group] : array(); |
128 | 125 | |
129 | 126 | $id = $group == '*' ? false : Sanitizer::escapeId( $group ); |
130 | | - $wgOut->addHTML( Html::rawElement( 'tr', array( 'id' => $id ), |
| 127 | + $out->addHTML( Html::rawElement( 'tr', array( 'id' => $id ), |
131 | 128 | " |
132 | 129 | <td>$grouppage$grouplink</td> |
133 | 130 | <td>" . |
— | — | @@ -135,10 +132,10 @@ |
136 | 133 | ' |
137 | 134 | ) ); |
138 | 135 | } |
139 | | - $wgOut->addHTML( |
| 136 | + $out->addHTML( |
140 | 137 | Xml::closeElement( 'table' ) . "\n<br /><hr />\n" |
141 | 138 | ); |
142 | | - $wgOut->wrapWikiMsg( "<div class=\"mw-listgrouprights-key\">\n$1\n</div>", 'listgrouprights-key' ); |
| 139 | + $out->wrapWikiMsg( "<div class=\"mw-listgrouprights-key\">\n$1\n</div>", 'listgrouprights-key' ); |
143 | 140 | } |
144 | 141 | |
145 | 142 | /** |