MWNamespace Class Reference

This is a utility class with only static functions for dealing with namespaces that encodes all the "magic" behaviors of them based on index. More...

Inherited by Namespace.

List of all members.

Static Public Member Functions

static isMovable ($index)
 Can pages in the given namespace be moved?
static isMain ($index)
 Is the given namespace is a subject (non-talk) namespace?
static isTalk ($index)
 Is the given namespace a talk namespace?
static getTalk ($index)
 Get the talk namespace index for a given namespace.
static getSubject ($index)
 Get the subject namespace index for a given namespace.
static getCanonicalName ($index)
 Returns the canonical (English Wikipedia) name for a given index.
static getCanonicalIndex ($name)
 Returns the index for a given canonical name, or NULL The input *must* be converted to lower case first.
static canTalk ($index)
 Can this namespace ever have a talk namespace?
static isContent ($index)
 Does this namespace contain content, for the purposes of calculating statistics, etc?
static isWatchable ($index)
 Can pages in a namespace be watched?
static hasSubpages ($index)
 Does the namespace allow subpages?


Detailed Description

This is a utility class with only static functions for dealing with namespaces that encodes all the "magic" behaviors of them based on index.

The textual names of the namespaces are handled by Language.php.

These are synonyms for the names given in the language file Users and translators should not change them

Definition at line 46 of file Namespace.php.


Member Function Documentation

static MWNamespace::canTalk ( index  )  [static]

Can this namespace ever have a talk namespace?

Parameters:
$index Int: namespace index
Returns:
bool

Definition at line 148 of file Namespace.php.

Referenced by Title::canTalk().

static MWNamespace::getCanonicalIndex ( name  )  [static]

Returns the index for a given canonical name, or NULL The input *must* be converted to lower case first.

Parameters:
$name String: namespace name
Returns:
int

Definition at line 126 of file Namespace.php.

References $i, $name, $text, and $wgCanonicalNamespaceNames.

Referenced by Language::getNsIndex().

static MWNamespace::getCanonicalName ( index  )  [static]

Returns the canonical (English Wikipedia) name for a given index.

Parameters:
$index Int: namespace index
Returns:
string or false if no canonical definition.

Definition at line 110 of file Namespace.php.

References $wgCanonicalNamespaceNames.

Referenced by ApiQuerySiteinfo::appendNamespaces(), SpecialListGroupRights::execute(), Linker::formatLinksInCommentCallback(), SpecialStatistics::getGroupStats(), and Title::moveSubpages().

static MWNamespace::getSubject ( index  )  [static]

Get the subject namespace index for a given namespace.

Parameters:
$index Int: Namespace index
Returns:
int

Definition at line 98 of file Namespace.php.

References isTalk().

Referenced by WatchedItem::addWatch(), Title::getSubjectNsText(), Title::getSubjectPage(), ApiQueryInfo::getTSIDs(), SpecialSearch::namespaceTables(), SpecialSearchOld::powerSearchBox(), WatchedItem::removeWatch(), and SkinTemplate::tabAction().

static MWNamespace::getTalk ( index  )  [static]

Get the talk namespace index for a given namespace.

Parameters:
$index Int: namespace index
Returns:
int

Definition at line 86 of file Namespace.php.

References isTalk().

Referenced by WatchedItem::addWatch(), Title::getTalkNsText(), Title::getTalkPage(), ApiQueryInfo::getTSIDs(), and WatchedItem::removeWatch().

static MWNamespace::hasSubpages ( index  )  [static]

static MWNamespace::isContent ( index  )  [static]

Does this namespace contain content, for the purposes of calculating statistics, etc?

Parameters:
$index Int: index to check
Returns:
bool

Definition at line 159 of file Namespace.php.

References $wgContentNamespaces.

Referenced by Linker::getLinkColour(), and Title::isContentPage().

static MWNamespace::isMain ( index  )  [static]

Is the given namespace is a subject (non-talk) namespace?

Parameters:
$index Int: namespace index
Returns:
bool

Definition at line 65 of file Namespace.php.

References isTalk().

Referenced by GenerateSitemap::guessPriority().

static MWNamespace::isMovable ( index  )  [static]

Can pages in the given namespace be moved?

Parameters:
$index Int: namespace index
Returns:
bool

Definition at line 54 of file Namespace.php.

References $wgAllowImageMoving.

Referenced by Title::getUserPermissionsErrorsInternal().

static MWNamespace::isTalk ( index  )  [static]

Is the given namespace a talk namespace?

Parameters:
$index Int: namespace index
Returns:
bool

Definition at line 75 of file Namespace.php.

Referenced by getSubject(), getTalk(), ApiQueryInfo::getTSIDs(), isMain(), Title::isTalkPage(), and DumpNotalkFilter::pass().

static MWNamespace::isWatchable ( index  )  [static]

Can pages in a namespace be watched?

Parameters:
$index Int
Returns:
bool

Definition at line 170 of file Namespace.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:43 2009 for MediaWiki by  doxygen 1.5.9