BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
Cite Class Reference
Collaboration diagram for Cite:

Public Member Functions

 ref ($str, array $argv, Parser $parser, PPFrame $frame)
 
 references ($str, array $argv, Parser $parser, PPFrame $frame)
 
 clearState (Parser &$parser)
 
 cloneState (Parser $parser)
 
 checkRefsNoReferences ($afterParse, &$parser, &$text)
 
 checkAnyCalls (&$output)
 

Static Public Member Functions

static getReferencesKey ($key)
 
static setHooks (Parser $parser)
 
static getStoredReferences (Title $title)
 

Public Attributes

const DEFAULT_GROUP = ''
 
const MAX_STORAGE_LENGTH = 65535
 
const EXT_DATA_KEY = 'Cite:References'
 
const DATA_VERSION_NUMBER = 1
 
const CACHE_DURATION_ONPARSE = 3600
 
const CACHE_DURATION_ONFETCH = 18000
 
 $mInCite = false
 
 $mInReferences = false
 

Detailed Description

A parser extension that adds two tags, <ref> and <references> for adding citations to pages

Documentation http://www.mediawiki.org/wiki/Extension:Cite/Cite.php definition in HTML http://www.w3.org/TR/html4/struct/text.html#edef-CITE definition in XHTML 2.0 bug 1. Ævar Arnfjörð Bjarmason avara.nosp@m.b@gm.nosp@m.ail.c.nosp@m.om Copyright © 2005, Ævar Arnfjörð Bjarmason http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later WARNING: MediaWiki core hardcodes this class name to check if the Cite extension is installed. See T89151.

Member Function Documentation

Cite::checkAnyCalls ( $output)

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.

Parameters
$output
Returns
bool
Cite::checkRefsNoReferences (   $afterParse,
$parser,
$text 
)

Called at the end of page processing to append a default references section, if refs were used without a main references tag. If there are references in a custom group, and there is no references tag for it, show an error message for that group. If we are processing a section preview, this adds the missing references tags and does not add the errors.

Parameters
bool$afterParseTrue if called from the ParserAfterParse hook
Parser$parser
string$text
Returns
bool
Cite::clearState ( Parser $parser)

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

Parameters
Parser$parser
Returns
bool
Cite::cloneState ( Parser  $parser)

Gets run when the parser is cloned.

Parameters
Parser$parser
Returns
bool
static Cite::getReferencesKey (   $key)
static

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)

Parameters
string$keyThe key
Returns
string A key for use in wikitext
static Cite::getStoredReferences ( Title  $title)
static

Fetch references stored for the given title in page_props For performance, results are cached

Parameters
Title$title
Returns
array|false
Cite::ref (   $str,
array  $argv,
Parser  $parser,
PPFrame  $frame 
)

Callback function for <ref>

Parameters
string | null$strRaw content of the <ref> tag.
string[]$argv Arguments
Parser$parser
PPFrame$frame
Returns
string
Cite::references (   $str,
array  $argv,
Parser  $parser,
PPFrame  $frame 
)

Callback function for <references>

Parameters
string | null$strRaw content of the <references> tag.
string[]$argv Arguments
Parser$parser
PPFrame$frame
Returns
string
static Cite::setHooks ( Parser  $parser)
static

Initialize the parser hooks

Parameters
Parser$parser
Returns
bool

Member Data Documentation

const Cite::CACHE_DURATION_ONFETCH = 18000

Cache duration set when fetching references from db

const Cite::CACHE_DURATION_ONPARSE = 3600

Cache duration set when parsing a page with references

const Cite::DATA_VERSION_NUMBER = 1

Version number in case we change the data structure in the future

const Cite::DEFAULT_GROUP = ''
Todo:
document
const Cite::EXT_DATA_KEY = 'Cite:References'

Key used for storage in parser output's ExtensionData and ObjectCache

const Cite::MAX_STORAGE_LENGTH = 65535

Maximum storage capacity for pp_value field of page_props table

Todo:
Find a way to retrieve this information from the DBAL

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