BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
CoreParserFunctions Class Reference

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= '', $arg=null)
 
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 canonicalurl ($parser, $s= '', $arg=null)
 
static canonicalurle ($parser, $s= '', $arg=null)
 
static urlFunction ($func, $s= '', $arg=null)
 
static formatnum ($parser, $num= '', $arg=null)
 
static grammar ($parser, $case= '', $word= '')
 
static gender ($parser, $username)
 
static plural ($parser, $text= '')
 
static bidi ($parser, $text= '')
 
static displaytitle ($parser, $text= '', $uarg= '')
 
static formatRaw ($num, $raw, $language)
 
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 pagesinnamespace ($parser, $namespace=0, $raw=null)
 
static numberingroup ($parser, $name= '', $raw=null)
 
static mwnamespace ($parser, $title=null)
 
static namespacee ($parser, $title=null)
 
static namespacenumber ($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 rootpagename ($parser, $title=null)
 
static rootpagenamee ($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= '', $arg1=null, $arg2=null)
 
static pagesize ($parser, $page= '', $raw=null)
 
static protectionlevel ($parser, $type= '', $title= '')
 
static protectionexpiry ($parser, $type= '', $title= '')
 
static language ($parser, $code= '', $inLanguage= '')
 
static pad ($parser, $string, $length, $padding= '0', $direction=STR_PAD_RIGHT)
 
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 speciale ($parser, $text)
 
static defaultsort ($parser, $text, $uarg= '')
 
static filepath ($parser, $name= '', $argA= '', $argB= '')
 
static tagObj ($parser, $frame, $args)
 
static pageid ($parser, $title=null)
 
static revisionid ($parser, $title=null)
 
static revisionday ($parser, $title=null)
 
static revisionday2 ($parser, $title=null)
 
static revisionmonth ($parser, $title=null)
 
static revisionmonth1 ($parser, $title=null)
 
static revisionyear ($parser, $title=null)
 
static revisiontimestamp ($parser, $title=null)
 
static revisionuser ($parser, $title=null)
 
static cascadingsources ($parser, $title= '')
 

Detailed Description

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

Member Function Documentation

static CoreParserFunctions::anchorencode (   $parser,
  $text 
)
static
Parameters
Parser$parser
string$text
Returns
string
static CoreParserFunctions::bidi (   $parser,
  $text = '' 
)
static
Parameters
Parser$parser
string$text
Returns
string
static CoreParserFunctions::cascadingsources (   $parser,
  $title = '' 
)
static

Returns the sources of any cascading protection acting on a specified page. Pages will not return their own title unless they transclude themselves. This is an expensive parser function and can't be called too many times per page, unless cascading protection sources for the page have already been loaded.

Parameters
Parser$parser
string$title
Returns
string
Since
1.23
static CoreParserFunctions::defaultsort (   $parser,
  $text,
  $uarg = '' 
)
static
Parameters
Parser$parser
string$textThe sortkey to use
string$uargEither "noreplace" or "noerror" (in en) both suppress errors, and noreplace does nothing if a default sortkey already exists.
Returns
string
static CoreParserFunctions::displaytitle (   $parser,
  $text = '',
  $uarg = '' 
)
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$parserParent parser
string$textDesired title text
string$uarg
Returns
string
static CoreParserFunctions::filepath (   $parser,
  $name = '',
  $argA = '',
  $argB = '' 
)
static

Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} or {{filepath|300|nowiki}} or {{filepath|300px}}, {{filepath|200x300px}}, {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}.

Parameters
Parser$parser
string$name
string$argA
string$argB
Returns
array|string
static CoreParserFunctions::formatDate (   $parser,
  $date,
  $defaultPref = null 
)
static
Parameters
Parser$parser
string$date
string$defaultPref
Returns
string
static CoreParserFunctions::formatnum (   $parser,
  $num = '',
  $arg = null 
)
static
Parameters
Parser$parser
string$num
string$arg
Returns
string
static CoreParserFunctions::formatRaw (   $num,
  $raw,
  $language 
)
static

Formats a number according to a language.

