From 9fbdd422a1762d4d3f01ce2cd0f06050fdbb43e8 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Tue, 9 Aug 2005 13:28:37 +0000 Subject: [PATCH] some of lufthansa bits ;-) allows reusal of object in other pagelists, some error handling --- includes/SpecialAllpages.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 63b67af462..3ab3a47328 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -39,6 +39,7 @@ function wfSpecialAllpages( $par=NULL, $specialPage ) { class SpecialAllpages { var $maxPerPage=960; var $topLevelMax=50; + var $name='Allpages'; /** * HTML for the top form @@ -47,7 +48,7 @@ class SpecialAllpages { */ function namespaceForm ( $namespace = NS_MAIN, $from = '' ) { global $wgContLang, $wgScript; - $t = Title::makeTitle( NS_SPECIAL, "Allpages" ); + $t = Title::makeTitle( NS_SPECIAL, $this->name ); $namespaceselect = HTMLnamespaceselector($namespace, null); @@ -192,7 +193,7 @@ function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) { $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); $queryparams = ($namespace ? "namespace=$namespace" : ''); - $special = Title::makeTitle( NS_SPECIAL, 'Allpages/' . $inpoint ); + $special = Title::makeTitle( NS_SPECIAL, $this->name . '/' . $inpoint ); $link = $special->escapeLocalUrl( $queryparams ); $out = wfMsgHtml( @@ -217,6 +218,9 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { $fromTitle = null; if ($from!="") { $fromTitle = Title::newFromURL( $from ); + if (!$fromTitle) { + return; + } $fromNS = $fromTitle->getNamespace(); if ($namespace == NS_MAIN) $namespace = $fromNS; -- 2.20.1