CoreParserFunctions Class Reference
[Parser]

Various core parser functions, registered in Parser::firstCallInit(). More...

List of all members.

Static Public Member Functions

static register ($parser)
static intFunction ($parser, $part1= '')
static formatDate ($parser, $date, $defaultPref=null)
static ns ($parser, $part1= '')
static nse ($parser, $part1= '')
static urlencode ($parser, $s= '')
static lcfirst ($parser, $s= '')
static ucfirst ($parser, $s= '')
static lc ($parser, $s= '')
static uc ($parser, $s= '')
static localurl ($parser, $s= '', $arg=null)
static localurle ($parser, $s= '', $arg=null)
static fullurl ($parser, $s= '', $arg=null)
static fullurle ($parser, $s= '', $arg=null)
static urlFunction ($func, $s= '', $arg=null)
static formatNum ($parser, $num= '', $raw=null)
static grammar ($parser, $case= '', $word= '')
static gender ($parser, $user)
static plural ($parser, $text= '')
static displaytitle ($parser, $text= '')
 Override the title of the page when viewed, provided we've been given a title which will normalise to the canonical title.
static isRaw ($param)
static formatRaw ($num, $raw)
static numberofpages ($parser, $raw=null)
static numberofusers ($parser, $raw=null)
static numberofactiveusers ($parser, $raw=null)
static numberofarticles ($parser, $raw=null)
static numberoffiles ($parser, $raw=null)
static numberofadmins ($parser, $raw=null)
static numberofedits ($parser, $raw=null)
static numberofviews ($parser, $raw=null)
static pagesinnamespace ($parser, $namespace=0, $raw=null)
static numberingroup ($parser, $name= '', $raw=null)
static mwnamespace ($parser, $title=null)
 Given a title, return the namespace name that would be given by the corresponding magic word Note: function name changed to "mwnamespace" rather than "namespace" to not break PHP 5.3.
static namespacee ($parser, $title=null)
static talkspace ($parser, $title=null)
static talkspacee ($parser, $title=null)
static subjectspace ($parser, $title=null)
static subjectspacee ($parser, $title=null)
static pagename ($parser, $title=null)
static pagenamee ($parser, $title=null)
static fullpagename ($parser, $title=null)
static fullpagenamee ($parser, $title=null)
static subpagename ($parser, $title=null)
static subpagenamee ($parser, $title=null)
static basepagename ($parser, $title=null)
static basepagenamee ($parser, $title=null)
static talkpagename ($parser, $title=null)
static talkpagenamee ($parser, $title=null)
static subjectpagename ($parser, $title=null)
static subjectpagenamee ($parser, $title=null)
static pagesincategory ($parser, $name= '', $raw=null)
 Return the number of pages in the given category, or 0 if it's nonexis- tent.
static pagesize ($parser, $page= '', $raw=null)
 Return the size of the given page, or 0 if it's nonexistent.
static protectionlevel ($parser, $type= '')
 Returns the requested protection level for the current page.
static language ($parser, $arg= '')
static pad ($string, $length, $padding= '0', $direction=STR_PAD_RIGHT)
 Unicode-safe str_pad with the restriction that $length is forced to be <= 500.
static padleft ($parser, $string= '', $length=0, $padding= '0')
static padright ($parser, $string= '', $length=0, $padding= '0')
static anchorencode ($parser, $text)
static special ($parser, $text)
static defaultsort ($parser, $text)
static filepath ($parser, $name='', $option='')
static tagObj ($parser, $frame, $args)
 Parser function to extension tag adaptor.


Detailed Description

Various core parser functions, registered in Parser::firstCallInit().

Definition at line 7 of file CoreParserFunctions.php.


Member Function Documentation

static CoreParserFunctions::anchorencode ( parser,
text 
) [static]

Definition at line 555 of file CoreParserFunctions.php.

References urlencode().

static CoreParserFunctions::basepagename ( parser,
title = null 
) [static]

Definition at line 405 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::basepagenamee ( parser,
title = null 
) [static]

Definition at line 411 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::defaultsort ( parser,
text 
) [static]

Definition at line 572 of file CoreParserFunctions.php.

References wfMsg().

static CoreParserFunctions::displaytitle ( parser,
text = '' 
) [static]

Override the title of the page when viewed, provided we've been given a title which will normalise to the canonical title.

Parameters:
$parser Parser: parent parser
$text String: desired title text
Returns:
String

Definition at line 239 of file CoreParserFunctions.php.

References $title, $wgRestrictDisplayTitle, Parser::MARKER_SUFFIX, Title::newFromText(), Sanitizer::normalizeCharReferences(), Sanitizer::removeHTMLtags(), and Sanitizer::stripAllTags().

static CoreParserFunctions::filepath ( parser,
name = '',
option = '' 
) [static]

Definition at line 588 of file CoreParserFunctions.php.

