}
if ( "" == $ret ) {
- user_error( "Couldn't find text for message \"{$key}\"." );
+ # Let's at least _try_ to be graceful about this.
+ return "<$key>";
}
return $ret;
}
{
global $wgUser, $wgOut, $wgTitle, $wgLang;
+ /* FIXME: this list probably shouldn't be language-specific, per se */
$validSP = $wgLang->getValidSpecialPages();
$sysopSP = $wgLang->getSysopSpecialPages();
$devSP = $wgLang->getDeveloperSpecialPages();
$wgOut->setArticleFlag( false );
$wgOut->setRobotpolicy( "noindex,follow" );
- $t = $wgTitle->getDBkey();
+ $par = NULL;
+ list($t, $par) = split( "/", $wgTitle->getDBkey(), 2 );
+
if ( array_key_exists( $t, $validSP ) ||
( $wgUser->isSysop() && array_key_exists( $t, $sysopSP ) ) ||
( $wgUser->isDeveloper() && array_key_exists( $t, $devSP ) ) ) {
+ if($par !== NULL)
+ $wgTitle = Title::makeTitle( Namespace::getSpecial(), $t );
+
$wgOut->setPageTitle( wfMsg( strtolower( $wgTitle->getText() ) ) );
$inc = "Special" . $t . ".php";
include_once( $inc );
$call = "wfSpecial" . $t;
- $call();
+ $call( $par );
} else if ( array_key_exists( $t, $sysopSP ) ) {
$wgOut->sysopRequired();
} else if ( array_key_exists( $t, $devSP ) ) {
{
global $wgDocType, $wgDTD, $wgUser, $wgLanguageCode, $wgOutputEncoding;
- $ret = "<!DOCTYPE HTML PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
+ $ret = "<!DOCTYPE HTML PUBLIC \"$wgDocType\"\n \"$wgDTD\">\n";
if ( "" == $this->mHTMLtitle ) {
$this->mHTMLtitle = $this->mPagetitle;
<?
-function wfSpecialAllpages()
+function wfSpecialAllpages( $par=NULL )
{
global $from, $indexMaxperpage;
$indexMaxperpage = 480;
- if( isset( $from ) ) {
+ if( $par ) {
+ indexShowChunk( $par );
+ } elseif( isset( $from ) ) {
indexShowChunk( $from );
} else {
indexShowToplevel();
<?
-function wfSpecialContributions()
+function wfSpecialContributions( $par = "" )
{
global $wgUser, $wgOut, $wgLang, $target, $hideminor;
$fname = "wfSpecialContributions";
$sysop = $wgUser->isSysop();
+ if( $par )
+ $target = $par;
+ else
+ $target = wfCleanQueryVar( $target );
+
if ( "" == $target ) {
$wgOut->errorpage( "notargettitle", "notargettext" );
return;
}
list( $limit, $offset ) = wfCheckLimits( 50, "" );
- $target = wfCleanQueryVar( $target );
$nt = Title::newFromURL( $target );
$nt->setNamespace( Namespace::getUser() );
<?
function sns()
- {
+{
global $wgLang ;
$ns = $wgLang->getNamespaces() ;
return $ns[-1] ;
- }
+}
-function wfSpecialMaintenance ()
- {
+function wfSpecialMaintenance( $par=NULL )
+{
global $wgUser, $wgOut, $wgLang, $wgTitle, $subfunction, $wgLanguageCode, $submitmll;
global $wgMiserMode;
if ( $wgMiserMode ) {
$wgOut->addWikiText( wfMsg( "perfdisabled" ) );
return;
}
+
+ if( $par )
+ $subfunction = $par;
+ else
+ $subfunction = $_REQUEST['subfunction'];
if ( $subfunction == "disambiguations" ) return wfSpecialDisambiguations() ;
if ( $subfunction == "doubleredirects" ) return wfSpecialDoubleRedirects() ;
$r .= "</UL>\n" ;
$wgOut->addHTML ( $r ) ;
- }
+}
function getMPL ( $x )
- {
+{
global $wgUser , $wgLang;
$sk = $wgUser->getSkin() ;
return $sk->makeKnownLink(sns().":Maintenance",wfMsg($x),"subfunction={$x}") ;
- }
+}
function getMaintenancePageBacklink()
- {
+{
global $wgUser , $wgLang , $subfunction ;
$sk = $wgUser->getSkin() ;
$ns = $wgLang->getNamespaces() ;
$s .= "<h2>{$t}</h2></td><td align=right>";
$s .= "{$r}</td></tr></table>\n" ;
return $s ;
- }
+}
function wfSpecialDisambiguations()
<?
-function wfSpecialRecentchanges()
+function wfSpecialRecentchanges( $par )
{
global $wgUser, $wgOut, $wgLang, $wgTitle;
global $days, $hideminor, $from, $hidebots; # From query string
$fname = "wfSpecialRecentchanges";
+ if( $par ) {
+ $bits = preg_split( '/\s*,\s*/', trim( $par ) );
+ if( in_array( "hidebots", $bits ) ) $hidebots = 1;
+ if( in_array( "bots", $bits ) ) $hidebots = 0;
+ if( in_array( "hideminor", $bits ) ) $hideminor = 1;
+ if( in_array( "minor", $bits ) ) $hideminor = 0;
+ }
+
$sql = "SELECT MAX(rc_timestamp) AS lastmod FROM recentchanges";
$res = wfQuery( $sql, $fname );
$s = wfFetchObject( $res );
global $IP;
include_once( "$IP/SpecialRecentchanges.php" );
-function wfSpecialRecentchangeslinked()
+function wfSpecialRecentchangeslinked( $par = NULL )
{
global $wgUser, $wgOut, $wgLang, $wgTitle;
global $days, $target, $hideminor; # From query string
$wgOut->setPagetitle( wfMsg( "recentchanges" ) );
$sk = $wgUser->getSkin();
+ if( $par ) {
+ $target = $par;
+ }
if ( "" == $target ) {
$wgOut->errorpage( "notargettitle", "notargettext" );
return;
<?
-function wfSpecialWhatlinkshere()
+function wfSpecialWhatlinkshere($par = NULL)
{
global $wgUser, $wgOut, $target;
$fname = "wfSpecialWhatlinkshere";
+ if($par) {
+ $target = $par;
+ } else {
+ $target = wfCleanQueryVar( $_REQUEST['target'] );
+ }
if ( "" == $target ) {
$wgOut->errorpage( "notargettitle", "notargettext" );
return;
}
- $nt = Title::newFromURL( wfCleanQueryVar( $target ) );
+ $nt = Title::newFromURL( $target );
$wgOut->setPagetitle( $nt->getPrefixedText() );
$wgOut->setSubtitle( wfMsg( "linklistsub" ) );
if ( "" == $n ) { return $title; }
else { return "{$n}:{$title}"; }
}
+
+ /* static */ function makeTitle( $ns, $title )
+ {
+ $t = new Title();
+ $t->mDbkeyform = Title::makeName( $ns, $title );
+ $t->secureAndSplit();
+ return $t;
+ }
function getPrefixedDBkey()
{