From f07418625975dd3a0fcd56917fa9a4c8dd13ab86 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 16 Oct 2005 02:04:25 +0000 Subject: [PATCH] * Support including this special page * Minor code cleanup --- includes/SpecialWantedpages.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index 2f16efb5a9..2111844ba8 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -8,7 +8,7 @@ /** * */ -require_once ( 'QueryPage.php' ) ; +require_once 'QueryPage.php'; /** * @@ -16,6 +16,9 @@ require_once ( 'QueryPage.php' ) ; * @subpackage SpecialPage */ class WantedPagesPage extends QueryPage { + function WantedPagesPage( $inc ) { + $this->setListoutput( $inc ); + } function getName() { return 'Wantedpages'; @@ -50,23 +53,28 @@ class WantedPagesPage extends QueryPage { $text = $wgContLang->convert( $nt->getPrefixedText() ); $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), $text ); - $nl = wfMsg( "nlinks", $result->value ); - $nlink = $skin->makeKnownLink( $wgContLang->specialPage( "Whatlinkshere" ), $nl, - "target=" . $nt->getPrefixedURL() ); + $nl = wfMsg( 'nlinks', $result->value ); + $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Whatlinkshere' ), $nl, 'target=' . $nt->getPrefixedURL() ); - return "{$plink} ({$nlink})"; + return "$plink ($nlink)"; } } /** * constructor */ -function wfSpecialWantedpages() { - list( $limit, $offset ) = wfCheckLimits(); +function wfSpecialWantedpages( $par = null, $specialPage ) { + $inc = $specialPage->including(); + + if ( $inc ) { + $limit = (int)$par; + $offset = 0; + } else + list( $limit, $offset ) = wfCheckLimits(); - $wpp = new WantedPagesPage(); + $wpp = new WantedPagesPage( $inc ); - $wpp->doQuery( $offset, $limit ); + $wpp->doQuery( $offset, $limit, !$inc ); } ?> -- 2.20.1