References $name, $url, and wfFindFile().

static CoreParserFunctions::formatDate ( parser,
date,
defaultPref = null 
) [static]

Definition at line 93 of file CoreParserFunctions.php.

References DateFormatter::getInstance().

static CoreParserFunctions::formatNum ( parser,
num = '',
raw = null 
) [static]

Definition at line 188 of file CoreParserFunctions.php.

static CoreParserFunctions::formatRaw ( num,
raw 
) [static]

static CoreParserFunctions::fullpagename ( parser,
title = null 
) [static]

Definition at line 381 of file CoreParserFunctions.php.

References $t, $title, Title::newFromText(), and wfEscapeWikiText().

static CoreParserFunctions::fullpagenamee ( parser,
title = null 
) [static]

Definition at line 387 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::fullurl ( parser,
s = '',
arg = null 
) [static]

Definition at line 161 of file CoreParserFunctions.php.

References $s, and urlFunction().

static CoreParserFunctions::fullurle ( parser,
s = '',
arg = null 
) [static]

Definition at line 162 of file CoreParserFunctions.php.

References $s, and urlFunction().

static CoreParserFunctions::gender ( parser,
user 
) [static]

static CoreParserFunctions::grammar ( parser,
case = '',
word = '' 
) [static]

Definition at line 196 of file CoreParserFunctions.php.

static CoreParserFunctions::intFunction ( parser,
part1 = '' 
) [static]

Definition at line 81 of file CoreParserFunctions.php.

References wfMsgGetKey(), and wfMsgReplaceArgs().

static CoreParserFunctions::isRaw ( param  )  [static]

Definition at line 271 of file CoreParserFunctions.php.

References MagicWord::get().

static CoreParserFunctions::language ( parser,
arg = '' 
) [static]

Definition at line 515 of file CoreParserFunctions.php.

References $wgContLang.

static CoreParserFunctions::lc ( parser,
s = '' 
) [static]

Definition at line 141 of file CoreParserFunctions.php.

References $s, and $wgContLang.

static CoreParserFunctions::lcfirst ( parser,
s = '' 
) [static]

Definition at line 131 of file CoreParserFunctions.php.

References $s, and $wgContLang.

static CoreParserFunctions::localurl ( parser,
s = '',
arg = null 
) [static]

Definition at line 159 of file CoreParserFunctions.php.

References $s, and urlFunction().

static CoreParserFunctions::localurle ( parser,
s = '',
arg = null 
) [static]

Definition at line 160 of file CoreParserFunctions.php.

References $s, and urlFunction().

static CoreParserFunctions::mwnamespace ( parser,
title = null 
) [static]

Given a title, return the namespace name that would be given by the corresponding magic word Note: function name changed to "mwnamespace" rather than "namespace" to not break PHP 5.3.

Definition at line 329 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::namespacee ( parser,
title = null 
) [static]

Definition at line 335 of file CoreParserFunctions.php.

References $t, $title, Title::newFromText(), and wfUrlencode().

static CoreParserFunctions::ns ( parser,
part1 = '' 
) [static]

Definition at line 109 of file CoreParserFunctions.php.

References $wgContLang.

static CoreParserFunctions::nse ( parser,
part1 = '' 
) [static]

Definition at line 123 of file CoreParserFunctions.php.

References wfUrlencode().

static CoreParserFunctions::numberingroup ( parser,
name = '',
raw = null 
) [static]

Definition at line 318 of file CoreParserFunctions.php.

References $name, formatRaw(), and SiteStats::numberingroup().

static CoreParserFunctions::numberofactiveusers ( parser,
raw = null 
) [static]

Definition at line 297 of file CoreParserFunctions.php.

References SiteStats::activeUsers(), and formatRaw().

static CoreParserFunctions::numberofadmins ( parser,
raw = null 
) [static]

Definition at line 306 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats::numberingroup().

static CoreParserFunctions::numberofarticles ( parser,
raw = null 
) [static]

Definition at line 300 of file CoreParserFunctions.php.

References SiteStats::articles(), and formatRaw().

static CoreParserFunctions::numberofedits ( parser,
raw = null 
) [static]

Definition at line 309 of file CoreParserFunctions.php.

References SiteStats::edits(), and formatRaw().

static CoreParserFunctions::numberoffiles ( parser,
raw = null 
) [static]

Definition at line 303 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats::images().

static CoreParserFunctions::numberofpages ( parser,
raw = null 
) [static]

Definition at line 291 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats::pages().

static CoreParserFunctions::numberofusers ( parser,
raw = null 
) [static]

Definition at line 294 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats::users().

static CoreParserFunctions::numberofviews ( parser,
raw = null 
) [static]

Definition at line 312 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats::views().

static CoreParserFunctions::pad ( string,
length,
padding = '0',
direction = STR_PAD_RIGHT 
) [static]

