* shortcut to get the current language "special" namespace name
*/
function sns() {
- global $wgContLang ;
- $ns = $wgContLang->getNamespaces() ;
- return $ns[NS_SPECIAL] ;
+ global $wgContLang;
+ return $wgContLang->getNsText(NS_SPECIAL);
}
* Entry point
*/
function wfSpecialMaintenance( $par=NULL ) {
- global $wgUser, $wgOut, $wgContLang, $wgTitle, $wgRequest, $wgContLanguageCode;
+ global $wgUser, $wgOut, $wgContLang, $wgRequest, $wgContLanguageCode;
global $wgMiserMode;
# This pages is expensive ressource wise
$wgOut->addWikiText( wfMsg( 'perfdisabled' ) );
return;
}
-
+
# Get parameters from the URL
$submitmll = $wgRequest->getVal( 'submitmll' );
# Call the subfunction requested by the user
switch( $subfunction ) {
- case 'disambiguations': return wfSpecialDisambiguations() ; break;
-
+ case 'disambiguations': return wfSpecialDisambiguations();
+
# doubleredirects & brokenredirects are old maintenance subpages.
- case 'doubleredirects': return wfSpecialDoubleRedirects() ; break;
- case 'brokenredirects': return wfSpecialBrokenRedirects() ; break;
-
- case 'selflinks': return wfSpecialSelfLinks() ; break;
- case 'mispeelings': return wfSpecialMispeelings() ; break;
- case 'missinglanguagelinks': return wfSpecialMissingLanguageLinks() ; break;
+ case 'doubleredirects': return wfSpecialDoubleRedirects();
+ case 'brokenredirects': return wfSpecialBrokenRedirects();
+
+ case 'selflinks': return wfSpecialSelfLinks() ;
+ case 'mispeelings': return wfSpecialMispeelings() ;
+ case 'missinglanguagelinks': return wfSpecialMissingLanguageLinks();
}
-
+
if ( !is_null( $submitmll ) ) return wfSpecialMissingLanguageLinks() ;
$sk = $wgUser->getSkin();
- $ns = $wgContLang->getNamespaces() ;
# Generate page output
-
+
$r = wfMsg('maintnancepagetext') ;
-
+
# Links to subfunctions
$r .= "<ul>\n" ;
$r .= "<li>".$sk->makeKnownLink( sns().':Disambiguations', wfMsg('disambiguations')) . "</li>\n";
$r .= htmlspecialchars(wfMsg('missinglanguagelinksbutton'), ENT_QUOTES);
$r .= "\" />\n" ;
$r .= "<select name=\"thelang\">\n" ;
-
+
$a = $wgContLang->getLanguageNames();
$ak = array_keys ( $a ) ;
foreach ( $ak AS $k ) {
* Generate a maintenance page link
*/
function getMPL ( $x ) {
- global $wgUser , $wgLang;
+ global $wgUser;
$sk = $wgUser->getSkin() ;
return $sk->makeKnownLink( sns().":Maintenance" , wfMsg($x), 'subfunction='.$x ) ;
}
$wgContLang->getNsText( NS_SPECIAL ) . ':Maintenance',
wfMsg( 'maintenancebacklink' ) ) ;
$t = wfMsg ( $subfunction ) ;
-
+
$s = '<table width="100%" border="0"><tr><td>';
$s .= '<h2>'.$t.'</h2></td><td align="right">';
$s .= "{$r}</td></tr></table>\n" ;
* @deprecated
*/
function wfSpecialSelfLinks() {
- global $wgUser, $wgOut, $wgLang, $wgTitle;
+ global $wgUser, $wgOut;
$fname = 'wfSpecialSelfLinks';
list( $limit, $offset ) = wfCheckLimits();
- $sql = "SELECT page_namespace,page_title FROM page,links " .
- "WHERE l_from=l_to AND l_to=page_id " .
+ $sql = "SELECT page_namespace,page_title FROM page,links " .
+ "WHERE l_from=l_to AND l_to=page_id " .
"LIMIT {$offset}, {$limit}";
$res = wfQuery( $sql, DB_SLAVE, $fname );
}
/**
- *
+ *
*/
function wfSpecialMispeelings () {
- global $wgUser, $wgOut, $wgContLang, $wgTitle;
+ global $wgUser, $wgOut, $wgContLang;
$sk = $wgUser->getSkin();
$fname = 'wfSpecialMispeelings';
*
*/
function wfSpecialMissingLanguageLinks() {
- global $wgUser, $wgOut, $wgContLang, $wgTitle, $wgRequest;
-
+ global $wgUser, $wgOut, $wgContLang, $wgRequest;
+
$fname = 'wfSpecialMissingLanguageLinks';
$thelang = $wgRequest->getText( 'thelang' );
if ( $thelang == 'w' ) $thelang = 'en' ; # Fix for international wikis