Index: trunk/phase3/includes/specials/SpecialAllpages.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | |
66 | 66 | $this->setHeaders(); |
67 | 67 | $this->outputHeader(); |
68 | | - $out->allowClickjacking(); |
| 68 | + $this->allowClickjacking(); |
69 | 69 | |
70 | 70 | # GET values |
71 | 71 | $from = $request->getVal( 'from', null ); |
— | — | @@ -73,12 +73,17 @@ |
74 | 74 | |
75 | 75 | $namespaces = $wgContLang->getNamespaces(); |
76 | 76 | |
77 | | - $out->setPagetitle( |
78 | | - ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ? |
79 | | - wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) : |
80 | | - wfMsg( 'allarticles' ) |
81 | | - ); |
82 | | - $out->addModuleStyles( 'mediawiki.special' ); |
| 77 | + if( !$this->including() ) { |
| 78 | + $out->setPagetitle( |
| 79 | + ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ? |
| 80 | + wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) : |
| 81 | + wfMsg( 'allarticles' ) |
| 82 | + ); |
| 83 | + // Note: The following will not end up in the parser output cache as |
| 84 | + // a result even if we wanted to load it on pages including the |
| 85 | + // special page it would be unstable. |
| 86 | + $out->addModuleStyles( 'mediawiki.special' ); |
| 87 | + } |
83 | 88 | |
84 | 89 | if( isset($par) ) { |
85 | 90 | $this->showChunk( $namespace, $par, $to ); |
Index: trunk/phase3/includes/specials/SpecialNewpages.php |
— | — | @@ -35,11 +35,6 @@ |
36 | 36 | */ |
37 | 37 | protected $opts; |
38 | 38 | |
39 | | - /** |
40 | | - * @var Skin |
41 | | - */ |
42 | | - protected $skin; |
43 | | - |
44 | 39 | // Some internal settings |
45 | 40 | protected $showNavigation = false; |
46 | 41 | |
— | — | @@ -48,16 +43,16 @@ |
49 | 44 | } |
50 | 45 | |
51 | 46 | protected function setup( $par ) { |
52 | | - global $wgRequest, $wgUser, $wgEnableNewpagesUserFilter; |
| 47 | + global $wgEnableNewpagesUserFilter; |
53 | 48 | |
54 | 49 | // Options |
55 | 50 | $opts = new FormOptions(); |
56 | 51 | $this->opts = $opts; // bind |
57 | 52 | $opts->add( 'hideliu', false ); |
58 | | - $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'newpageshidepatrolled' ) ); |
| 53 | + $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'newpageshidepatrolled' ) ); |
59 | 54 | $opts->add( 'hidebots', false ); |
60 | 55 | $opts->add( 'hideredirs', true ); |
61 | | - $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) ); |
| 56 | + $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) ); |
62 | 57 | $opts->add( 'offset', '' ); |
63 | 58 | $opts->add( 'namespace', '0' ); |
64 | 59 | $opts->add( 'username', '' ); |
— | — | @@ -65,7 +60,7 @@ |
66 | 61 | $opts->add( 'tagfilter', '' ); |
67 | 62 | |
68 | 63 | // Set values |
69 | | - $opts->fetchValuesFromRequest( $wgRequest ); |
| 64 | + $opts->fetchValuesFromRequest( $this->getRequest() ); |
70 | 65 | if ( $par ) $this->parseParams( $par ); |
71 | 66 | |
72 | 67 | // Validate |
— | — | @@ -73,9 +68,6 @@ |
74 | 69 | if( !$wgEnableNewpagesUserFilter ) { |
75 | 70 | $opts->setValue( 'username', '' ); |
76 | 71 | } |
77 | | - |
78 | | - // Store some objects |
79 | | - $this->skin = $wgUser->getSkin(); |
80 | 72 | } |
81 | 73 | |
82 | 74 | protected function parseParams( $par ) { |
— | — | @@ -128,7 +120,7 @@ |
129 | 121 | * @return String |
130 | 122 | */ |
131 | 123 | public function execute( $par ) { |
132 | | - global $wgOut; |
| 124 | + $out = $this->getOutput(); |
133 | 125 | |
134 | 126 | $this->setHeaders(); |
135 | 127 | $this->outputHeader(); |
— | — | @@ -156,14 +148,14 @@ |
157 | 149 | if ( $this->showNavigation ) { |
158 | 150 | $navigation = $pager->getNavigationBar(); |
159 | 151 | } |
160 | | - $wgOut->addHTML( $navigation . $pager->getBody() . $navigation ); |
| 152 | + $out->addHTML( $navigation . $pager->getBody() . $navigation ); |
161 | 153 | } else { |
162 | | - $wgOut->addWikiMsg( 'specialpage-empty' ); |
| 154 | + $out->addWikiMsg( 'specialpage-empty' ); |
163 | 155 | } |
164 | 156 | } |
165 | 157 | |
166 | 158 | protected function filterLinks() { |
167 | | - global $wgGroupPermissions, $wgUser, $wgLang; |
| 159 | + global $wgGroupPermissions, $wgLang; |
168 | 160 | |
169 | 161 | // show/hide links |
170 | 162 | $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) ); |
— | — | @@ -182,7 +174,7 @@ |
183 | 175 | unset( $filters['hideliu'] ); |
184 | 176 | } |
185 | 177 | |
186 | | - if ( !$wgUser->useNPPatrol() ) { |
| 178 | + if ( !$this->getUser()->useNPPatrol() ) { |
187 | 179 | unset( $filters['hidepatrolled'] ); |
188 | 180 | } |
189 | 181 | |
— | — | @@ -193,7 +185,7 @@ |
194 | 186 | $self = $this->getTitle(); |
195 | 187 | foreach ( $filters as $key => $msg ) { |
196 | 188 | $onoff = 1 - $this->opts->getValue( $key ); |
197 | | - $link = $this->skin->link( $self, $showhide[$onoff], array(), |
| 189 | + $link = $this->getSkin()->link( $self, $showhide[$onoff], array(), |
198 | 190 | array( $key => $onoff ) + $changed |
199 | 191 | ); |
200 | 192 | $links[$key] = wfMsgHtml( $msg, $link ); |
— | — | @@ -203,7 +195,7 @@ |
204 | 196 | } |
205 | 197 | |
206 | 198 | protected function form() { |
207 | | - global $wgOut, $wgEnableNewpagesUserFilter, $wgScript; |
| 199 | + global $wgEnableNewpagesUserFilter, $wgScript; |
208 | 200 | |
209 | 201 | // Consume values |
210 | 202 | $this->opts->consumeValue( 'offset' ); // don't carry offset, DWIW |
— | — | @@ -272,13 +264,13 @@ |
273 | 265 | $hidden . |
274 | 266 | Xml::closeElement( 'form' ); |
275 | 267 | |
276 | | - $wgOut->addHTML( $form ); |
| 268 | + $this->getOutput()->addHTML( $form ); |
277 | 269 | } |
278 | 270 | |
279 | 271 | protected function setSyndicated() { |
280 | | - global $wgOut; |
281 | | - $wgOut->setSyndicated( true ); |
282 | | - $wgOut->setFeedAppendQuery( wfArrayToCGI( $this->opts->getAllValues() ) ); |
| 272 | + $out = $this->getOutput(); |
| 273 | + $out->setSyndicated( true ); |
| 274 | + $out->setFeedAppendQuery( wfArrayToCGI( $this->opts->getAllValues() ) ); |
283 | 275 | } |
284 | 276 | |
285 | 277 | /** |
— | — | @@ -314,14 +306,14 @@ |
315 | 307 | $query['rcid'] = $result->rc_id; |
316 | 308 | } |
317 | 309 | |
318 | | - $plink = $this->skin->linkKnown( |
| 310 | + $plink = $this->getSkin()->linkKnown( |
319 | 311 | $title, |
320 | 312 | null, |
321 | 313 | array( 'class' => 'mw-newpages-pagename' ), |
322 | 314 | $query, |
323 | 315 | array( 'known' ) // Set explicitly to avoid the default of 'known','noclasses'. This breaks the colouration for stubs |
324 | 316 | ); |
325 | | - $histLink = $this->skin->linkKnown( |
| 317 | + $histLink = $this->getSkin()->linkKnown( |
326 | 318 | $title, |
327 | 319 | wfMsgHtml( 'hist' ), |
328 | 320 | array(), |
— | — | @@ -334,8 +326,8 @@ |
335 | 327 | ']' |
336 | 328 | ); |
337 | 329 | |
338 | | - $ulink = $this->skin->revUserTools( $rev ); |
339 | | - $comment = $this->skin->revComment( $rev ); |
| 330 | + $ulink = $this->getSkin()->revUserTools( $rev ); |
| 331 | + $comment = $this->getSkin()->revComment( $rev ); |
340 | 332 | |
341 | 333 | if ( $this->patrollable( $result ) ) { |
342 | 334 | $classes[] = 'not-patrolled'; |
— | — | @@ -366,8 +358,7 @@ |
367 | 359 | * @return Boolean |
368 | 360 | */ |
369 | 361 | protected function patrollable( $result ) { |
370 | | - global $wgUser; |
371 | | - return ( $wgUser->useNPPatrol() && !$result->rc_patrolled ); |
| 362 | + return ( $this->getUser()->useNPPatrol() && !$result->rc_patrolled ); |
372 | 363 | } |
373 | 364 | |
374 | 365 | /** |
— | — | @@ -376,7 +367,7 @@ |
377 | 368 | * @param $type String |
378 | 369 | */ |
379 | 370 | protected function feed( $type ) { |
380 | | - global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut; |
| 371 | + global $wgFeed, $wgFeedClasses, $wgFeedLimit; |
381 | 372 | |
382 | 373 | if ( !$wgFeed ) { |
383 | 374 | $wgOut->addWikiMsg( 'feed-unavailable' ); |
— | — | @@ -384,7 +375,7 @@ |
385 | 376 | } |
386 | 377 | |
387 | 378 | if( !isset( $wgFeedClasses[$type] ) ) { |
388 | | - $wgOut->addWikiMsg( 'feed-invalid' ); |
| 379 | + $this->getOut()->addWikiMsg( 'feed-invalid' ); |
389 | 380 | return; |
390 | 381 | } |
391 | 382 | |
— | — | @@ -471,7 +462,7 @@ |
472 | 463 | } |
473 | 464 | |
474 | 465 | function getQueryInfo() { |
475 | | - global $wgEnableNewpagesUserFilter, $wgGroupPermissions, $wgUser; |
| 466 | + global $wgEnableNewpagesUserFilter, $wgGroupPermissions; |
476 | 467 | $conds = array(); |
477 | 468 | $conds['rc_new'] = 1; |
478 | 469 | |
— | — | @@ -497,7 +488,7 @@ |
498 | 489 | $conds['rc_user'] = 0; |
499 | 490 | } |
500 | 491 | # If this user cannot see patrolled edits or they are off, don't do dumb queries! |
501 | | - if( $this->opts->getValue( 'hidepatrolled' ) && $wgUser->useNPPatrol() ) { |
| 492 | + if( $this->opts->getValue( 'hidepatrolled' ) && $this->getUser()->useNPPatrol() ) { |
502 | 493 | $conds['rc_patrolled'] = 0; |
503 | 494 | } |
504 | 495 | if( $this->opts->getValue( 'hidebots' ) ) { |
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -39,18 +39,17 @@ |
40 | 40 | * @return FormOptions |
41 | 41 | */ |
42 | 42 | public function getDefaultOptions() { |
43 | | - global $wgUser; |
44 | 43 | $opts = new FormOptions(); |
45 | 44 | |
46 | | - $opts->add( 'days', (int)$wgUser->getOption( 'rcdays' ) ); |
47 | | - $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) ); |
| 45 | + $opts->add( 'days', (int)$this->getUser()->getOption( 'rcdays' ) ); |
| 46 | + $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) ); |
48 | 47 | $opts->add( 'from', '' ); |
49 | 48 | |
50 | | - $opts->add( 'hideminor', $wgUser->getBoolOption( 'hideminor' ) ); |
| 49 | + $opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) ); |
51 | 50 | $opts->add( 'hidebots', true ); |
52 | 51 | $opts->add( 'hideanons', false ); |
53 | 52 | $opts->add( 'hideliu', false ); |
54 | | - $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'hidepatrolled' ) ); |
| 53 | + $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'hidepatrolled' ) ); |
55 | 54 | $opts->add( 'hidemyself', false ); |
56 | 55 | |
57 | 56 | $opts->add( 'namespace', '', FormOptions::INTNULL ); |
— | — | @@ -212,11 +211,10 @@ |
213 | 212 | * @return String or false |
214 | 213 | */ |
215 | 214 | public function checkLastModified( $feedFormat ) { |
216 | | - global $wgOut, $wgUser; |
217 | 215 | $dbr = wfGetDB( DB_SLAVE ); |
218 | 216 | $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ ); |
219 | | - if( $feedFormat || !$wgUser->useRCPatrol() ) { |
220 | | - if( $lastmod && $wgOut->checkLastModified( $lastmod ) ) { |
| 217 | + if( $feedFormat || !$this->getUser()->useRCPatrol() ) { |
| 218 | + if( $lastmod && $this->getOutput()->checkLastModified( $lastmod ) ) { |
221 | 219 | # Client cache fresh and headers sent, nothing more to do. |
222 | 220 | return false; |
223 | 221 | } |
— | — | @@ -231,8 +229,6 @@ |
232 | 230 | * @return array |
233 | 231 | */ |
234 | 232 | public function buildMainQueryConds( FormOptions $opts ) { |
235 | | - global $wgUser; |
236 | | - |
237 | 233 | $dbr = wfGetDB( DB_SLAVE ); |
238 | 234 | $conds = array(); |
239 | 235 | |
— | — | @@ -264,7 +260,7 @@ |
265 | 261 | $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff ); |
266 | 262 | |
267 | 263 | |
268 | | - $hidePatrol = $wgUser->useRCPatrol() && $opts['hidepatrolled']; |
| 264 | + $hidePatrol = $this->getUser()->useRCPatrol() && $opts['hidepatrolled']; |
269 | 265 | $hideLoggedInUsers = $opts['hideliu'] && !$forcebot; |
270 | 266 | $hideAnonymousUsers = $opts['hideanons'] && !$forcebot; |
271 | 267 | |
— | — | @@ -276,10 +272,10 @@ |
277 | 273 | if( $hideAnonymousUsers ) $conds[] = 'rc_user != 0'; |
278 | 274 | |
279 | 275 | if( $opts['hidemyself'] ) { |
280 | | - if( $wgUser->getId() ) { |
281 | | - $conds[] = 'rc_user != ' . $dbr->addQuotes( $wgUser->getId() ); |
| 276 | + if( $this->getUser()->getId() ) { |
| 277 | + $conds[] = 'rc_user != ' . $dbr->addQuotes( $this->getUser()->getId() ); |
282 | 278 | } else { |
283 | | - $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() ); |
| 279 | + $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $this->getUser()->getName() ); |
284 | 280 | } |
285 | 281 | } |
286 | 282 | |
— | — | @@ -315,13 +311,11 @@ |
316 | 312 | * @return database result or false (for Recentchangeslinked only) |
317 | 313 | */ |
318 | 314 | public function doMainQuery( $conds, $opts ) { |
319 | | - global $wgUser; |
320 | | - |
321 | 315 | $tables = array( 'recentchanges' ); |
322 | 316 | $join_conds = array(); |
323 | 317 | $query_options = array( 'USE INDEX' => array('recentchanges' => 'rc_timestamp') ); |
324 | 318 | |
325 | | - $uid = $wgUser->getId(); |
| 319 | + $uid = $this->getUser()->getId(); |
326 | 320 | $dbr = wfGetDB( DB_SLAVE ); |
327 | 321 | $limit = $opts['limit']; |
328 | 322 | $namespace = $opts['namespace']; |
— | — | @@ -334,7 +328,7 @@ |
335 | 329 | $join_conds['watchlist'] = array('LEFT JOIN', |
336 | 330 | "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace"); |
337 | 331 | } |
338 | | - if ($wgUser->isAllowed("rollback")) { |
| 332 | + if ($this->getUser()->isAllowed("rollback")) { |
339 | 333 | $tables[] = 'page'; |
340 | 334 | $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); |
341 | 335 | } |
— | — | @@ -397,7 +391,7 @@ |
398 | 392 | * @param $opts FormOptions |
399 | 393 | */ |
400 | 394 | public function webOutput( $rows, $opts ) { |
401 | | - global $wgOut, $wgUser, $wgRCShowWatchingUsers, $wgShowUpdatedMarker; |
| 395 | + global $wgOut, $wgRCShowWatchingUsers, $wgShowUpdatedMarker; |
402 | 396 | global $wgAllowCategorizedRecentChanges; |
403 | 397 | |
404 | 398 | $limit = $opts['limit']; |
— | — | @@ -414,13 +408,13 @@ |
415 | 409 | $this->filterByCategories( $rows, $opts ); |
416 | 410 | } |
417 | 411 | |
418 | | - $showWatcherCount = $wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ); |
| 412 | + $showWatcherCount = $wgRCShowWatchingUsers && $this->getUser()->getOption( 'shownumberswatching' ); |
419 | 413 | $watcherCache = array(); |
420 | 414 | |
421 | 415 | $dbr = wfGetDB( DB_SLAVE ); |
422 | 416 | |
423 | 417 | $counter = 1; |
424 | | - $list = ChangesList::newFromUser( $wgUser ); |
| 418 | + $list = ChangesList::newFromUser( $this->getUser() ); |
425 | 419 | |
426 | 420 | $s = $list->beginRecentChangesList(); |
427 | 421 | foreach( $rows as $obj ) { |
— | — | @@ -664,14 +658,12 @@ |
665 | 659 | * @param $active Boolean: whether to show the link in bold |
666 | 660 | */ |
667 | 661 | function makeOptionsLink( $title, $override, $options, $active = false ) { |
668 | | - global $wgUser; |
669 | | - $sk = $wgUser->getSkin(); |
670 | 662 | $params = $override + $options; |
671 | 663 | if ( $active ) { |
672 | | - return $sk->link( $this->getTitle(), '<strong>' . htmlspecialchars( $title ) . '</strong>', |
| 664 | + return $this->getSkin()->link( $this->getTitle(), '<strong>' . htmlspecialchars( $title ) . '</strong>', |
673 | 665 | array(), $params, array( 'known' ) ); |
674 | 666 | } else { |
675 | | - return $sk->link( $this->getTitle(), htmlspecialchars( $title ), array() , $params, array( 'known' ) ); |
| 667 | + return $this->getSkin()->link( $this->getTitle(), htmlspecialchars( $title ), array() , $params, array( 'known' ) ); |
676 | 668 | } |
677 | 669 | } |
678 | 670 | |
— | — | @@ -682,7 +674,7 @@ |
683 | 675 | * @param $nondefaults Array |
684 | 676 | */ |
685 | 677 | function optionsPanel( $defaults, $nondefaults ) { |
686 | | - global $wgLang, $wgUser, $wgRCLinkLimits, $wgRCLinkDays; |
| 678 | + global $wgLang, $wgRCLinkLimits, $wgRCLinkDays; |
687 | 679 | |
688 | 680 | $options = $nondefaults + $defaults; |
689 | 681 | |
— | — | @@ -740,7 +732,7 @@ |
741 | 733 | $links[] = wfMsgHtml( 'rcshowhidebots', $botLink ); |
742 | 734 | $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink ); |
743 | 735 | $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink ); |
744 | | - if( $wgUser->useRCPatrol() ) |
| 736 | + if( $this->getUser()->useRCPatrol() ) |
745 | 737 | $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink ); |
746 | 738 | $links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink ); |
747 | 739 | $hl = $wgLang->pipeList( $links ); |
Index: trunk/phase3/includes/specials/SpecialNewimages.php |
— | — | @@ -27,17 +27,20 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | public function execute( $par ){ |
31 | | - global $wgOut; |
32 | | - |
33 | 31 | $this->setHeaders(); |
34 | 32 | $this->outputHeader(); |
35 | 33 | |
36 | 34 | $pager = new NewFilesPager( $par ); |
37 | 35 | |
38 | | - $form = $pager->getForm(); |
39 | | - $form->prepareForm(); |
40 | | - $form->displayForm( '' ); |
41 | | - $wgOut->addHTML( $pager->getBody() . $pager->getNavigationBar() ); |
| 36 | + if ( !$this->including() ) { |
| 37 | + $form = $pager->getForm(); |
| 38 | + $form->prepareForm(); |
| 39 | + $form->displayForm( '' ); |
| 40 | + } |
| 41 | + $this->getOutput()->addHTML( $pager->getBody() ); |
| 42 | + if ( !$this->including() ) { |
| 43 | + $this->getOutput()->addHTML( $pager->getNavigationBar() ); |
| 44 | + } |
42 | 45 | } |
43 | 46 | } |
44 | 47 | |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -621,6 +621,14 @@ |
622 | 622 | static function capturePath( &$title ) { |
623 | 623 | global $wgOut, $wgTitle, $wgUser; |
624 | 624 | |
| 625 | + // preload the skin - Sometimes the SpecialPage loads it at a bad point in time making a includable special page override the skin title |
| 626 | + // This hack is ok for now. The plan is for |
| 627 | + // - Skin to stop storing it's own title |
| 628 | + // - includable special pages to stop using $wgTitle and $wgOut |
| 629 | + // - and OutputPage to store it's own skin object instead of askin $wgUser |
| 630 | + // Once just about any of those are implemented preloading will not be necessarily |
| 631 | + $wgOut->getSkin(); |
| 632 | + |
625 | 633 | $oldTitle = $wgTitle; |
626 | 634 | $oldOut = $wgOut; |
627 | 635 | $wgOut = new OutputPage; |
— | — | @@ -862,18 +870,21 @@ |
863 | 871 | * Output an error message telling the user what access level they have to have |
864 | 872 | */ |
865 | 873 | function displayRestrictionError() { |
866 | | - global $wgOut; |
867 | | - $wgOut->permissionRequired( $this->mRestriction ); |
| 874 | + $this->getOutput()->permissionRequired( $this->mRestriction ); |
868 | 875 | } |
869 | 876 | |
870 | 877 | /** |
871 | 878 | * Sets headers - this should be called from the execute() method of all derived classes! |
872 | 879 | */ |
873 | 880 | function setHeaders() { |
874 | | - global $wgOut; |
875 | | - $wgOut->setArticleRelated( false ); |
876 | | - $wgOut->setRobotPolicy( "noindex,nofollow" ); |
877 | | - $wgOut->setPageTitle( $this->getDescription() ); |
| 881 | + if ( $this->including() ) { |
| 882 | + // Don't set these headers when special page is being included into an article |
| 883 | + return; |
| 884 | + } |
| 885 | + $out = $this->getOutput(); |
| 886 | + $out->setArticleRelated( false ); |
| 887 | + $out->setRobotPolicy( "noindex,nofollow" ); |
| 888 | + $out->setPageTitle( $this->getDescription() ); |
878 | 889 | } |
879 | 890 | |
880 | 891 | /** |
— | — | @@ -909,7 +920,7 @@ |
910 | 921 | * @param $summaryMessageKey String: message key of the summary |
911 | 922 | */ |
912 | 923 | function outputHeader( $summaryMessageKey = '' ) { |
913 | | - global $wgOut, $wgContLang; |
| 924 | + global $wgContLang; |
914 | 925 | |
915 | 926 | if( $summaryMessageKey == '' ) { |
916 | 927 | $msg = $wgContLang->lc( $this->name() ) . '-summary'; |
— | — | @@ -917,7 +928,7 @@ |
918 | 929 | $msg = $summaryMessageKey; |
919 | 930 | } |
920 | 931 | if ( !wfMessage( $msg )->isBlank() and ! $this->including() ) { |
921 | | - $wgOut->wrapWikiMsg( "<div class='mw-specialpage-summary'>\n$1\n</div>", $msg ); |
| 932 | + $this->getOutput()->wrapWikiMsg( "<div class='mw-specialpage-summary'>\n$1\n</div>", $msg ); |
922 | 933 | } |
923 | 934 | |
924 | 935 | } |
— | — | @@ -1044,6 +1055,16 @@ |
1045 | 1056 | } |
1046 | 1057 | |
1047 | 1058 | /** |
| 1059 | + * Shortcut to call OutputPage::allowClickjacking(); which also takes |
| 1060 | + * transclusion into account. |
| 1061 | + */ |
| 1062 | + public function allowClickjacking() { |
| 1063 | + if ( !$this->including() ) { |
| 1064 | + $this->getOutput()->allowClickjacking(); |
| 1065 | + } |
| 1066 | + } |
| 1067 | + |
| 1068 | + /** |
1048 | 1069 | * Wrapper around wfMessage that sets the current context. Currently this |
1049 | 1070 | * is only the title. |
1050 | 1071 | * |