Unicode-safe str_pad with the restriction that $length is forced to be <= 500.

Definition at line 524 of file CoreParserFunctions.php.

Referenced by padleft(), and padright().

static CoreParserFunctions::padleft ( parser,
string = '',
length = 0,
padding = '0' 
) [static]

Definition at line 547 of file CoreParserFunctions.php.

References pad().

static CoreParserFunctions::padright ( parser,
string = '',
length = 0,
padding = '0' 
) [static]

Definition at line 551 of file CoreParserFunctions.php.

References pad().

static CoreParserFunctions::pagename ( parser,
title = null 
) [static]

Definition at line 369 of file CoreParserFunctions.php.

References $t, $title, Title::newFromText(), and wfEscapeWikiText().

static CoreParserFunctions::pagenamee ( parser,
title = null 
) [static]

Definition at line 375 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::pagesincategory ( parser,
name = '',
raw = null 
) [static]

Return the number of pages in the given category, or 0 if it's nonexis- tent.

This is an expensive parser function and can't be called too many times per page.

Definition at line 447 of file CoreParserFunctions.php.

References $name, formatRaw(), and Category::newFromName().

static CoreParserFunctions::pagesinnamespace ( parser,
namespace = 0,
raw = null 
) [static]

Definition at line 315 of file CoreParserFunctions.php.

References formatRaw(), and SiteStats::pagesInNs().

static CoreParserFunctions::pagesize ( parser,
page = '',
raw = null 
) [static]

Return the size of the given page, or 0 if it's nonexistent.

This is an expensive parser function and can't be called too many times per page.

Todo:
Fixme: This doesn't work correctly on preview for getting the size of the current page.

Fixme: Title::getLength() documentation claims that it adds things to the link cache, so the local cache here should be unnecessary, but in fact calling getLength() repeatedly for the same $page does seem to run one query for each call?

Definition at line 479 of file CoreParserFunctions.php.

References $page, $title, formatRaw(), Title::newFromText(), and Revision::newFromTitle().

static CoreParserFunctions::plural ( parser,
text = '' 
) [static]

Definition at line 225 of file CoreParserFunctions.php.

static CoreParserFunctions::protectionlevel ( parser,
type = '' 
) [static]

Returns the requested protection level for the current page.

Definition at line 508 of file CoreParserFunctions.php.

static CoreParserFunctions::register ( parser  )  [static]

static CoreParserFunctions::special ( parser,
text 
) [static]

static CoreParserFunctions::subjectpagename ( parser,
title = null 
) [static]

Definition at line 429 of file CoreParserFunctions.php.

References $t, $title, Title::newFromText(), and wfEscapeWikiText().

static CoreParserFunctions::subjectpagenamee ( parser,
title = null 
) [static]

Definition at line 435 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::subjectspace ( parser,
title = null 
) [static]

Definition at line 353 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::subjectspacee ( parser,
title = null 
) [static]

Definition at line 359 of file CoreParserFunctions.php.

References $t, $title, Title::newFromText(), and wfUrlencode().

static CoreParserFunctions::subpagename ( parser,
title = null 
) [static]

Definition at line 393 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::subpagenamee ( parser,
title = null 
) [static]

Definition at line 399 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::tagObj ( parser,
frame,
args 
) [static]

Parser function to extension tag adaptor.

Definition at line 604 of file CoreParserFunctions.php.

References $name, PPFrame::STRIP_COMMENTS, and wfMsg().

static CoreParserFunctions::talkpagename ( parser,
title = null 
) [static]

Definition at line 417 of file CoreParserFunctions.php.

References $t, $title, Title::newFromText(), and wfEscapeWikiText().

static CoreParserFunctions::talkpagenamee ( parser,
title = null 
) [static]

Definition at line 423 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::talkspace ( parser,
title = null 
) [static]

Definition at line 341 of file CoreParserFunctions.php.

References $t, $title, and Title::newFromText().

static CoreParserFunctions::talkspacee ( parser,
title = null 
) [static]

Definition at line 347 of file CoreParserFunctions.php.

References $t, $title, Title::newFromText(), and wfUrlencode().

static CoreParserFunctions::uc ( parser,
s = '' 
) [static]

Definition at line 150 of file CoreParserFunctions.php.

References $s, and $wgContLang.

static CoreParserFunctions::ucfirst ( parser,
s = '' 
) [static]

Definition at line 136 of file CoreParserFunctions.php.

References $s, and $wgContLang.

static CoreParserFunctions::urlencode ( parser,
s = '' 
) [static]

Definition at line 127 of file CoreParserFunctions.php.

References $s.

Referenced by anchorencode().

static CoreParserFunctions::urlFunction ( func,
s = '',
arg = null 
) [static]


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

Generated on Sat Apr 30 22:57:34 2011 for MediaWiki by  doxygen 1.5.9