MediaWiki  master
MWNamespace.php
Go to the documentation of this file.
1 <?php
23 
27 class MWNamespace {
36  public static function isMovable( $index ) {
37  wfDeprecated( __METHOD__, '1.34' );
38  return MediaWikiServices::getInstance()->getNamespaceInfo()->isMovable( $index );
39  }
40 
50  public static function isSubject( $index ) {
51  wfDeprecated( __METHOD__, '1.34' );
52  return MediaWikiServices::getInstance()->getNamespaceInfo()->isSubject( $index );
53  }
54 
63  public static function isTalk( $index ) {
64  wfDeprecated( __METHOD__, '1.34' );
65  return MediaWikiServices::getInstance()->getNamespaceInfo()->isTalk( $index );
66  }
67 
76  public static function getTalk( $index ) {
77  wfDeprecated( __METHOD__, '1.34' );
78  return MediaWikiServices::getInstance()->getNamespaceInfo()->getTalk( $index );
79  }
80 
90  public static function getSubject( $index ) {
91  wfDeprecated( __METHOD__, '1.34' );
92  return MediaWikiServices::getInstance()->getNamespaceInfo()->getSubject( $index );
93  }
94 
105  public static function getAssociated( $index ) {
106  wfDeprecated( __METHOD__, '1.34' );
107  return MediaWikiServices::getInstance()->getNamespaceInfo()->getAssociated( $index );
108  }
109 
119  public static function exists( $index ) {
120  wfDeprecated( __METHOD__, '1.34' );
121  return MediaWikiServices::getInstance()->getNamespaceInfo()->exists( $index );
122  }
123 
139  public static function equals( $ns1, $ns2 ) {
140  wfDeprecated( __METHOD__, '1.34' );
141  return MediaWikiServices::getInstance()->getNamespaceInfo()->equals( $ns1, $ns2 );
142  }
143 
158  public static function subjectEquals( $ns1, $ns2 ) {
159  wfDeprecated( __METHOD__, '1.34' );
160  return MediaWikiServices::getInstance()->getNamespaceInfo()->
161  subjectEquals( $ns1, $ns2 );
162  }
163 
172  public static function getCanonicalNamespaces() {
173  wfDeprecated( __METHOD__, '1.34' );
174  return MediaWikiServices::getInstance()->getNamespaceInfo()->getCanonicalNamespaces();
175  }
176 
185  public static function getCanonicalName( $index ) {
186  wfDeprecated( __METHOD__, '1.34' );
187  return MediaWikiServices::getInstance()->getNamespaceInfo()->getCanonicalName( $index );
188  }
189 
199  public static function getCanonicalIndex( $name ) {
200  wfDeprecated( __METHOD__, '1.34' );
201  return MediaWikiServices::getInstance()->getNamespaceInfo()->getCanonicalIndex( $name );
202  }
203 
212  public static function getValidNamespaces() {
213  wfDeprecated( __METHOD__, '1.34' );
214  return MediaWikiServices::getInstance()->getNamespaceInfo()->getValidNamespaces();
215  }
216 
226  public static function hasTalkNamespace( $index ) {
227  wfDeprecated( __METHOD__, '1.34' );
228  return MediaWikiServices::getInstance()->getNamespaceInfo()->hasTalkNamespace( $index );
229  }
230 
240  public static function isContent( $index ) {
241  wfDeprecated( __METHOD__, '1.34' );
242  return MediaWikiServices::getInstance()->getNamespaceInfo()->isContent( $index );
243  }
244 
254  public static function wantSignatures( $index ) {
255  wfDeprecated( __METHOD__, '1.34' );
256  return MediaWikiServices::getInstance()->getNamespaceInfo()->wantSignatures( $index );
257  }
258 
267  public static function isWatchable( $index ) {
268  wfDeprecated( __METHOD__, '1.34' );
269  return MediaWikiServices::getInstance()->getNamespaceInfo()->isWatchable( $index );
270  }
271 
280  public static function hasSubpages( $index ) {
281  wfDeprecated( __METHOD__, '1.34' );
282  return MediaWikiServices::getInstance()->getNamespaceInfo()->hasSubpages( $index );
283  }
284 
292  public static function getContentNamespaces() {
293  wfDeprecated( __METHOD__, '1.34' );
294  return MediaWikiServices::getInstance()->getNamespaceInfo()->getContentNamespaces();
295  }
296 
305  public static function getSubjectNamespaces() {
306  wfDeprecated( __METHOD__, '1.34' );
307  return MediaWikiServices::getInstance()->getNamespaceInfo()->getSubjectNamespaces();
308  }
309 
318  public static function getTalkNamespaces() {
319  wfDeprecated( __METHOD__, '1.34' );
320  return MediaWikiServices::getInstance()->getNamespaceInfo()->getTalkNamespaces();
321  }
322 
331  public static function isCapitalized( $index ) {
332  wfDeprecated( __METHOD__, '1.34' );
333  return MediaWikiServices::getInstance()->getNamespaceInfo()->isCapitalized( $index );
334  }
335 
345  public static function hasGenderDistinction( $index ) {
346  wfDeprecated( __METHOD__, '1.34' );
347  return MediaWikiServices::getInstance()->getNamespaceInfo()->
348  hasGenderDistinction( $index );
349  }
350 
359  public static function isNonincludable( $index ) {
360  wfDeprecated( __METHOD__, '1.34' );
361  return MediaWikiServices::getInstance()->getNamespaceInfo()->isNonincludable( $index );
362  }
363 
376  public static function getNamespaceContentModel( $index ) {
377  wfDeprecated( __METHOD__, '1.34' );
378  return MediaWikiServices::getInstance()->getNamespaceInfo()->
379  getNamespaceContentModel( $index );
380  }
381 
392  public static function getRestrictionLevels( $index, User $user = null ) {
393  wfDeprecated( __METHOD__, '1.34' );
394  return MediaWikiServices::getInstance()
395  ->getPermissionManager()
396  ->getNamespaceRestrictionLevels( $index, $user );
397  }
398 
410  public static function getCategoryLinkType( $index ) {
411  wfDeprecated( __METHOD__, '1.34' );
412  return MediaWikiServices::getInstance()->getNamespaceInfo()->
413  getCategoryLinkType( $index );
414  }
415 }
MWNamespace\subjectEquals
static subjectEquals( $ns1, $ns2)
Returns whether the specified namespaces share the same subject.
Definition: MWNamespace.php:158
MWNamespace\isNonincludable
static isNonincludable( $index)
It is not possible to use pages from this namespace as template?
Definition: MWNamespace.php:359
MWNamespace\getCanonicalNamespaces
static getCanonicalNamespaces()
Returns array of all defined namespaces with their canonical (English) names.
Definition: MWNamespace.php:172
MWNamespace\getValidNamespaces
static getValidNamespaces()
Returns an array of the namespaces (by integer id) that exist on the wiki.
Definition: MWNamespace.php:212
MWNamespace\hasGenderDistinction
static hasGenderDistinction( $index)
Does the namespace (potentially) have different aliases for different genders.
Definition: MWNamespace.php:345
MWNamespace\isTalk
static isTalk( $index)
Is the given namespace a talk namespace?
Definition: MWNamespace.php:63
MWNamespace\getTalkNamespaces
static getTalkNamespaces()
List all namespace indices which are considered talks, aka not a subject or special namespace.
Definition: MWNamespace.php:318
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:204
MWNamespace\getNamespaceContentModel
static getNamespaceContentModel( $index)
Get the default content model for a namespace This does not mean that all pages in that namespace hav...
Definition: MWNamespace.php:376
MWNamespace\getSubjectNamespaces
static getSubjectNamespaces()
List all namespace indices which are considered subject, aka not a talk or special namespace.
Definition: MWNamespace.php:305
MWNamespace\getContentNamespaces
static getContentNamespaces()
Get a list of all namespace indices which are considered to contain content.
Definition: MWNamespace.php:292
MWNamespace\getCanonicalIndex
static getCanonicalIndex( $name)
Returns the index for a given canonical name, or NULL The input must be converted to lower case first...
Definition: MWNamespace.php:199
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Definition: GlobalFunctions.php:997
MWNamespace\isContent
static isContent( $index)
Does this namespace contain content, for the purposes of calculating statistics, etc?
Definition: MWNamespace.php:240
MWNamespace\hasTalkNamespace
static hasTalkNamespace( $index)
Does this namespace ever have a talk namespace?
Definition: MWNamespace.php:226
MWNamespace\hasSubpages
static hasSubpages( $index)
Does the namespace allow subpages?
Definition: MWNamespace.php:280
MWNamespace
Definition: MWNamespace.php:27
MWNamespace\getRestrictionLevels
static getRestrictionLevels( $index, User $user=null)
Determine which restriction levels it makes sense to use in a namespace, optionally filtered by a use...
Definition: MWNamespace.php:392
MWNamespace\isSubject
static isSubject( $index)
Is the given namespace is a subject (non-talk) namespace?
Definition: MWNamespace.php:50
MWNamespace\wantSignatures
static wantSignatures( $index)
Might pages in this namespace require the use of the Signature button on the edit toolbar?
Definition: MWNamespace.php:254
MWNamespace\isMovable
static isMovable( $index)
Can pages in the given namespace be moved?
Definition: MWNamespace.php:36
MWNamespace\exists
static exists( $index)
Returns whether the specified namespace exists.
Definition: MWNamespace.php:119
MWNamespace\equals
static equals( $ns1, $ns2)
Returns whether the specified namespaces are the same namespace.
Definition: MWNamespace.php:139
MWNamespace\getCategoryLinkType
static getCategoryLinkType( $index)
Returns the link type to be used for categories.
Definition: MWNamespace.php:410
MWNamespace\isCapitalized
static isCapitalized( $index)
Is the namespace first-letter capitalized?
Definition: MWNamespace.php:331
MWNamespace\isWatchable
static isWatchable( $index)
Can pages in a namespace be watched?
Definition: MWNamespace.php:267
MWNamespace\getTalk
static getTalk( $index)
Get the talk namespace index for a given namespace.
Definition: MWNamespace.php:76
MWNamespace\getSubject
static getSubject( $index)
Get the subject namespace index for a given namespace Special namespaces (NS_MEDIA,...
Definition: MWNamespace.php:90
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:67
MWNamespace\getAssociated
static getAssociated( $index)
Get the associated namespace.
Definition: MWNamespace.php:105
MWNamespace\getCanonicalName
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.
Definition: MWNamespace.php:185