Index: branches/querypage-work/phase3/includes/QueryPage.php |
— | — | @@ -33,10 +33,10 @@ |
34 | 34 | array( 'MostrevisionsPage', 'Mostrevisions' ), |
35 | 35 | array( 'FewestrevisionsPage', 'Fewestrevisions' ), |
36 | 36 | array( 'ShortPagesPage', 'Shortpages' ), |
37 | | - array( 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ), |
38 | | - array( 'UncategorizedPagesPage', 'Uncategorizedpages' ), |
39 | | - array( 'UncategorizedImagesPage', 'Uncategorizedimages' ), |
40 | | - array( 'UncategorizedTemplatesPage', 'Uncategorizedtemplates' ), |
| 37 | + array( 'UncategorizedcategoriesPage', 'Uncategorizedcategories' ), |
| 38 | + array( 'UncategorizedpagesPage', 'Uncategorizedpages' ), |
| 39 | + array( 'UncategorizedimagesPage', 'Uncategorizedimages' ), |
| 40 | + array( 'UncategorizedtemplatesPage', 'Uncategorizedtemplates' ), |
41 | 41 | array( 'UnusedCategoriesPage', 'Unusedcategories' ), |
42 | 42 | array( 'UnusedimagesPage', 'Unusedimages' ), |
43 | 43 | array( 'WantedCategoriesPage', 'Wantedcategories' ), |
— | — | @@ -82,13 +82,6 @@ |
83 | 83 | var $shownavigation = true; |
84 | 84 | |
85 | 85 | /** |
86 | | - * Constructor |
87 | | - */ |
88 | | - public function __construct() { |
89 | | - parent::__construct( $this->getName() ); |
90 | | - } |
91 | | - |
92 | | - /** |
93 | 86 | * A mutator for $this->listoutput; |
94 | 87 | * |
95 | 88 | * @param bool $bool |
— | — | @@ -98,14 +91,6 @@ |
99 | 92 | } |
100 | 93 | |
101 | 94 | /** |
102 | | - * Subclasses return their name here. Make sure the name is also |
103 | | - * specified in SpecialPage.php and in Language.php as a language |
104 | | - * message param. |
105 | | - */ |
106 | | - abstract function getName(); |
107 | | - } |
108 | | - |
109 | | - /** |
110 | 95 | * Return title object representing this page |
111 | 96 | * |
112 | 97 | * @return Title |
— | — | @@ -380,23 +365,23 @@ |
381 | 366 | * real, honest-to-gosh query page. |
382 | 367 | */ |
383 | 368 | function execute( $par ) { |
384 | | - global $wgUser, $wgOut, $wgLang, $wgContLang; |
385 | | - |
386 | | - list( $this->offset, $this->limit ) = wfCheckLimits(); |
387 | | - |
| 369 | + global $wgUser, $wgOut, $wgLang; |
| 370 | + |
| 371 | + list( $this->limit, $this->offset ) = wfCheckLimits(); |
388 | 372 | $sname = $this->getName(); |
389 | | - $fname = get_class($this) . '::doQuery'; |
| 373 | + $fname = get_class( $this ) . '::doQuery'; |
390 | 374 | $dbr = wfGetDB( DB_SLAVE ); |
391 | 375 | |
| 376 | + $this->setHeaders(); |
392 | 377 | $wgOut->setSyndicated( $this->isSyndicated() ); |
393 | 378 | |
394 | 379 | // TODO: Use doQuery() |
395 | 380 | //$res = null; |
396 | 381 | if ( !$this->isCached() ) { |
397 | | - $res = $this->reallyDoQuery( $limit, $offset ); |
| 382 | + $res = $this->reallyDoQuery( $this->limit, $this->offset ); |
398 | 383 | } else { |
399 | 384 | # Get the cached result |
400 | | - $res = $this->fetchFromCache( $limit, $offset ); |
| 385 | + $res = $this->fetchFromCache( $this->limit, $this->offset ); |
401 | 386 | if( !$this->listoutput ) { |
402 | 387 | |
403 | 388 | # Fetch the timestamp of this update |
— | — | @@ -433,10 +418,11 @@ |
434 | 419 | if( $this->shownavigation ) { |
435 | 420 | $wgOut->addHTML( $this->getPageHeader() ); |
436 | 421 | if( $num > 0 ) { |
437 | | - $wgOut->addHTML( '<p>' . wfShowingResults( $offset, $num ) . '</p>' ); |
| 422 | + $wgOut->addHTML( '<p>' . wfShowingResults( $this->offset, $num ) . '</p>' ); |
438 | 423 | # Disable the "next" link when we reach the end |
439 | | - $paging = wfViewPrevNext( $offset, $limit, $wgContLang->specialPage( $sname ), |
440 | | - wfArrayToCGI( $this->linkParameters() ), ( $num < $limit ) ); |
| 424 | + $paging = wfViewPrevNext( $this->offset, $this->limit, |
| 425 | + $this->getTitle( $par ), |
| 426 | + wfArrayToCGI( $this->linkParameters() ), ( $num < $this->limit ) ); |
441 | 427 | $wgOut->addHTML( '<p>' . $paging . '</p>' ); |
442 | 428 | } else { |
443 | 429 | # No results to show, so don't bother with "showing X of Y" etc. |
— | — | @@ -455,10 +441,10 @@ |
456 | 442 | $dbr, # Should use a ResultWrapper for this |
457 | 443 | $res, |
458 | 444 | $dbr->numRows( $res ), |
459 | | - $offset ); |
| 445 | + $this->offset ); |
460 | 446 | |
461 | 447 | # Repeat the paging links at the bottom |
462 | | - if( $shownavigation ) { |
| 448 | + if( $this->shownavigation ) { |
463 | 449 | $wgOut->addHTML( '<p>' . $paging . '</p>' ); |
464 | 450 | } |
465 | 451 | |