*/
class WhatLinksHerePage {
var $request, $par;
- var $limit, $from, $back, $target, $namespace;
+ var $limit, $from, $back, $target;
var $selfTitle, $skin;
+ private $namespace;
+
function WhatLinksHerePage( &$request, $par = null ) {
global $wgUser;
$this->request =& $request;
return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query );
}
- function getPrevNext( $limit, $prevId, $nextId, $namespace ) {
+ function getPrevNext( $limit, $prevId, $nextId ) {
global $wgLang;
$fmtLimit = $wgLang->formatNum( $limit );
$prev = wfMsgExt( 'whatlinkshere-prev', array( 'parsemag', 'escape' ), $fmtLimit );
$next = wfMsgExt( 'whatlinkshere-next', array( 'parsemag', 'escape' ), $fmtLimit );
+ $nsText = '';
+ if( is_int($this->namespace) ) {
+ $nsText = "&namespace={$this->namespace}";
+ }
+
if ( 0 != $prevId ) {
- $prevLink = $this->makeSelfLink( $prev, "limit={$limit}&from={$this->back}&namespace={$namespace}" );
+ $prevLink = $this->makeSelfLink( $prev, "limit={$limit}&from={$this->back}{$nsText}" );
} else {
$prevLink = $prev;
}
if ( 0 != $nextId ) {
- $nextLink = $this->makeSelfLink( $next, "limit={$limit}&from={$nextId}&back={$prevId}&namespace={$namespace}" );
+ $nextLink = $this->makeSelfLink( $next, "limit={$limit}&from={$nextId}&back={$prevId}{$nsText}" );
} else {
$nextLink = $next;
}
return wfMsg( 'viewprevnext', $prevLink, $nextLink, $nums );
}
- function numLink( $limit, $from ) {
+ function numLink( $limit, $from, $ns = null ) {
global $wgLang;
$query = "limit={$limit}&from={$from}";
+ if( is_int($this->namespace) ) { $query .= "&namespace={$this->namespace}";}
$fmtLimit = $wgLang->formatNum( $limit );
return $this->makeSelfLink( $fmtLimit, $query );
}
return $f;
}
- function setNamespace( $ns ) {
+ /** Set the namespace we are filtering on */
+ private function setNamespace( $ns ) {
$this->namespace = $ns;
}