[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/extensions/Cite/ -> Cite_body.php (summary)

(no description)

File Size: 1141 lines (34 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Cite:: (25 methods):
  ref()
  guardedRef()
  refArg()
  stack()
  rollbackRef()
  references()
  guardedReferences()
  referencesFormat()
  referencesFormatEntry()
  referenceText()
  referencesFormatEntryNumericBacklinkLabel()
  referencesFormatEntryAlternateBacklinkLabel()
  getLinkLabel()
  refKey()
  referencesKey()
  linkRef()
  listToText()
  genBacklinkLabels()
  genLinkLabels()
  clearState()
  cloneState()
  checkRefsNoReferences()
  checkAnyCalls()
  setHooks()
  error()


Class: Cite  - X-Ref

ref( $str, $argv, $parser, $frame )   X-Ref
Callback function for <ref>

param: $str string Input
param: $argv array Arguments
param: $parser Parser
param: $frame PPFrame
return: string

guardedRef( $str, $argv, $parser, $default_group = CITE_DEFAULT_GROUP )   X-Ref

param: $str string Input
param: $argv array Arguments
param: $parser Parser
param: $default_group string
return: string

refArg( $argv )   X-Ref
Parse the arguments to the <ref> tag

"name" : Key of the reference.
"group" : Group to which it belongs. Needs to be passed to <references /> too.
"follow" : If the current reference is the continuation of another, key of that reference.


param: $argv array The argument vector
return: mixed false on invalid input, a string on valid

stack( $str, $key = null, $group, $follow, $call )   X-Ref
Populate $this->mRefs based on input and arguments to <ref>

param: $str string Input from the <ref> tag
param: $key mixed Argument to the <ref> tag as returned by $this->refArg()
param: $group
param: $follow
param: $call
return: string

rollbackRef( $type, $key, $group, $index )   X-Ref
Partially undoes the effect of calls to stack()

Called by guardedReferences()

The option to define <ref> within <references> makes the
behavior of <ref> context dependent.  This is normally fine
but certain operations (especially #tag) lead to out-of-order
parser evaluation with the <ref> tags being processed before
their containing <reference> element is read.  This leads to
stack corruption that this function works to fix.

This function is not a total rollback since some internal
counters remain incremented.  Doing so prevents accidentally
corrupting certain links.

param: $type
param: $key
param: $group
param: $index

references( $str, $argv, $parser, $frame )   X-Ref
Callback function for <references>

param: $str string Input
param: $argv array Arguments
param: $parser Parser
param: $frame PPFrame
return: string

guardedReferences( $str, $argv, $parser, $group = CITE_DEFAULT_GROUP )   X-Ref

param: $str string
param: $argv array
param: $parser Parser
param: $group string
return: string

referencesFormat( $group )   X-Ref
Make output to be returned from the references() function

param: $group
return: string XHTML ready for output

referencesFormatEntry( $key, $val )   X-Ref
Format a single entry for the referencesFormat() function

param: string $key The key of the reference
param: mixed $val The value of the reference, string for anonymous
return: string Wikitext

referenceText( $key, $text )   X-Ref
Returns formatted reference text

param: String $key
param: String $text
return: String

referencesFormatEntryNumericBacklinkLabel( $base, $offset, $max )   X-Ref
Generate a numeric backlink given a base number and an
offset, e.g. $base = 1, $offset = 2; = 1.2
Since bug #5525, it correctly does 1.9 -> 1.10 as well as 1.099 -> 1.100

param: int $base The base
param: int $offset The offset
param: int $max Maximum value expected.
return: string

referencesFormatEntryAlternateBacklinkLabel( $offset )   X-Ref
Generate a custom format backlink given an offset, e.g.
$offset = 2; = c if $this->mBacklinkLabels = array( 'a',
'b', 'c', ...). Return an error if the offset > the # of
array items

param: int $offset The offset
return: string

getLinkLabel( $offset, $group, $label )   X-Ref
Generate a custom format link for a group given an offset, e.g.
the second <ref group="foo"> is b if $this->mLinkLabels["foo"] =
array( 'a', 'b', 'c', ...).
Return an error if the offset > the # of array items

param: int $offset The offset
param: string $group The group name
param: string $label The text to use if there's no message for them.
return: string

refKey( $key, $num = null )   X-Ref
Return an id for use in wikitext output based on a key and
optionally the number of it, used in <references>, not <ref>
(since otherwise it would link to itself)

param: string $key The key
param: int $num The number of the key
return: string A key for use in wikitext

referencesKey( $key, $num = null )   X-Ref
Return an id for use in wikitext output based on a key and
optionally the number of it, used in <ref>, not <references>
(since otherwise it would link to itself)

param: string $key The key
param: int $num The number of the key
return: string A key for use in wikitext

linkRef( $group, $key, $count = null, $label = null, $subkey = '' )   X-Ref
Generate a link (<sup ...) for the <ref> element from a key
and return XHTML ready for output

param: $group
param: $key string The key for the link
param: $count int The index of the key, used for distinguishing
param: $label int The label to use for the link, I want to
param: $subkey string
return: string

listToText( $arr )   X-Ref
This does approximately the same thing as
Language::listToText() but due to this being used for a
slightly different purpose (people might not want , as the
first separator and not 'and' as the second, and this has to
use messages from the content language) I'm rolling my own.

param: array $arr The array to format
return: string

genBacklinkLabels()   X-Ref
Generate the labels to pass to the
'cite_references_link_many_format' message, the format is an
arbitrary number of tokens separated by [\t\n ]


genLinkLabels( $group, $message )   X-Ref
Generate the labels to pass to the
'cite_reference_link' message instead of numbers, the format is an
arbitrary number of tokens separated by [\t\n ]

param: $group
param: $message

clearState( &$parser )   X-Ref
Gets run when Parser::clearState() gets run, since we don't
want the counts to transcend pages and other instances

param: $parser Parser
return: bool

cloneState( $parser )   X-Ref
Gets run when the parser is cloned.

param: $parser Parser
return: bool

checkRefsNoReferences( $afterParse, &$parser, &$text )   X-Ref
Called at the end of page processing to append an error if refs were
used without a references tag.

param: $afterParse bool  true if called from the ParserAfterParse hook
param: $parser Parser
param: $text string
return: bool

checkAnyCalls( &$output )   X-Ref
Hook for the InlineEditor extension. If any ref or reference reference tag is in the text, the entire
page should be reparsed, so we return false in that case.

param: $output
return: bool

setHooks( $parser )   X-Ref
Initialize the parser hooks

param: $parser Parser
return: bool

error( $key, $param = null, $parse = 'parse' )   X-Ref
Return an error message based on an error ID

param: string $key   Message name for the error
param: string $param Parameter to pass to the message
param: string $parse Whether to parse the message ('parse') or not ('noparse')
return: string XHTML or wikitext ready for output



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1