|
MediaWiki
REL1_20
|
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= '', $inLanguage= '') |
| 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 | namespacenumber ($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= '', $arg1=null, $arg2=null) |
| Return the number of pages, files or subcats in the given category, or 0 if it's nonexistent. | |
| 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 | speciale ($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 28 of file CoreParserFunctions.php.
| static CoreParserFunctions::anchorencode | ( | $ | parser, |
| $ | text | ||
| ) | [static] |
| $parser | Parser |
| $text |
Definition at line 740 of file CoreParserFunctions.php.
| static CoreParserFunctions::basepagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 532 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::basepagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 538 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::canonicalurl | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 242 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::canonicalurle | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 243 of file CoreParserFunctions.php.
References $s, and 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 767 of file CoreParserFunctions.php.
References $magicWords, and wfMessage().
| 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 357 of file CoreParserFunctions.php.
References $title, Parser\MARKER_SUFFIX, Title\newFromText(), Sanitizer\normalizeCharReferences(), Sanitizer\removeHTMLtags(), and Sanitizer\stripAllTags().
| static CoreParserFunctions::filepath | ( | $ | parser, |
| $ | name = '', |
||
| $ | argA = '', |
||
| $ | argB = '' |
||
| ) | [static] |
Definition at line 793 of file CoreParserFunctions.php.
References $file, $url, wfExpandUrl(), and wfFindFile().
| static CoreParserFunctions::formatDate | ( | $ | parser, |
| $ | date, | ||
| $ | defaultPref = null |
||
| ) | [static] |
| $parser | Parser | |
| $date | ||
| null | $defaultPref |
Definition at line 131 of file CoreParserFunctions.php.
References DateFormatter\getInstance().
| static CoreParserFunctions::formatnum | ( | $ | parser, |
| $ | num = '', |
||
| $ | raw = null |
||
| ) | [static] |
| $parser | Parser | |
| string | $num | |
| null | $raw |
Definition at line 275 of file CoreParserFunctions.php.
| static CoreParserFunctions::formatRaw | ( | $ | num, |
| $ | raw | ||
| ) | [static] |
Definition at line 401 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 508 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::fullpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 514 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::fullurl | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 240 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::fullurle | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 241 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::gender | ( | $ | parser, |
| $ | username | ||
| ) | [static] |
| $parser | Parser |
| $username | string |
Definition at line 300 of file CoreParserFunctions.php.
References $title, $user, User\getDefaultOption(), User\newFromName(), Title\newFromText(), GenderCache\singleton(), wfProfileIn(), and wfProfileOut().
| static CoreParserFunctions::grammar | ( | $ | parser, |
| $ | case = '', |
||
| $ | word = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $case | |
| string | $word |
Definition at line 290 of file CoreParserFunctions.php.
| static CoreParserFunctions::intFunction | ( | $ | parser, |
| $ | part1 = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $part1 |
Definition at line 115 of file CoreParserFunctions.php.
References wfMessage().
| static CoreParserFunctions::isRaw | ( | $ | param | ) | [static] |
Definition at line 389 of file CoreParserFunctions.php.
References MagicWord\get().
| static CoreParserFunctions::language | ( | $ | parser, |
| $ | code = '', |
||
| $ | inLanguage = '' |
||
| ) | [static] |
Gives language names.
| $parser | Parser |
| $code | String Language code (of which to get name) |
| $inLanguage | String Language code (in which to get name) |
Definition at line 692 of file CoreParserFunctions.php.
References Language\fetchLanguageName(), and wfBCP47().
| static CoreParserFunctions::lc | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $s |
Definition at line 223 of file CoreParserFunctions.php.
References $s, and $wgContLang.
| static CoreParserFunctions::lcfirst | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
Definition at line 208 of file CoreParserFunctions.php.
References $s, and $wgContLang.
| static CoreParserFunctions::localurl | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 238 of file CoreParserFunctions.php.
References $s, and urlFunction().
| static CoreParserFunctions::localurle | ( | $ | parser, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 239 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 448 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::namespacee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 454 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
| static CoreParserFunctions::namespacenumber | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 460 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::ns | ( | $ | parser, |
| $ | part1 = '' |
||
| ) | [static] |
Definition at line 148 of file CoreParserFunctions.php.
References $wgContLang.
Referenced by nse().
| static CoreParserFunctions::nse | ( | $ | parser, |
| $ | part1 = '' |
||
| ) | [static] |
Definition at line 162 of file CoreParserFunctions.php.
References ns(), and wfUrlencode().
| static CoreParserFunctions::numberingroup | ( | $ | parser, |
| $ | name = '', |
||
| $ | raw = null |
||
| ) | [static] |
Definition at line 436 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\numberingroup().
| static CoreParserFunctions::numberofactiveusers | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 415 of file CoreParserFunctions.php.
References SiteStats\activeUsers(), and formatRaw().
| static CoreParserFunctions::numberofadmins | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 424 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\numberingroup().
| static CoreParserFunctions::numberofarticles | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 418 of file CoreParserFunctions.php.
References SiteStats\articles(), and formatRaw().
| static CoreParserFunctions::numberofedits | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 427 of file CoreParserFunctions.php.
References SiteStats\edits(), and formatRaw().
| static CoreParserFunctions::numberoffiles | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 421 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\images().
| static CoreParserFunctions::numberofpages | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 409 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\pages().
| static CoreParserFunctions::numberofusers | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 412 of file CoreParserFunctions.php.
References formatRaw(), and SiteStats\users().
| static CoreParserFunctions::numberofviews | ( | $ | parser, |
| $ | raw = null |
||
| ) | [static] |
Definition at line 430 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 703 of file CoreParserFunctions.php.
Referenced by padleft(), and padright().
| static CoreParserFunctions::padleft | ( | $ | parser, |
| $ | string = '', |
||
| $ | length = 0, |
||
| $ | padding = '0' |
||
| ) | [static] |
Definition at line 727 of file CoreParserFunctions.php.
References pad().
| static CoreParserFunctions::padright | ( | $ | parser, |
| $ | string = '', |
||
| $ | length = 0, |
||
| $ | padding = '0' |
||
| ) | [static] |
Definition at line 731 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 496 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::pagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 502 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::pagesincategory | ( | $ | parser, |
| $ | name = '', |
||
| $ | arg1 = null, |
||
| $ | arg2 = null |
||
| ) | [static] |
Return the number of pages, files or subcats in the given category, or 0 if it's nonexistent.
This is an expensive parser function and can't be called too many times per page.
Definition at line 575 of file CoreParserFunctions.php.
References $count, $magicWords, $title, formatRaw(), Title\makeTitleSafe(), and Category\newFromTitle().
| static CoreParserFunctions::pagesinnamespace | ( | $ | parser, |
| $ | namespace = 0, |
||
| $ | raw = null |
||
| ) | [static] |
Definition at line 433 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 648 of file CoreParserFunctions.php.
References $page, $title, formatRaw(), Title\newFromText(), Revision\newFromTitle(), and IDBAccessObject\READ_NORMAL.
| static CoreParserFunctions::plural | ( | $ | parser, |
| $ | text = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $text |
Definition at line 342 of file CoreParserFunctions.php.
| static CoreParserFunctions::protectionlevel | ( | $ | parser, |
| $ | type = '' |
||
| ) | [static] |
Returns the requested protection level for the current page.
Definition at line 678 of file CoreParserFunctions.php.
| static CoreParserFunctions::register | ( | $ | parser | ) | [static] |
| $parser | Parser |
Definition at line 33 of file CoreParserFunctions.php.
Referenced by Parser_LinkHooks\firstCallInit().
| static CoreParserFunctions::special | ( | $ | parser, |
| $ | text | ||
| ) | [static] |
Definition at line 745 of file CoreParserFunctions.php.
References $page, $title, SpecialPage\getTitleFor(), SpecialPageFactory\resolveAlias(), and wfMessage().
| static CoreParserFunctions::speciale | ( | $ | parser, |
| $ | text | ||
| ) | [static] |
Definition at line 755 of file CoreParserFunctions.php.
References wfUrlencode().
| static CoreParserFunctions::subjectpagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 556 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::subjectpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 562 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::subjectspace | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 478 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::subjectspacee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 484 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
| static CoreParserFunctions::subpagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 520 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::subpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 526 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 831 of file CoreParserFunctions.php.
References $params, $value, PPFrame\STRIP_COMMENTS, and wfMessage().
| static CoreParserFunctions::talkpagename | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 544 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::talkpagenamee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 550 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfEscapeWikiText().
| static CoreParserFunctions::talkspace | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 466 of file CoreParserFunctions.php.
References $t, $title, and Title\newFromText().
| static CoreParserFunctions::talkspacee | ( | $ | parser, |
| $ | title = null |
||
| ) | [static] |
Definition at line 472 of file CoreParserFunctions.php.
References $t, $title, Title\newFromText(), and wfUrlencode().
| static CoreParserFunctions::uc | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
| $parser | Parser | |
| string | $s |
Definition at line 233 of file CoreParserFunctions.php.
References $s, and $wgContLang.
| static CoreParserFunctions::ucfirst | ( | $ | parser, |
| $ | s = '' |
||
| ) | [static] |
Definition at line 213 of file CoreParserFunctions.php.
References $s, and $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 182 of file CoreParserFunctions.php.
References $magicWords, and $s.
| static CoreParserFunctions::urlFunction | ( | $ | func, |
| $ | s = '', |
||
| $ | arg = null |
||
| ) | [static] |
Definition at line 245 of file CoreParserFunctions.php.
References $s, $title, Title\makeTitle(), Title\newFromText(), and Title\newFromURL().
Referenced by canonicalurl(), canonicalurle(), fullurl(), fullurle(), localurl(), and localurle().