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 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 529 of file CoreParserFunctions.php.

References $text, and urlencode().

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

Definition at line 379 of file CoreParserFunctions.php.

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

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

Definition at line 385 of file CoreParserFunctions.php.

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

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

Definition at line 546 of file CoreParserFunctions.php.

References $text, and 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
string $text Desired title text
Returns:
string

Definition at line 231 of file CoreParserFunctions.php.

References $text, $title, $wgRestrictDisplayTitle, Sanitizer::decodeCharReferences(), and Title::newFromText().

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

Definition at line 562 of file CoreParserFunctions.php.

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

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

Definition at line 92 of file CoreParserFunctions.php.

References DateFormatter::getInstance().

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

Definition at line 183 of file CoreParserFunctions.php.

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

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

Definition at line 355 of file CoreParserFunctions.php.

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

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

Definition at line 361 of file CoreParserFunctions.php.

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

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

Definition at line 156 of file CoreParserFunctions.php.

References $s, and urlFunction().

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

Definition at line 157 of file CoreParserFunctions.php.

References $s, and urlFunction().

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

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

Definition at line 191 of file CoreParserFunctions.php.

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

Definition at line 80 of file CoreParserFunctions.php.

References $args, wfMsgGetKey(), and wfMsgReplaceArgs().

static CoreParserFunctions::isRaw ( param  )  [static]

Definition at line 245 of file CoreParserFunctions.php.

References MagicWord::get().

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

Definition at line 489 of file CoreParserFunctions.php.

References $wgContLang.

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

Definition at line 136 of file CoreParserFunctions.php.

References $s, and $wgContLang.

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

Definition at line 126 of file CoreParserFunctions.php.

References $s, and $wgContLang.

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

Definition at line 154 of file CoreParserFunctions.php.

References $s, and urlFunction().

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

Definition at line 155 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 303 of file CoreParserFunctions.php.

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

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

Definition at line 309 of file CoreParserFunctions.php.

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

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

Definition at line 108 of file CoreParserFunctions.php.

References $wgContLang.

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

Definition at line 292 of file CoreParserFunctions.php.

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

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

Definition at line 271 of file CoreParserFunctions.php.

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

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

Definition at line 280 of file CoreParserFunctions.php.

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

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

Definition at line 274 of file CoreParserFunctions.php.

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

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

Definition at line 283 of file CoreParserFunctions.php.

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

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

Definition at line 277 of file CoreParserFunctions.php.

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

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

Definition at line 265 of file CoreParserFunctions.php.

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

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

Definition at line 268 of file CoreParserFunctions.php.

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

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

Definition at line 286 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 498 of file CoreParserFunctions.php.

Referenced by padleft(), and padright().

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

Definition at line 521 of file CoreParserFunctions.php.

References pad().

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

Definition at line 525 of file CoreParserFunctions.php.

References pad().

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

Definition at line 343 of file CoreParserFunctions.php.

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

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

Definition at line 349 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 421 of file CoreParserFunctions.php.

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

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

Definition at line 289 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.

This doesn't work correctly on preview for getting the size of the current page. 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 453 of file CoreParserFunctions.php.

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

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

Definition at line 217 of file CoreParserFunctions.php.

References $text.

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

Returns the requested protection level for the current page.

Definition at line 482 of file CoreParserFunctions.php.

References $type.

static CoreParserFunctions::register ( parser  )  [static]

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

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

Definition at line 403 of file CoreParserFunctions.php.

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

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

Definition at line 409 of file CoreParserFunctions.php.

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

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

Definition at line 327 of file CoreParserFunctions.php.

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

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

Definition at line 333 of file CoreParserFunctions.php.

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

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

Definition at line 367 of file CoreParserFunctions.php.

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

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

Definition at line 373 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 578 of file CoreParserFunctions.php.

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

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

Definition at line 391 of file CoreParserFunctions.php.

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

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

Definition at line 397 of file CoreParserFunctions.php.

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

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

Definition at line 315 of file CoreParserFunctions.php.

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

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

Definition at line 321 of file CoreParserFunctions.php.

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

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

Definition at line 145 of file CoreParserFunctions.php.

References $s, and $wgContLang.

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

Definition at line 131 of file CoreParserFunctions.php.

References $s, and $wgContLang.

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

Definition at line 122 of file CoreParserFunctions.php.

References $s.

Referenced by anchorencode().

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

Definition at line 159 of file CoreParserFunctions.php.

References $s, $text, $title, Title::makeTitle(), and Title::newFromText().

Referenced by fullurl(), fullurle(), localurl(), and localurle().


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

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