X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FNamespace.php;h=0883011fc0dad46f0c404dcf9a5d9097ebc9ec01;hb=23bd05bb39123fad08f06527186360ff5370ced0;hp=95c58cccdb571bedc00e8cabf40c979bcbfbbed9;hpb=b3d0f35aee6f364000d12327247d2c18162492e8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Namespace.php b/includes/Namespace.php index 95c58cccdb..0883011fc0 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -4,35 +4,6 @@ * @file */ -/** - * Definitions of the NS_ constants are in Defines.php - * @private - */ -$wgCanonicalNamespaceNames = array( - NS_MEDIA => 'Media', - NS_SPECIAL => 'Special', - NS_TALK => 'Talk', - NS_USER => 'User', - NS_USER_TALK => 'User_talk', - NS_PROJECT => 'Project', - NS_PROJECT_TALK => 'Project_talk', - NS_FILE => 'File', - NS_FILE_TALK => 'File_talk', - NS_MEDIAWIKI => 'MediaWiki', - NS_MEDIAWIKI_TALK => 'MediaWiki_talk', - NS_TEMPLATE => 'Template', - NS_TEMPLATE_TALK => 'Template_talk', - NS_HELP => 'Help', - NS_HELP_TALK => 'Help_talk', - NS_CATEGORY => 'Category', - NS_CATEGORY_TALK => 'Category_talk', -); - -/// @todo UGLY UGLY -if( is_array( $wgExtraNamespaces ) ) { - $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces; -} - /** * This is a utility class with only static functions * for dealing with namespaces that encodes all the @@ -56,10 +27,13 @@ class MWNamespace { /** * Throw an exception when trying to get the subject or talk page * for a given namespace where it does not make sense. - * Special namespaces are defined in includes/define.php and have + * Special namespaces are defined in includes/Defines.php and have * a value below 0 (ex: NS_SPECIAL = -1 , NS_MEDIA = -2) * - * @param $ns Int: namespace index + * @param $index + * @param $method + * + * @return true */ private static function isMethodValidFor( $index, $method ) { if( $index < NS_MAIN ) { @@ -153,6 +127,10 @@ class MWNamespace { /** * Returns whether the specified namespace exists + * + * @param $index + * + * @return bool */ public static function exists( $index ) { $nslist = self::getCanonicalNamespaces();