Parameters
int | float$num
string$raw
Language | StubUserLang$language
Returns
string
static CoreParserFunctions::gender (   $parser,
  $username 
)
static
Parameters
Parser$parser
string$username
Returns
string
static CoreParserFunctions::grammar (   $parser,
  $case = '',
  $word = '' 
)
static
Parameters
Parser$parser
string$case
string$word
Returns
string
static CoreParserFunctions::intFunction (   $parser,
  $part1 = '' 
)
static
Parameters
Parser$parser
string$part1
Returns
array
static CoreParserFunctions::language (   $parser,
  $code = '',
  $inLanguage = '' 
)
static

Gives language names.

Parameters
Parser$parser
string$codeLanguage code (of which to get name)
string$inLanguageLanguage code (in which to get name)
Returns
string
static CoreParserFunctions::lc (   $parser,
  $s = '' 
)
static
Parameters
Parser$parser
string$s
Returns
string
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

Parameters
Parser$parser
string$title
Returns
mixed|string
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

Parameters
Parser$parser
string$string
int$length
string$padding
int$direction
Returns
string
static CoreParserFunctions::pageid (   $parser,
  $title = null 
)
static

Get the pageid of a specified page

Parameters
Parser$parser
string$titleTitle to get the pageid from
Returns
int|null|string
Since
1.23
static CoreParserFunctions::pagename (   $parser,
  $title = null 
)
static

Functions to get and normalize pagenames, corresponding to the magic words of the same names

Parameters
Parser$parser
string$title
Returns
string
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.

Parameters
Parser$parser
string$name
string$arg1
string$arg2
Returns
string
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.

Parameters
Parser$parser
string$pageName of page to check (Default: empty string)
string$rawShould number be human readable with commas or just number
Returns
string
static CoreParserFunctions::plural (   $parser,
  $text = '' 
)
static
Parameters
Parser$parser
string$text
Returns
string
static CoreParserFunctions::protectionexpiry (   $parser,
  $type = '',
  $title = '' 
)
static

Returns the requested protection expiry for the current page. This is an expensive parser function and can't be called too many times per page, unless the protection levels/expiries for the given title have already been retrieved

Parameters
Parser$parser
string$type
string$title
Returns
string
static CoreParserFunctions::protectionlevel (   $parser,
  $type = '',
  $title = '' 
)
static

Returns the requested protection level for the current page. This is an expensive parser function and can't be called too many times per page, unless the protection levels/expiries for the given title have already been retrieved

Parameters
Parser$parser
string$type
string$title
Returns
string
static CoreParserFunctions::register (   $parser)
static
Parameters
Parser$parser
Returns
void
static CoreParserFunctions::revisionday (   $parser,
  $title = null 
)
static

Get the day from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the day from
Returns
string
Since
1.23
static CoreParserFunctions::revisionday2 (   $parser,
  $title = null 
)
static

Get the day with leading zeros from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the day from
Returns
string
Since
1.23
static CoreParserFunctions::revisionid (   $parser,
  $title = null 
)
static

Get the id from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the id from
Returns
int|null|string
Since
1.23
static CoreParserFunctions::revisionmonth (   $parser,
  $title = null 
)
static

Get the month with leading zeros from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the month from
Returns
string
Since
1.23
static CoreParserFunctions::revisionmonth1 (   $parser,
  $title = null 
)
static

Get the month from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the month from
Returns
string
Since
1.23
static CoreParserFunctions::revisiontimestamp (   $parser,
  $title = null 
)
static

Get the timestamp from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the timestamp from
Returns
string
Since
1.23
static CoreParserFunctions::revisionuser (   $parser,
  $title = null 
)
static

Get the user from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the user from
Returns
string
Since
1.23
static CoreParserFunctions::revisionyear (   $parser,
  $title = null 
)
static

Get the year from the last revision of a specified page.

Parameters
Parser$parser
string$titleTitle to get the year from
Returns
string
Since
1.23
static CoreParserFunctions::tagObj (   $parser,
  $frame,
  $args 
)
static

Parser function to extension tag adaptor

Parameters
Parser$parser
PPFrame$frame
PPNode[]$args
Returns
string
static CoreParserFunctions::uc (   $parser,
  $s = '' 
)
static
Parameters
Parser$parser
string$s
Returns
string
static CoreParserFunctions::urlencode (   $parser,
  $s = '',
  $arg = null 
)
static

urlencodes a string according to one of three patterns: (T24474)

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 '_',

Parameters
Parser$parser
string$sThe text to encode.
string$arg(optional): The type of encoding.
Returns
string

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