Index: trunk/phase3/includes/QueryPage.php |
— | — | @@ -437,24 +437,23 @@ |
438 | 438 | * real, honest-to-gosh query page. |
439 | 439 | */ |
440 | 440 | function execute( $par ) { |
441 | | - global $wgUser, $wgOut, $wgLang, $wgRequest; |
442 | | - |
443 | | - if ( !$this->userCanExecute( $wgUser ) ) { |
| 441 | + if ( !$this->userCanExecute( $this->getUser() ) ) { |
444 | 442 | $this->displayRestrictionError(); |
445 | 443 | return; |
446 | 444 | } |
447 | 445 | |
448 | 446 | if ( $this->limit == 0 && $this->offset == 0 ) { |
449 | | - list( $this->limit, $this->offset ) = $wgRequest->getLimitOffset(); |
| 447 | + list( $this->limit, $this->offset ) = $this->getRequest()->getLimitOffset(); |
450 | 448 | } |
451 | 449 | $dbr = wfGetDB( DB_SLAVE ); |
452 | 450 | |
453 | 451 | $this->setHeaders(); |
454 | | - $wgOut->setSyndicated( $this->isSyndicated() ); |
| 452 | + $out = $this->getOutput(); |
| 453 | + $out->setSyndicated( $this->isSyndicated() ); |
455 | 454 | |
456 | 455 | if ( $this->isCached() && !$this->isCacheable() ) { |
457 | | - $wgOut->setSyndicated( false ); |
458 | | - $wgOut->addWikiMsg( 'querypage-disabled' ); |
| 456 | + $out->setSyndicated( false ); |
| 457 | + $out->addWikiMsg( 'querypage-disabled' ); |
459 | 458 | return 0; |
460 | 459 | } |
461 | 460 | |
— | — | @@ -471,21 +470,22 @@ |
472 | 471 | $ts = $this->getCachedTimestamp(); |
473 | 472 | |
474 | 473 | if ( $ts ) { |
475 | | - $updated = $wgLang->timeanddate( $ts, true, true ); |
476 | | - $updateddate = $wgLang->date( $ts, true, true ); |
477 | | - $updatedtime = $wgLang->time( $ts, true, true ); |
478 | | - $wgOut->addMeta( 'Data-Cache-Time', $ts ); |
479 | | - $wgOut->addInlineScript( "var dataCacheTime = '$ts';" ); |
480 | | - $wgOut->addWikiMsg( 'perfcachedts', $updated, $updateddate, $updatedtime ); |
| 474 | + $lang = $this->getLang(); |
| 475 | + $updated = $lang->timeanddate( $ts, true, true ); |
| 476 | + $updateddate = $lang->date( $ts, true, true ); |
| 477 | + $updatedtime = $lang->time( $ts, true, true ); |
| 478 | + $out->addMeta( 'Data-Cache-Time', $ts ); |
| 479 | + $out->addInlineScript( "var dataCacheTime = '$ts';" ); |
| 480 | + $out->addWikiMsg( 'perfcachedts', $updated, $updateddate, $updatedtime ); |
481 | 481 | } else { |
482 | | - $wgOut->addWikiMsg( 'perfcached' ); |
| 482 | + $out->addWikiMsg( 'perfcached' ); |
483 | 483 | } |
484 | 484 | |
485 | 485 | # If updates on this page have been disabled, let the user know |
486 | 486 | # that the data set won't be refreshed for now |
487 | 487 | global $wgDisableQueryPageUpdate; |
488 | 488 | if ( is_array( $wgDisableQueryPageUpdate ) && in_array( $this->getName(), $wgDisableQueryPageUpdate ) ) { |
489 | | - $wgOut->addWikiMsg( 'querypage-no-updates' ); |
| 489 | + $out->addWikiMsg( 'querypage-no-updates' ); |
490 | 490 | } |
491 | 491 | |
492 | 492 | } |
— | — | @@ -496,23 +496,23 @@ |
497 | 497 | |
498 | 498 | $this->preprocessResults( $dbr, $res ); |
499 | 499 | |
500 | | - $wgOut->addHTML( Xml::openElement( 'div', array( 'class' => 'mw-spcontent' ) ) ); |
| 500 | + $out->addHTML( Xml::openElement( 'div', array( 'class' => 'mw-spcontent' ) ) ); |
501 | 501 | |
502 | 502 | # Top header and navigation |
503 | 503 | if ( $this->shownavigation ) { |
504 | | - $wgOut->addHTML( $this->getPageHeader() ); |
| 504 | + $out->addHTML( $this->getPageHeader() ); |
505 | 505 | if ( $this->numRows > 0 ) { |
506 | | - $wgOut->addHTML( '<p>' . wfShowingResults( $this->offset, $this->numRows ) . '</p>' ); |
| 506 | + $out->addHTML( '<p>' . wfShowingResults( $this->offset, $this->numRows ) . '</p>' ); |
507 | 507 | # Disable the "next" link when we reach the end |
508 | 508 | $paging = wfViewPrevNext( $this->offset, $this->limit, |
509 | 509 | $this->getTitle( $par ), |
510 | 510 | wfArrayToCGI( $this->linkParameters() ), ( $this->numRows < $this->limit ) ); |
511 | | - $wgOut->addHTML( '<p>' . $paging . '</p>' ); |
| 511 | + $out->addHTML( '<p>' . $paging . '</p>' ); |
512 | 512 | } else { |
513 | 513 | # No results to show, so don't bother with "showing X of Y" etc. |
514 | 514 | # -- just let the user know and give up now |
515 | | - $wgOut->addHTML( '<p>' . wfMsgHtml( 'specialpage-empty' ) . '</p>' ); |
516 | | - $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
| 515 | + $out->addHTML( '<p>' . wfMsgHtml( 'specialpage-empty' ) . '</p>' ); |
| 516 | + $out->addHTML( Xml::closeElement( 'div' ) ); |
517 | 517 | return; |
518 | 518 | } |
519 | 519 | } |
— | — | @@ -520,7 +520,7 @@ |
521 | 521 | # The actual results; specialist subclasses will want to handle this |
522 | 522 | # with more than a straight list, so we hand them the info, plus |
523 | 523 | # an OutputPage, and let them get on with it |
524 | | - $this->outputResults( $wgOut, |
| 524 | + $this->outputResults( $out, |
525 | 525 | $this->getSkin(), |
526 | 526 | $dbr, # Should use a ResultWrapper for this |
527 | 527 | $res, |
— | — | @@ -529,10 +529,10 @@ |
530 | 530 | |
531 | 531 | # Repeat the paging links at the bottom |
532 | 532 | if ( $this->shownavigation ) { |
533 | | - $wgOut->addHTML( '<p>' . $paging . '</p>' ); |
| 533 | + $out->addHTML( '<p>' . $paging . '</p>' ); |
534 | 534 | } |
535 | 535 | |
536 | | - $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
| 536 | + $out->addHTML( Xml::closeElement( 'div' ) ); |
537 | 537 | |
538 | 538 | return $this->numRows; |
539 | 539 | } |
— | — | @@ -617,8 +617,7 @@ |
618 | 618 | global $wgFeed, $wgFeedClasses; |
619 | 619 | |
620 | 620 | if ( !$wgFeed ) { |
621 | | - global $wgOut; |
622 | | - $wgOut->addWikiMsg( 'feed-unavailable' ); |
| 621 | + $this->getOutput()->addWikiMsg( 'feed-unavailable' ); |
623 | 622 | return; |
624 | 623 | } |
625 | 624 | |
— | — | @@ -787,10 +786,9 @@ |
788 | 787 | * @return string |
789 | 788 | */ |
790 | 789 | private function makeWlhLink( $title, $skin, $result ) { |
791 | | - global $wgLang; |
792 | 790 | $wlh = SpecialPage::getTitleFor( 'Whatlinkshere' ); |
793 | 791 | $label = wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ), |
794 | | - $wgLang->formatNum( $result->value ) ); |
| 792 | + $this->getLang()->formatNum( $result->value ) ); |
795 | 793 | return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) ); |
796 | 794 | } |
797 | 795 | } |