MediaWiki
REL1_19
|
Various core parser functions, registered in Parser::firstCallInit() More...
Static Public Member Functions | |
static | anchorencode ($parser, $text) |
static | basepagename ($parser, $title=null) |
static | basepagenamee ($parser, $title=null) |
static | canonicalurl ($parser, $s= '', $arg=null) |
static | canonicalurle ($parser, $s= '', $arg=null) |
static | defaultsort ($parser, $text, $uarg= '') |
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 | filepath ($parser, $name='', $argA='', $argB='') |
static | formatDate ($parser, $date, $defaultPref=null) |
static | formatnum ($parser, $num= '', $raw=null) |
static | formatRaw ($num, $raw) |
static | fullpagename ($parser, $title=null) |
static | fullpagenamee ($parser, $title=null) |
static | fullurl ($parser, $s= '', $arg=null) |
static | fullurle ($parser, $s= '', $arg=null) |
static | gender ($parser, $username) |
static | grammar ($parser, $case= '', $word= '') |
static | intFunction ($parser, $part1= '') |
static | isRaw ($param) |
static | language ($parser, $code= '', $language= '') |
Gives language names. | |
static | lc ($parser, $s= '') |
static | lcfirst ($parser, $s= '') |
static | localurl ($parser, $s= '', $arg=null) |
static | localurle ($parser, $s= '', $arg=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 | ns ($parser, $part1= '') |
static | nse ($parser, $part1= '') |
static | numberingroup ($parser, $name= '', $raw=null) |
static | numberofactiveusers ($parser, $raw=null) |
static | numberofadmins ($parser, $raw=null) |
static | numberofarticles ($parser, $raw=null) |
static | numberofedits ($parser, $raw=null) |
static | numberoffiles ($parser, $raw=null) |
static | numberofpages ($parser, $raw=null) |
static | numberofusers ($parser, $raw=null) |
static | numberofviews ($parser, $raw=null) |
static | pad ($parser, $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 | pagename ($parser, $title=null) |
Functions to get and normalize pagenames, corresponding to the magic words of the same names. | |
static | pagenamee ($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 | pagesinnamespace ($parser, $namespace=0, $raw=null) |
static | pagesize ($parser, $page= '', $raw=null) |
Return the size of the given page, or 0 if it's nonexistent. | |
static | plural ($parser, $text= '') |
static | protectionlevel ($parser, $type= '') |
Returns the requested protection level for the current page. | |
static | register ($parser) |
static | special ($parser, $text) |
static | subjectpagename ($parser, $title=null) |
static | subjectpagenamee ($parser, $title=null) |
static | subjectspace ($parser, $title=null) |
static | subjectspacee ($parser, $title=null) |
static | subpagename ($parser, $title=null) |
static | subpagenamee ($parser, $title=null) |
static | tagObj ($parser, $frame, $args) |
Parser function to extension tag adaptor. | |
static | talkpagename ($parser, $title=null) |
static | talkpagenamee ($parser, $title=null) |
static | talkspace ($parser, $title=null) |
static | talkspacee ($parser, $title=null) |
static | uc ($parser, $s= '') |
static | ucfirst ($parser, $s= '') |
static | urlencode ($parser, $s= '', $arg=null) |
urlencodes a string according to one of three patterns: (bug 22474) | |
static | urlFunction ($func, $s= '', $arg=null) |
Various core parser functions, registered in Parser::firstCallInit()
Definition at line 12 of file CoreParserFunctions.php.
static CoreParserFunctions::anchorencode | ( | $ | parser, |
$ | text | ||
) | [static] |
$parser | Parser |
$text |
Definition at line 677 of file CoreParserFunctions.php.
static CoreParserFunctions::basepagename | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 501 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::basepagenamee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 507 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::canonicalurl | ( | $ | parser, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
Definition at line 222 of file CoreParserFunctions.php.
References urlFunction().
static CoreParserFunctions::canonicalurle | ( | $ | parser, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
Definition at line 223 of file CoreParserFunctions.php.
References urlFunction().
static CoreParserFunctions::defaultsort | ( | $ | parser, |
$ | text, | ||
$ | uarg = '' |
||
) | [static] |
$parser | Parser |
$text | String The sortkey to use |
$uarg | String Either "noreplace" or "noerror" (in en) both suppress errors, and noreplace does nothing if a default sortkey already exists. |
Definition at line 700 of file CoreParserFunctions.php.
References $magicWords, and wfMsgForContent().
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.
$parser | Parser: parent parser |
$text | String: desired title text |
Definition at line 334 of file CoreParserFunctions.php.
References $title, $wgRestrictDisplayTitle, Parser\MARKER_SUFFIX, Title\newFromText(), Sanitizer\normalizeCharReferences(), Sanitizer\removeHTMLtags(), and Sanitizer\stripAllTags().
static CoreParserFunctions::filepath | ( | $ | parser, |
$ | name = '' , |
||
$ | argA = '' , |
||
$ | argB = '' |
||
) | [static] |
Definition at line 727 of file CoreParserFunctions.php.
References $file, $size, $url, wfExpandUrl(), and wfFindFile().
static CoreParserFunctions::formatDate | ( | $ | parser, |
$ | date, | ||
$ | defaultPref = null |
||
) | [static] |
$parser | Parser | |
$date | ||
null | $defaultPref |
Definition at line 113 of file CoreParserFunctions.php.
References DateFormatter\getInstance().
static CoreParserFunctions::formatnum | ( | $ | parser, |
$ | num = '' , |
||
$ | raw = null |
||
) | [static] |
$parser | Parser | |
string | $num | |
null | $raw |
Definition at line 255 of file CoreParserFunctions.php.
static CoreParserFunctions::formatRaw | ( | $ | num, |
$ | raw | ||
) | [static] |
Definition at line 378 of file CoreParserFunctions.php.
References $wgContLang.
Referenced by numberingroup(), numberofactiveusers(), numberofadmins(), numberofarticles(), numberofedits(), numberoffiles(), numberofpages(), numberofusers(), numberofviews(), pagesincategory(), pagesinnamespace(), and pagesize().
static CoreParserFunctions::fullpagename | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 477 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::fullpagenamee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 483 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::fullurl | ( | $ | parser, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
Definition at line 220 of file CoreParserFunctions.php.
References urlFunction().
static CoreParserFunctions::fullurle | ( | $ | parser, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
Definition at line 221 of file CoreParserFunctions.php.
References urlFunction().
static CoreParserFunctions::gender | ( | $ | parser, |
$ | username | ||
) | [static] |
$parser | Parser |
$username | string |
Definition at line 280 of file CoreParserFunctions.php.
References $title, $user, User\getDefaultOption(), User\newFromName(), Title\newFromText(), wfProfileIn(), and wfProfileOut().
static CoreParserFunctions::grammar | ( | $ | parser, |
$ | case = '' , |
||
$ | word = '' |
||
) | [static] |
$parser | Parser | |
string | $case | |
string | $word |
Definition at line 270 of file CoreParserFunctions.php.
static CoreParserFunctions::intFunction | ( | $ | parser, |
$ | part1 = '' |
||
) | [static] |
$parser | Parser | |
string | $part1 |
Definition at line 97 of file CoreParserFunctions.php.
References wfMessage().
static CoreParserFunctions::isRaw | ( | $ | param | ) | [static] |
Definition at line 366 of file CoreParserFunctions.php.
References MagicWord\get().
static CoreParserFunctions::language | ( | $ | parser, |
$ | code = '' , |
||
$ | language = '' |
||
) | [static] |
Gives language names.
Definition at line 623 of file CoreParserFunctions.php.
References $language, $wgContLang, Language\getTranslatedLanguageNames(), and wfBCP47().
static CoreParserFunctions::lc | ( | $ | parser, |
$ | s = '' |
||
) | [static] |
$parser | Parser | |
string | $s |
Definition at line 203 of file CoreParserFunctions.php.
References $wgContLang.
static CoreParserFunctions::lcfirst | ( | $ | parser, |
$ | s = '' |
||
) | [static] |
Definition at line 188 of file CoreParserFunctions.php.
References $wgContLang.
static CoreParserFunctions::localurl | ( | $ | parser, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
Definition at line 218 of file CoreParserFunctions.php.
References urlFunction().
static CoreParserFunctions::localurle | ( | $ | parser, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
Definition at line 219 of file CoreParserFunctions.php.
References 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 424 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
static CoreParserFunctions::namespacee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 430 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
static CoreParserFunctions::ns | ( | $ | parser, |
$ | part1 = '' |
||
) | [static] |
Definition at line 129 of file CoreParserFunctions.php.
References $wgContLang.
Referenced by nse().
static CoreParserFunctions::nse | ( | $ | parser, |
$ | part1 = '' |
||
) | [static] |
Definition at line 143 of file CoreParserFunctions.php.
References ns(), and wfUrlencode().
static CoreParserFunctions::numberingroup | ( | $ | parser, |
$ | name = '' , |
||
$ | raw = null |
||
) | [static] |
Definition at line 413 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\numberingroup().
static CoreParserFunctions::numberofactiveusers | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 392 of file CoreParserFunctions.php.
References SiteStats\activeUsers(), and formatRaw().
static CoreParserFunctions::numberofadmins | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 401 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\numberingroup().
static CoreParserFunctions::numberofarticles | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 395 of file CoreParserFunctions.php.
References SiteStats\articles(), and formatRaw().
static CoreParserFunctions::numberofedits | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 404 of file CoreParserFunctions.php.
References SiteStats\edits(), and formatRaw().
static CoreParserFunctions::numberoffiles | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 398 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\images().
static CoreParserFunctions::numberofpages | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 386 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\pages().
static CoreParserFunctions::numberofusers | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 389 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\users().
static CoreParserFunctions::numberofviews | ( | $ | parser, |
$ | raw = null |
||
) | [static] |
Definition at line 407 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\views().
static CoreParserFunctions::pad | ( | $ | parser, |
$ | 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 640 of file CoreParserFunctions.php.
Referenced by padleft(), and padright().
static CoreParserFunctions::padleft | ( | $ | parser, |
$ | string = '' , |
||
$ | length = 0 , |
||
$ | padding = '0' |
||
) | [static] |
Definition at line 664 of file CoreParserFunctions.php.
References pad().
static CoreParserFunctions::padright | ( | $ | parser, |
$ | string = '' , |
||
$ | length = 0 , |
||
$ | padding = '0' |
||
) | [static] |
Definition at line 668 of file CoreParserFunctions.php.
References pad().
static CoreParserFunctions::pagename | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Functions to get and normalize pagenames, corresponding to the magic words of the same names.
Definition at line 465 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::pagenamee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 471 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
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 543 of file CoreParserFunctions.php.
References $count, formatRaw(), and Category\newFromName().
static CoreParserFunctions::pagesinnamespace | ( | $ | parser, |
$ | namespace = 0 , |
||
$ | raw = null |
||
) | [static] |
Definition at line 410 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.
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?
Document parameters
$parser | Parser |
$page | String TODO DOCUMENT (Default: empty string) |
$raw | TODO DOCUMENT (Default: null) |
Definition at line 580 of file CoreParserFunctions.php.
References $page, $title, formatRaw(), Title\newFromText(), and Revision\newFromTitle().
static CoreParserFunctions::plural | ( | $ | parser, |
$ | text = '' |
||
) | [static] |
$parser | Parser | |
string | $text |
Definition at line 320 of file CoreParserFunctions.php.
static CoreParserFunctions::protectionlevel | ( | $ | parser, |
$ | type = '' |
||
) | [static] |
Returns the requested protection level for the current page.
Definition at line 609 of file CoreParserFunctions.php.
static CoreParserFunctions::register | ( | $ | parser | ) | [static] |
$parser | Parser |
Definition at line 17 of file CoreParserFunctions.php.
References $wgAllowDisplayTitle, and $wgAllowSlowParserFunctions.
Referenced by Parser_LinkHooks\firstCallInit(), and Parser\firstCallInit().
static CoreParserFunctions::special | ( | $ | parser, |
$ | text | ||
) | [static] |
Definition at line 682 of file CoreParserFunctions.php.
References $page, $title, SpecialPage\getTitleFor(), SpecialPageFactory\resolveAlias(), and wfMsgForContent().
static CoreParserFunctions::subjectpagename | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 525 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::subjectpagenamee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 531 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::subjectspace | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 448 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
static CoreParserFunctions::subjectspacee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 454 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
static CoreParserFunctions::subpagename | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 489 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::subpagenamee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 495 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::tagObj | ( | $ | parser, |
$ | frame, | ||
$ | args | ||
) | [static] |
Parser function to extension tag adaptor.
Definition at line 772 of file CoreParserFunctions.php.
References PPFrame\STRIP_COMMENTS, and wfMsgForContent().
static CoreParserFunctions::talkpagename | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 513 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::talkpagenamee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 519 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
static CoreParserFunctions::talkspace | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 436 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
static CoreParserFunctions::talkspacee | ( | $ | parser, |
$ | title = null |
||
) | [static] |
Definition at line 442 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
static CoreParserFunctions::uc | ( | $ | parser, |
$ | s = '' |
||
) | [static] |
$parser | Parser | |
string | $s |
Definition at line 213 of file CoreParserFunctions.php.
References $wgContLang.
static CoreParserFunctions::ucfirst | ( | $ | parser, |
$ | s = '' |
||
) | [static] |
Definition at line 193 of file CoreParserFunctions.php.
References $wgContLang.
static CoreParserFunctions::urlencode | ( | $ | parser, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
urlencodes a string according to one of three patterns: (bug 22474)
By default (for HTTP "query" strings), spaces are encoded as '+'. Or to encode a value for the HTTP "path", spaces are encoded as '%20'. For links to "wiki"s, or similar software, spaces are encoded as '_',
$parser | Parser object |
$s | String: The text to encode. |
$arg | String (optional): The type of encoding. |
Definition at line 162 of file CoreParserFunctions.php.
References $magicWords.
static CoreParserFunctions::urlFunction | ( | $ | func, |
$ | s = '' , |
||
$ | arg = null |
||
) | [static] |
Definition at line 225 of file CoreParserFunctions.php.
References $title, Title\makeTitle(), Title\newFromText(), and Title\newFromURL().
Referenced by canonicalurl(), canonicalurle(), fullurl(), fullurle(), localurl(), and localurle().